Developer Documentation

Build with one API.
Use multiple AI models.

NovaAPI Hub provides an OpenAI-compatible API for supported AI models through a single developer endpoint. Create an API key, choose a model, and start making requests.

Quick Start

  1. Create an account and sign in.
  2. Create an API key in the Console.
  3. Send requests to the NovaAPI Hub endpoint using your API key.
  4. Monitor usage and credits from your dashboard.

Estimate monthly costs and generate a server-side integration example →

Base URL: https://novaapihub.com/v1

Authentication

Send your API key as a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Keep API keys private. Do not expose them in browser-side JavaScript, public repositories, or client applications.

Chat Completions

NovaAPI Hub supports the OpenAI-compatible Chat Completions interface.

POST /v1/chat/completions

Request fields

FieldPurpose
modelExact model ID available to your API key.
messagesConversation messages. The text example below uses a user role and string content.
streamEnable incremental output only for a model that supports it.

Optional parameters and message formats depend on the selected model and gateway implementation. Add them one at a time after a minimal request succeeds.

Request

curl https://novaapihub.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-luna",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Reading the response

For compatible non-streaming responses, read text from choices[0].message.content and inspect choices[0].finish_reason. Content may be empty when tool calls are returned. When supplied, the usage fields report token usage; reconcile charges with Console billing records.

The completion ID is not necessarily the gateway request ID used for support.

Streaming

For compatible models, set stream to true to receive incremental output. Use an SDK or an SSE parser; network chunks do not necessarily align with events. Read text deltas from choices[0].delta.content, when present.

A disconnect does not prove the upstream request stopped or that no charge occurred. Avoid automatically restarting partially received generations. Verify completion markers, errors and usage behavior with the selected model.

{
  "model": "gpt-5.6-luna",
  "messages": [
    {"role": "user", "content": "Write a short welcome message."}
  ],
  "stream": true
}

Models & pricing

Model pricing · USD per 1M tokens
ModelInputOutputPositioning
GPT-5.6-sol$6.00$30.00Flagship
GPT-5.6-terra$3.00$18.00Core model
GPT-5.6-luna$0.35$2.00Low-cost, high-volume
DeepSeek Flash
deepseek-flash
$0.80$3.00For users in China

Input and output tokens are billed separately at the rates above. Copy the exact API model ID from the Console before use; The DeepSeek model ID is deepseek-flash. Access, supported parameters and limits depend on the selected model and your account.

Select a model

Copy the exact model ID from the Console. Display names are not always API IDs. Check your key permissions and verify the endpoint, streaming, tool calls, image input, structured output and token limits for that model before integration. This page does not guarantee those capabilities across all models.

Code Examples

Python

Install the SDK with pip install openai. Set NOVAAPI_API_KEY securely in your server environment.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NOVAAPI_API_KEY"],
    base_url="https://novaapihub.com/v1"
)

response = client.chat.completions.create(
    model="gpt-5.6-luna",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

JavaScript (server-side Node.js)

Install with npm install openai. Set NOVAAPI_API_KEY in your server environment. Do not put a secret key into a browser bundle.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.NOVAAPI_API_KEY,
  baseURL: "https://novaapihub.com/v1"
});

const response = await client.chat.completions.create({
  model: "gpt-5.6-luna",
  messages: [{ role: "user", content: "Hello!" }]
});

console.log(response.choices[0].message.content);

Error Handling

The following statuses are a troubleshooting guide. Actual status and error payload depend on the gateway and upstream. Check the returned error message as well as the HTTP status; an insufficient balance is not guaranteed to return 402.

StatusMeaning
400Invalid request or unsupported parameter.
401Missing or invalid API key.
403Access to the requested resource or model is not allowed.
404Endpoint or model not found.
429Rate limit or temporary request limit reached.
402Insufficient available credits for the request.
5xxTemporary server or upstream provider error.

Timeouts & retries

Set a finite client timeout appropriate to the model and output length. SDKs may retry automatically: inspect their retry settings and avoid layering multiple retry loops.

For transient errors, use a bounded number of retries with exponential backoff and jitter. Respect Retry-After when provided. Correct authentication, permissions, balance or request errors before retrying. A timeout may occur after generation starts, so a repeated request may incur another charge.

Before contacting support

  1. Test one minimal text request with an allowed model.
  2. Check the base URL, key, model ID and available balance.
  3. Record the time, status and redacted error message.
  4. Include a gateway request ID if returned; otherwise mention that none was provided.

Email [email protected]. Remove keys, personal data and payment details from examples.

Credits & Pricing

Purchase usage credits through the NovaAPI Hub wallet.

$5 Credits$10 Credits$20 Credits

Token cost estimate = input tokens / 1,000,000 × input rate + output tokens / 1,000,000 × output rate. For the published Luna rates, 10,000 input tokens plus 2,000 output tokens equals $0.0075 before additional charges or account adjustments.

Cache, image, audio, reasoning or other usage may have different billing rules. Confirm applicable rates, credited balance, expiry and refund conditions before purchase. For interrupted or failed requests, consult the usage record and support rather than assuming the charge is zero.