API Documentation
NovAI provides an OpenAI-compatible REST API. If you've used OpenAI's API before, you already know how to use NovAI — just change the base URL and API key.
| Catalog | 116 live models, including 31 audio/video models and 5 free models |
| Chat & embeddings | Current NovAI input/output rates per 1M tokens; embeddings charge input tokens only |
| TokenHub media | $1.54 / 1M tokens; charge = actual tokens ÷ 1,000,000 × $1.54 |
| Per-second video | Seedance rates vary by resolution; charge = seconds × current resolution rate |
| Per-character TTS | Qwen3 TTS Flash: $0.0145 / 1K characters |
| Free tier | $2 signup credit; 5 free-to-call models within current daily limits; no card required |
Billing and price display
Every displayed price is generated from the same NovAI billing configuration used for settlement. The model page shows the current unit, formula and, where reliable reference usage exists, a lightweight estimator.
- Token models: actual tokens ÷ 1,000,000 × the displayed NovAI rate. TokenHub audio/video currently use $1.54 per 1M tokens.
- Per-second models: seconds × the displayed rate for the selected resolution.
- Per-character models: characters ÷ 1,000 × the displayed NovAI rate.
- Per-image, per-generation and free models: the displayed current NovAI rate applies; free models remain subject to current limits.
Estimator results and per-second, per-song or per-image examples for token-billed models are reference estimates only. The final charge is reconciled to actual usage. Models without reliable reference usage show the real billing unit and formula but no invented fixed total.
Overview
NovAI is an AI API gateway based in Hong Kong, offering low-latency access to Chinese AI models through a unified, OpenAI-compatible interface.
Authentication
All API requests require an API key passed via the Authorization header:
Authorization: Bearer nvai-your-api-key-here
Get your API key by signing up at aiapi-pro.com. Registration requires only an email address.
Base URL
https://aiapi-pro.com/v1
Replace https://api.openai.com/v1 with the URL above in any existing OpenAI integration.
Available Models
Chat Models
| Model ID (click to copy) | Provider | Input | Output | Context | Notes |
|---|---|---|---|---|---|
| glm-4.6v-flash | Zhipu AI | Free | Free | 128K | Free multimodal FREE |
| glm-5 | Zhipu AI | $0.60 | $1.92 | 128K | Multimodal flagship |
| glm-5.1 | Zhipu AI | $1.05 | $3.50 | 128K | 8-hour autonomous coding |
| glm-5.2 | Zhipu AI | $1.19 | $3.74 | 1M | 1M context flagship NEW |
| glm-5.3 | Zhipu AI | $1.25 | $4.00 | 1M | Newest flagship, coding & agents NEW |
| glm-5v-turbo | Zhipu AI | $1.10 | $3.70 | 128K | Vision + coding multimodal NEW |
| minimax-text-01 | MiniMax | $0.14 | $1.10 | 1M | 1M context window |
| minimax-m3.1-flash | MiniMax | $0.15 | $0.60 | 1M | Fast low-cost tier of the M3 family NEW |
| glm-4.6v | Zhipu AI | $0.30 | $0.90 | 128K | Multimodal vision |
| hy4-preview | Tencent | $0.834 | $2.501 | 1M | Next-gen flagship preview NEW |
| hy4 | Tencent | $0.417 | $1.2505 | 1M | Hunyuan hy4 production flagship NEW |
| hy4-flash | Tencent | $0.035 | $0.1405 | 1M | Cost-efficient hy4 flash tier, reasoning NEW |
| glm-5.3-flash | Zhipu AI | $0.08 | $0.28 | 1M | Budget flagship, coding & agents NEW |
| kimi-k2.8-preview | Moonshot | $0.93 | $3.89 | 256K | Next-gen agentic reasoning preview NEW |
| kimi-k3.1-pro | Moonshot | $2.00 | $10.00 | 1M | Premium tier above Kimi K3 NEW |
| kimi-k3.1-pro-highspeed | Moonshot | $4.00 | $20.9231 | 1M | Low-latency tier of Kimi K3.1 Pro NEW |
| hunyuan-t1-vision | Tencent | $0.55 | $1.64 | — | HY-Vision-1.5-Thinking, deep-reasoning vision NEW |
| hy-mt2-plus | Tencent | $0.072 | $0.287 | 8K | Machine translation, 30+ languages NEW |
| hy-mt2-lite | Tencent | $0.043 | $0.172 | 8K | Budget machine translation NEW |
| hy-vision-2.0-instruct | Tencent | $1.154 | $2.692 | — | Fast multimodal vision-language (OCR, VQA) NEW |
| hunyuan-turbos-vision-video | Tencent | $0.462 | $1.385 | — | Image & video frame understanding NEW |
| hy-role | Tencent | $0.369 | $1.477 | 32K | Role-play & character model NEW |
| deepseek-v4.1-flash | DeepSeek | $0.308 | $1.231 | 128K | Fast reasoning LLM for chat & agents NEW |
| deepseek-v4-flash-vision | DeepSeek | $0.308 | $1.231 | 128K | Fast vision-language (experimental) NEW |
Embedding Models
| Model ID (click to copy) | Provider | Input | Modality | Dims | Notes |
|---|---|---|---|---|---|
| kinfra-text-embedding-4b | Tencent | $0.0923 | Text | 2560 | High-quality text vectors for RAG & search NEW |
| kinfra-text-embedding-0.6b | Tencent | $0.0769 | Text | 1024 | Fast, compact text vectors NEW |
| kinfra-vl-embedding-8b | Tencent | $0.0923 | Multimodal | — | Text + image + video vectors NEW |
| kinfra-vl-embedding-2b | Tencent | $0.0769 | Multimodal | — | Fast multimodal vectors NEW |
Quick Start Example
curl https://aiapi-pro.com/v1/chat/completions \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.6v-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'
API Playground TRY FREE — NO SIGNUP
Test the API right here in your browser. Uses the free GLM-5.3-FlashX demo through Tencent Cloud TokenHub — no API key required.
Chat Completions
POST /v1/chat/completions
Creates a model response for the given conversation.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use (see table above) |
| messages | array | Required | List of messages in the conversation |
| temperature | float | Optional | Sampling temperature (0-2). Default: 1.0 |
| max_tokens | integer | Optional | Maximum tokens to generate |
| stream | boolean | Optional | Enable streaming responses. Default: false |
| tools | array | Optional | Tool definitions for models that support function calling |
| tool_choice | string | object | Optional | Controls whether the model may call a tool; support varies by model |
| parallel_tool_calls | boolean | Optional | Allows multiple tool calls where supported. Default: true |
| top_p | float | Optional | Nucleus sampling parameter. Default: 1.0 |
Message Object
| Field | Type | Description |
|---|---|---|
| role | string | system, user, or assistant |
| content | string | The message content |
Example Request
curl https://aiapi-pro.com/v1/chat/completions \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 500
}'
Example Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1709942400,
"model": "glm-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 9,
"total_tokens": 29
}
}
Responses API RESPONSES FORMAT
POST /v1/responses
NovAI supports a Responses API-compatible endpoint for supported Chinese AI models. This enables Responses API-based applications to use models such as GLM and MiniMax through a unified base URL.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use |
| input | string | array | Required | Text prompt or message array |
| instructions | string | Optional | System instructions for the model |
| stream | boolean | Optional | Enable SSE streaming. Default: false |
| temperature | float | Optional | Sampling temperature (0-2). Default: 0.7 |
| max_output_tokens | integer | Optional | Maximum tokens to generate |
| tools | array | Optional | Function/tool definitions |
| tool_choice | string | Optional | auto, required, or none |
Example: Simple Request
curl https://aiapi-pro.com/v1/responses \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"input": "Explain quantum computing simply.",
"stream": false
}'
Example: Conversation with Instructions
curl https://aiapi-pro.com/v1/responses \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"instructions": "You are a senior code reviewer.",
"input": [
{"role": "user", "content": "Review: def add(a,b): return a+b"}
],
"stream": true
}'
Example Response
{
"id": "resp_abc123...",
"object": "response",
"status": "completed",
"model": "glm-5",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{"type": "output_text", "text": "Quantum computing uses..."}
]
}
],
"usage": {
"input_tokens": 12,
"output_tokens": 150,
"total_tokens": 162
}
}
Compatible Tools
The following tools work out of the box with NovAI's Responses API endpoint:
- Open Cowork — Set Base URL to https://aiapi-pro.com/v1
- OpenAI Agents SDK — Pass NovAI client to Runner
- OpenAI Python SDK (responses mode) — Set base_url
- Any custom application using POST /v1/responses
Read the full guide: Responses API for Chinese Models →
Function Calling & Streaming Reliability
The following reflects NovAI's own gateway testing, cross-checked by an independent reviewer. Use it to choose models for agent / tool-calling workloads.
Known upstream caveats (model behavior, not gateway bugs):
- Some models (GLM-4.6v, MiniMax-M3, Kimi-K2.8-preview) may emit assistant content before tool_calls in streaming responses. If your framework assumes tool_calls arrive first, prefer the reliable list above.
- Several chat-capable models do not support tool calling; treat tool-calling support as per-model.
- reasoning_tokens is reported by the upstream provider. For some thinking models (e.g. step-5-preview-fast) upstream may return reasoning_tokens = 0 while still streaming reasoning_content; if you need exact reasoning-token counts, estimate locally from the reasoning text.
- glm-4.6v-flash is a free flash tier that can return HTTP 429 under upstream load; use glm-4.6v for production tool-calling.
Function Calling
Function calling is a two-step protocol: the model returns a structured tool call, your application executes that tool, and you append the result as a tool message before the next request. Tool support varies by model; check the model page and handle models that return ordinary text instead.
1. Send a request with a tool definition
curl https://aiapi-pro.com/v1/chat/completions \
-H "Authorization: Bearer $NOVAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"messages": [{"role": "user", "content": "What is the weather in Paris?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}],
"tool_choice": "auto"
}'
2. Read the tool call; do not execute model text blindly
{
"choices": [{
"message": {
"role": "assistant",
"content": null,
"tool_calls": [{
"id": "call_abc123",
"type": "function",
"function": {"name": "get_weather", "arguments": "{\"city\":\"Paris\"}"}
}]
},
"finish_reason": "tool_calls"
}]
}
Validate the function name and parse the JSON arguments in your application. Enforce your own allowlist, permissions and argument schema before executing anything.
3. Execute the tool and send the result back
{
"model": "glm-5.1",
"messages": [
{"role": "user", "content": "What is the weather in Paris?"},
{"role": "assistant", "content": null, "tool_calls": [{
"id": "call_abc123", "type": "function",
"function": {"name": "get_weather", "arguments": "{\"city\":\"Paris\"}"}
}]},
{"role": "tool", "tool_call_id": "call_abc123", "content": "{\"temperature_c\":18,\"condition\":\"cloudy\"}"}
],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}
}
}]
}
The next response can use the tool result to produce a user-facing answer. In streaming mode, accumulate delta.tool_calls fragments by index and id before parsing arguments. Never assume tool calls arrive before assistant content.
Embeddings NEW
POST /v1/embeddings
Creates a vector representation of the input, powered by Tencent Kinfra embedding models. Text models return 1024–2560 dimension vectors; multimodal (VL) models embed text, images and video in one shared space for cross-modal retrieval.
Available models
| Model | Modality | Dimensions | NovAI price / 1M input tokens |
|---|---|---|---|
| kinfra-text-embedding-4b | Text | 2560 | $0.0923 / 1M input tokens 1M input tokens: $0.0923 reference estimate |
| kinfra-text-embedding-0.6b | Text | 1024 | $0.0769 / 1M input tokens 1M input tokens: $0.0769 reference estimate |
| kinfra-vl-embedding-8b | Multimodal (text + image + video) | — | $0.0923 / 1M input tokens 1M input tokens: $0.0923 reference estimate |
| kinfra-vl-embedding-2b | Multimodal (text + image + video) | — | $0.0769 / 1M input tokens 1M input tokens: $0.0769 reference estimate |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Embedding model ID (see table above) |
| input | string | array | Required | Text models: a string or list of strings. Multimodal (VL) models: an object array such as [{"type":"text","text":"..."}] or [{"type":"image_url","image_url":"..."}] |
Example Request (text)
curl https://aiapi-pro.com/v1/embeddings \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kinfra-text-embedding-4b",
"input": "The quick brown fox"
}'
Example Request (multimodal)
curl https://aiapi-pro.com/v1/embeddings \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kinfra-vl-embedding-8b",
"input": [{"type": "text", "text": "a cat sitting on a mat"}]
}'
Example Response
{
"object": "list",
"data": [
{"object": "embedding", "index": 0, "embedding": [0.0023, -0.0091, ...]}
],
"model": "kinfra-text-embedding-4b",
"usage": {"prompt_tokens": 5, "total_tokens": 5}
}
Billing: only input tokens are charged (at the per-1M rate above); the returned vectors are free.
Image Generation NEW
POST /v1/images/generations
Generates images from a text prompt, powered by Tencent Hunyuan, Vidu, ByteDance Seedream, WAND Vega and MiniMax image models via the TokenHub gateway. Returns an OpenAI-compatible {created, data:[{url}]} response. Even for models that are asynchronous upstream, NovAI polls to completion internally and returns the final image URL synchronously.
Available models
| Model | Vendor | Max size | Reference images | NovAI current billing |
|---|---|---|---|---|
| hy-image-v3 | Tencent Hunyuan | ≤1024² | 0–3 | $1.54 / 1M tokens |
| vidu-image-q2 | Vidu (Shengshu) | 1080p–4K | 0–7 | $1.54 / 1M tokens |
| seedream-image-v5.0-pro | ByteDance Seedream | 1K–2K | ≤10 | $1.54 / 1M tokens |
| seedream-image-v5.0-lite | ByteDance Seedream | 2K–4K | ≤14 | $1.54 / 1M tokens |
| wand-vega-image-lite | Tencent WAND Vega | 1K–4K | 0–3 | $1.54 / 1M tokens |
| wand-vega-image-flash | Tencent WAND Vega | 1K–4K | 0–6 | $1.54 / 1M tokens |
| wand-vega-image-pro | Tencent WAND Vega | 1K–4K | 0–6 | $1.54 / 1M tokens |
| minimax-image-h3 | MiniMax | 1K tested | T2I | $1.54 / 1M tokens |
| minimax-image-h3-highspeed | MiniMax | 1K tested | T2I | $1.54 / 1M tokens |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Image model ID (see table above) |
| prompt | string | Required | Text description of the image to generate |
| n | integer | Optional | Number of images to generate (1–4, default 1) |
| size | string | Optional | Image size as WxH (e.g. 1024x1024). Mapped to each vendor's allowed sizes / aspect ratios. |
| images | string | array | Optional | Reference image URL(s) for image-to-image editing (count limit varies by model) |
Example Request (text-to-image)
curl https://aiapi-pro.com/v1/images/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "hy-image-v3",
"prompt": "a cute orange cat on a windowsill, soft sunlight",
"size": "1024x1024",
"n": 1
}'
Example Request (image editing)
curl https://aiapi-pro.com/v1/images/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "vidu-image-q2",
"prompt": "change the background to a snowy mountain",
"images": ["https://example.com/input.jpg"],
"size": "1024x1024"
}'
Example Response
{
"created": 1730000000,
"data": [
{"url": "https://.../generated-image.png"}
],
"usage": {"total_tokens": 20000}
}
Billing: the response usage.total_tokens is the actual token count; the charge is total_tokens ÷ 1,000,000 × $1.54 for TokenHub models. For example, 20,000 tokens is a $0.0308 reference charge. Final charges use actual usage.
Audio NEW
Two OpenAI-compatible audio endpoints powered by MiniMax and Tencent models via the TokenHub gateway: /v1/audio/speech (text → audio: TTS + music) and /v1/audio/transcriptions (audio → text: ASR). Both are synchronous.
Speech & music models — POST /v1/audio/speech
| Model | Vendor | Type | NovAI current billing |
|---|---|---|---|
| minimax-speech-2.8-hd | MiniMax | TTS (flagship) | $1.54 / 1M tokens 1,000 characters: $0.0539 reference estimate |
| minimax-speech-2.8-turbo | MiniMax | TTS (fast) | $1.54 / 1M tokens 1,000 characters: $0.0308 reference estimate |
| minimax-speech-2.6-hd | MiniMax | TTS | $1.54 / 1M tokens 1,000 characters: $0.0539 reference estimate |
| minimax-speech-2.6-turbo | MiniMax | TTS (fast) | $1.54 / 1M tokens 1,000 characters: $0.0308 reference estimate |
| minimax-speech-02-hd | MiniMax | TTS | $1.54 / 1M tokens 1,000 characters: $0.0539 reference estimate |
| minimax-speech-02-turbo | MiniMax | TTS (fast) | $1.54 / 1M tokens 1,000 characters: $0.0308 reference estimate |
| minimax-music-v3.0 | MiniMax | Music (lyrics→song) | $1.54 / 1M tokens 1 song: $0.154 reference estimate |
| minimax-music-v2.6 | MiniMax | Music (lyrics→song) | $1.54 / 1M tokens 1 song: $0.154 reference estimate |
Transcription models — POST /v1/audio/transcriptions
| Model | Vendor | Features | NovAI current billing |
|---|---|---|---|
| hy-asr-3.0-preview | Tencent Hunyuan | Timestamps, SRT subtitles | $1.54 / 1M tokens 5 seconds: $0.000169 reference estimate |
| wand-asr-v1 | Tencent WAND | Multilingual, language detection | $1.54 / 1M tokens 5 seconds: $0.000385 reference estimate |
Speech request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Speech or music model ID (see tables above) |
| input | string | Required | Text to speak (TTS). For music models pass lyrics and prompt instead. |
| voice | string | Optional | Voice ID (TTS). Default male-qn-qingse. |
| response_format | string | Optional | mp3 (default, binary audio), wav/opus/aac/flac/pcm, or url (NovAI extension: JSON with an audio_url). |
| speed / vol / pitch / emotion | number/string | Optional | Voice tweaks (TTS): speed 0.5–2, vol 0–10, pitch −12–12. |
| lyrics / prompt | string | Optional | Music models only: song lyrics and style prompt. |
Example Request (TTS → audio URL)
curl https://aiapi-pro.com/v1/audio/speech \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-speech-2.8-hd",
"input": "Hello, welcome to NovAI.",
"voice": "male-qn-qingse",
"response_format": "url"
}'
Example Response (response_format=url)
{
"id": "audgen-...",
"model": "minimax-speech-2.8-hd",
"status": "completed",
"audio_url": "https://.../speech/....mp3",
"usage": {"total_tokens": 1505, "characters": 43}
}
With the default response_format=mp3 the endpoint instead streams raw audio bytes (Content-Type: audio/mpeg), exactly like OpenAI’s native /v1/audio/speech — so the OpenAI SDK works unchanged.
Example Request (transcription)
# JSON form: transcribe from a URL
curl https://aiapi-pro.com/v1/audio/transcriptions \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{"model": "wand-asr-v1", "file_url": "https://example.com/audio.mp3"}'
# OpenAI multipart form: upload a file
curl https://aiapi-pro.com/v1/audio/transcriptions \
-H "Authorization: Bearer nvai-your-key" \
-F model=hy-asr-3.0-preview \
-F [email protected]
Example Response (transcription)
{
"text": "Hello, welcome to NovAI.",
"language": "en",
"duration_ms": 2426,
"sentences": [{"begin_ms": 0, "end_ms": 2426, "text": "Hello, welcome to NovAI."}],
"subtitle_url": "https://.../....srt",
"usage": {"total_tokens": 121}
}
Billing: the charge is usage.total_tokens ÷ 1,000,000 × $1.54. Transcription accepts either a multipart file upload (OpenAI-native) or a JSON file_url / base64 data field.
Video Generation NEW
POST /v1/video/generations + GET /v1/video/generations/{id}
Generates video from a text prompt (and optional source image), powered by MiniMax Hailuo and Tencent Hunyuan video models via the TokenHub gateway. Video generation is asynchronous: submit a task to get an id, then poll the GET endpoint until status is succeeded (the mp4 is in video_url) or failed (auto-refunded).
Available models
| Model | Vendor | Capabilities | Resolution | Reference usage (if published) | NovAI current billing |
|---|---|---|---|---|---|
| minimax-video-h3 | MiniMax (海螺) | T2V | 768P/2K | 768p: 50,000 tokens/s; 2k: 80,000 tokens/s | $1.54 / 1M tokens 768p · 5 seconds: $0.385 reference estimate |
| minimax-video-h3-max | MiniMax (海螺) | T2V (top quality) | 480P/768P | Not published; no fixed per-unit estimate | $1.54 / 1M tokens |
| minimax-video-v2.3 | MiniMax (海螺) | T2V | 768P/1080P | Not published; no fixed per-unit estimate | $1.54 / 1M tokens |
| minimax-video-v2.3-fast | MiniMax (海螺) | I2V only | 768P/1080P | Not published; no fixed per-unit estimate | $1.54 / 1M tokens |
| hy-video-v1.5 | Tencent Hunyuan | T2V + I2V | 720p/1080p | Not published; no fixed per-unit estimate | $1.54 / 1M tokens |
Submit request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Video model ID (see table above) |
| prompt | string | Required | Text description of the video to generate |
| image | string | Optional | Source image URL for image-to-video. Required for minimax-video-v2.3-fast (I2V-only). |
| duration | number | Optional | Clip length in seconds (default 5) |
| resolution | string | Optional | Default 720p (maps to 768P). minimax-video-h3: 768p/2k; minimax-video-h3-max: 480p/768p; other MiniMax models: 720p/1080p (mapped to 768P/1080P). Unsupported tiers return 400. |
| ratio | string | Optional | Aspect ratio, e.g. 16:9 (default), 9:16, 1:1 |
Example Request (text-to-video)
curl https://aiapi-pro.com/v1/video/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-video-h3",
"prompt": "A red sports car driving along a coastal road at sunset, cinematic",
"resolution": "720p",
"duration": 5,
"ratio": "16:9"
}'
Example Request (image-to-video)
curl https://aiapi-pro.com/v1/video/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "hy-video-v1.5",
"prompt": "Animate this scene with smooth cinematic motion",
"image": "https://example.com/first-frame.jpg",
"duration": 5
}'
Example Response (submit)
{
"id": "<task_id>",
"status": "queued",
"model": "minimax-video-h3",
"resolution": "720p",
"duration": 5
}
Poll the task
curl "https://aiapi-pro.com/v1/video/generations/<task_id>?model=minimax-video-h3" \
-H "Authorization: Bearer nvai-your-key"
Example Response (poll, completed)
{
"id": "<task_id>",
"status": "succeeded",
"video_url": "https://.../output.mp4",
"video_result": [{"url": "https://.../output.mp4"}],
"duration": 5,
"tokenhub_usage": {"total_tokens": 250000},
"novai_token_settlement": {
"prepaid_usd": 0.384625, "actual_usd": 0.384625,
"adjustment_usd": 0.0, "total_tokens": 250000
}
}
Billing: while status is queued/processing keep polling (generation typically takes 1–5 minutes). On succeeded the pre-deducted estimate is reconciled to the real token count and novai_token_settlement reports the adjustment. On failed/cancelled the pre-deducted amount is automatically refunded.
3D Generation NEW
POST /v1/three_d/generations + GET /v1/three_d/generations/{id}
Generates a 3D model (mesh) from a text prompt and/or a source image, powered by Tencent Hunyuan 3D, Tencent Miora and Tripo (VAST) models via the TokenHub gateway. 3D generation is asynchronous: submit a task to get an id, then poll the GET endpoint until status is succeeded (downloadable model URLs are in outputs, primary in model_url) or failed (auto-refunded).
Available models
| Model | Vendor | Input | Output formats | Price / generation |
|---|---|---|---|---|
| hy-3d-express | Tencent Hunyuan | — | obj (zip) | $0.277 |
| hy-3d-3.0 | Tencent Hunyuan | — | obj (zip) + glb | $0.369 |
| hy-3d-3.1 | Tencent Hunyuan | — | obj (zip) + glb | $0.369 |
| hy-3d-motion | Tencent Hunyuan | — | fbx | $0.185 |
| hy-3d-polygen-image | Tencent Hunyuan | — | glb + obj + fbx | $0.554 |
| tripo-3d-3.1 | Tripo (VAST) | — | glb | $0.323 |
| tripo-3d-p1 | Tripo (VAST) | — | glb | $0.323 |
| miora-3d-1.2 | Tencent Miora | — | glb + obj | $0.462 |
| miora-3d-t1 | Tencent Miora | — | glb + obj | $0.369 |
Submit request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | 3D model ID (see table above) |
| prompt | string | Conditional | Text description of the 3D asset. Required for text-to-3D; at least one of prompt / image must be provided. |
| image | string | Conditional | Source image URL for image-to-3D. Required for hy-3d-polygen-image. |
Example Request (text-to-3D)
curl https://aiapi-pro.com/v1/three_d/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "hy-3d-3.1",
"prompt": "a cute cartoon dog"
}'
Example Request (image-to-3D)
curl https://aiapi-pro.com/v1/three_d/generations \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "tripo-3d-3.1",
"image": "https://example.com/object.png"
}'
Example Response (submit)
{
"id": "<task_id>",
"request_id": "3dgen-...",
"status": "queued",
"model": "hy-3d-3.1"
}
Poll the task
curl "https://aiapi-pro.com/v1/three_d/generations/<task_id>?model=hy-3d-3.1" \
-H "Authorization: Bearer nvai-your-key"
Example Response (poll, completed)
{
"id": "<task_id>",
"status": "succeeded",
"upstream_status": "completed",
"model_url": "https://.../model.glb",
"outputs": [
{"type": "obj", "url": "https://.../model.obj.zip", "preview_image_url": "https://.../preview.png"},
{"type": "glb", "url": "https://.../model.glb", "preview_image_url": "https://.../preview.png"}
],
"model": "hy-3d-3.1"
}
Billing: while status is queued/processing keep polling (generation typically takes 1–8 minutes). On succeeded the flat pre-deducted price is final (no token reconciliation). On failed/cancelled the pre-deducted amount is automatically refunded (novai_refund is reported in the response). model_url is the primary downloadable asset (glb preferred); outputs lists every available format.
Streaming
Set "stream": true to receive responses as Server-Sent Events (SSE):
curl https://aiapi-pro.com/v1/chat/completions \
-H "Authorization: Bearer nvai-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'
Each SSE event contains a JSON chunk with delta.content for the new token. The stream ends with [DONE].
List Models
GET /v1/models
Returns a list of all available models.
curl https://aiapi-pro.com/v1/models \
-H "Authorization: Bearer nvai-your-key"
Context Windows and History
The Context column is the model's maximum combined input context, not a guaranteed output allowance. System instructions, tool definitions, prior messages, retrieved documents, images and the current user input all consume context. max_tokens limits generated output and should be budgeted separately.
- Keep a rolling history and summarize or retrieve older turns before reaching the model limit.
- Leave headroom for the response; a request that fits the input window can still fail if the requested output exceeds the remaining budget.
- Token counts vary by tokenizer and modality. Use usage from actual responses rather than character-count estimates for billing decisions.
- For Responses API requests, instructions, input and tool definitions count toward context.
Retries, Backoff and Request IDs
Retry only transient failures such as connection errors, HTTP 408, 429, 500, 502, 503 and 504. Do not blindly retry authentication, validation or insufficient-balance errors.
- Use exponential backoff with jitter, for example 1s, 2s, 4s, 8s, capped at 30s. Respect Retry-After when present.
- Limit total attempts and elapsed time. A 429 can be NovAI free-tier throttling or an upstream provider limit; inspect the error body and provider label.
- 502/503/504 usually indicate an upstream or gateway failure. They can be transient, but repeated failures should trigger alerting rather than an endless retry loop.
- Make tool execution idempotent. If a request may have reached the provider before a network failure, do not repeat a non-idempotent side effect without a deduplication key.
- Reconnecting a partially consumed stream can repeat generation and billing. Treat stream retries as a new request and discard partial output unless your application explicitly reconciles it.
Request IDs
Streaming chat responses include X-Request-Id. Non-streaming chat responses expose the gateway request ID in the JSON id field. Some media endpoints use X-NovAI-Request-Id. Save the value with your logs and include it when contacting support; do not include API keys or sensitive prompt content in support messages.
curl -i https://aiapi-pro.com/v1/chat/completions \
-H "Authorization: Bearer $NOVAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.1","messages":[{"role":"user","content":"Hello"}],"stream":true}'
Error Codes
| HTTP Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or missing required fields |
| 401 | Unauthorized | Invalid or missing API key |
| 402 | Insufficient Balance | Account balance too low (does not apply to free models) |
| 404 | Not Found | Invalid model ID |
| 429 | Rate Limited | Too many requests, please slow down |
| 500 | Server Error | Internal error; retry with backoff if transient |
| 502 | Bad Gateway | Upstream/provider failure; retry with backoff |
| 503 | Service Unavailable | Temporary gateway or provider unavailability |
| 504 | Gateway Timeout | Upstream response timed out; retry cautiously |
Rate Limits
Current rate limits:
- Accounts with any completed top-up: no fixed NovAI-side request-rate cap; provider throttling, concurrency controls and fair-use protections can still apply.
- Never-topped-up accounts: 5 requests/minute, plus up to 10 free-model calls per day (5 free video generations per day); resets at midnight UTC+8.
- Provider-side congestion: a model vendor may throttle during peak hours. Those 429 responses are labeled with the provider name and reason — they are not NovAI caps.
SDKs & Libraries
OpenAI-compatible SDKs can be used for supported chat features by setting the base URL. Feature support varies by model:
Python
pip install openai
from openai import OpenAI
client = OpenAI(api_key="nvai-...", base_url="https://aiapi-pro.com/v1")
Node.js
npm install openai
import OpenAI from 'openai';
const client = new OpenAI({ apiKey: 'nvai-...', baseURL: 'https://aiapi-pro.com/v1' });
LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="glm-5", openai_api_key="nvai-...", openai_api_base="https://aiapi-pro.com/v1")
Cursor IDE / Continue
Set base URL to https://aiapi-pro.com/v1 in your IDE settings. See our Cursor setup guide.
More examples: GitHub Repository | Blog & Tutorials
Supported Email Providers
Due to bot attacks targeting our free welcome credit, NovAI restricts new account registration to major email providers. This policy applies to new registrations only — all existing accounts are fully unaffected.
If your email provider is not listed below, please contact [email protected] for manual approval.
| Provider | Accepted Domains | Notes |
|---|---|---|
gmail.com, googlemail.com | Recommended | |
| Microsoft | outlook.com, hotmail.com, live.com, msn.com | Recommended |
| Yahoo | yahoo.com, yahoo.co.jp, yahoo.co.uk | |
| Apple | icloud.com, me.com, mac.com | |
| Proton | protonmail.com, proton.me | Privacy-focused |
| Tutanota | tutanota.com | Privacy-focused |
| Zoho | zoho.com | Business / developer |
| GMX | gmx.com, gmx.net | Europe popular |
| AOL | aol.com | |
| Mail.com | mail.com | |
| Yandex | yandex.com | |
| Naver | naver.com | Korea |
| Daum / Kakao | daum.net | Korea |
| Web.de | web.de, t-online.de | Germany |
| Mail.ru | mail.ru | Russia |
Note: Custom domain emails, dynamic DNS addresses, and temporary/disposable email services are not accepted. This restriction was introduced on June 24, 2026 to combat bot abuse. All 3,000+ users registered before this date are fully unaffected.