novita-ai

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Novita AI

Novita AI

Access 200+ AI models through a unified API — LLM chat and embeddings (DeepSeek, Llama, Qwen), image generation and editing (FLUX, Stable Diffusion, Seedream), video generation (Kling, Wan, Hailuo, Vidu), text-to-speech, speech recognition, and GPU cloud infrastructure.
  • OpenAI-compatible LLM API works as a drop-in replacement with any OpenAI SDK
  • 30+ image endpoints covering generation, editing, upscaling, background removal, face merging, and more
  • Video generation from 7+ providers including Kling, Wan, Minimax Hailuo, Vidu, and Seedance
  • Full GPU cloud management — instances, templates, storage, and serverless endpoints
通过统一API访问200+ AI模型——包括LLM对话与嵌入(DeepSeek、Llama、Qwen)、图像生成与编辑(FLUX、Stable Diffusion、Seedream)、视频生成(Kling、Wan、Hailuo、Vidu)、文本转语音、语音识别以及GPU云基础设施。
  • 兼容OpenAI的LLM API可直接替换,适配任意OpenAI SDK
  • 30+图像端点,覆盖生成、编辑、放大、背景移除、人脸融合等功能
  • 7+提供商的视频生成服务,包括Kling、Wan、Minimax Hailuo、Vidu和Seedance
  • 完整的GPU云管理——实例、模板、存储与无服务器端点

Setup

配置步骤

  1. Get an API key at novita.ai/settings/key-management
  2. Set the environment variable:
    export NOVITA_API_KEY=your_key
  3. All requests use
    Authorization: Bearer $NOVITA_API_KEY
    header
  4. Base URL:
    https://api.novita.ai
  5. Full documentation: novita.ai/docs/api-reference
  1. novita.ai/settings/key-management获取API密钥
  2. 设置环境变量:
    export NOVITA_API_KEY=your_key
  3. 所有请求使用
    Authorization: Bearer $NOVITA_API_KEY
    请求头
  4. 基础URL:
    https://api.novita.ai
  5. 完整文档:novita.ai/docs/api-reference

Services

服务列表

ServiceUse WhenEndpointsMode
LLMChat, completion, embeddings, reranking
/openai/v1/*
Sync / Stream
Image GenerationText-to-image, image-to-imageFLUX, SD, Seedream, Qwen, Hunyuan, GLMSync / Async
Image EditingRemove BG, upscale, inpaint, outpaint, cleanup, reimagine, merge face
/v3/*
Sync / Async
Video GenerationText-to-video, image-to-videoKling, Wan, Hunyuan, Hailuo, Vidu, PixVerse, SeedanceAsync
AudioTTS, ASR, voice cloningMiniMax, GLM, Fish AudioSync
BatchBulk LLM processing
/openai/v1/batches
Async
GPU CloudInstances, templates, storage, serverless
/gpu-instance/openapi/v1/*
Sync
AccountBalance, billing
/openapi/v1/billing/*
Sync
服务类型使用场景端点模式
LLM对话、补全、嵌入、重排序
/openai/v1/*
同步/流式
图像生成文生图、图生图FLUX、SD、Seedream、Qwen、混元、GLM同步/异步
图像编辑移除背景、放大、修复、扩图、清理、重绘、人脸融合
/v3/*
同步/异步
视频生成文生视频、图生视频Kling、Wan、混元、Hailuo、Vidu、PixVerse、Seedance异步
音频TTS、ASR、语音克隆MiniMax、GLM、Fish Audio同步
批量处理大规模LLM任务
/openai/v1/batches
异步
GPU云实例、模板、存储、无服务器端点
/gpu-instance/openapi/v1/*
同步
账户服务余额、账单
/openapi/v1/billing/*
同步

LLM (OpenAI-Compatible)

LLM(兼容OpenAI)

The LLM API is a drop-in replacement for the OpenAI API. Use the standard OpenAI SDK — just change the base URL to
https://api.novita.ai/openai
.
python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.novita.ai/openai",
    api_key="YOUR_NOVITA_API_KEY",
)

response = client.chat.completions.create(
    model="deepseek/deepseek-v3-0324",
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=512,
)
MethodPathPurpose
POST
/openai/v1/chat/completions
Chat completion (streaming supported)
POST
/openai/v1/completions
Text completion
POST
/openai/v1/embeddings
Text embeddings
POST
/openai/v1/rerank
Document reranking
GET
/openai/v1/models
List available models
Key models:
deepseek/deepseek-v3-0324
,
deepseek/deepseek-r1
,
meta-llama/llama-3.1-70b-instruct
,
Qwen/Qwen2.5-72B-Instruct
. Embedding:
baai/bge-m3
. Rerank:
baai/bge-reranker-v2-m3
. Full list via
/models
.
Features: vision (multimodal), reasoning, function calling, structured outputs, prompt caching, batch API.
For full parameters and examples → references/llm-api.md
LLM API可直接替换OpenAI API。使用标准OpenAI SDK,仅需将基础URL修改为
https://api.novita.ai/openai
python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.novita.ai/openai",
    api_key="YOUR_NOVITA_API_KEY",
)

response = client.chat.completions.create(
    model="deepseek/deepseek-v3-0324",
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=512,
)
请求方法路径用途
POST
/openai/v1/chat/completions
对话补全(支持流式输出)
POST
/openai/v1/completions
文本补全
POST
/openai/v1/embeddings
文本嵌入
POST
/openai/v1/rerank
文档重排序
GET
/openai/v1/models
列出可用模型
核心模型
deepseek/deepseek-v3-0324
deepseek/deepseek-r1
meta-llama/llama-3.1-70b-instruct
Qwen/Qwen2.5-72B-Instruct
。嵌入模型:
baai/bge-m3
。重排序模型:
baai/bge-reranker-v2-m3
。完整模型列表可通过
/models
获取。
功能特性:多模态视觉、推理、函数调用、结构化输出、提示词缓存、批量API。
完整参数与示例 → references/llm-api.md

Image Generation

图像生成

EndpointPathModeDescription
FLUX.1 Schnell
POST /v3beta/flux-1-schnell
SyncFast text-to-image, cheapest option
FLUX Kontext Dev/Pro/Max
POST /v3/async/flux-1-kontext-*
AsyncAdvanced generation with image editing
FLUX 2 Dev/Flex/Pro
POST /v3/async/flux-2-*
AsyncLatest FLUX models
Stable Diffusion txt2img
POST /v3/async/txt2img
AsyncFull SD control with LoRAs, samplers
Stable Diffusion img2img
POST /v3/async/img2img
AsyncImage-to-image transformation
Seedream 3.0 / 4.0 / 4.5 / 5.0-liteAsyncAsyncByteDance image models
Qwen Image / Hunyuan Image 3 / GLM ImageAsyncAsyncAdditional providers
For full parameters and examples → references/image-api.md
端点路径模式描述
FLUX.1 Schnell
POST /v3beta/flux-1-schnell
同步快速文生图,成本最低
FLUX Kontext Dev/Pro/Max
POST /v3/async/flux-1-kontext-*
异步支持图像编辑的高级生成功能
FLUX 2 Dev/Flex/Pro
POST /v3/async/flux-2-*
异步最新FLUX模型
Stable Diffusion文生图
POST /v3/async/txt2img
异步支持LoRA、采样器的完整SD控制
Stable Diffusion图生图
POST /v3/async/img2img
异步图像到图像的风格转换
Seedream 3.0 / 4.0 / 4.5 / 5.0-lite异步异步字节跳动图像模型
Qwen图像 / 混元图像3 / GLM图像异步异步额外提供商模型
完整参数与示例 → references/image-api.md

Image Editing

图像编辑

EndpointPathModeInput
Remove Background
POST /v3/remove-background
SyncBase64 image
Replace Background
POST /v3/replace-background
SyncBase64 image + text prompt
Reimagine
POST /v3/reimagine
SyncBase64 image
Image to Prompt
POST /v3/img2prompt
SyncBase64 image → returns text
Remove Text
POST /v3/remove-text
SyncBase64 image
Cleanup (erase)
POST /v3/cleanup
SyncBase64 image + base64 mask
Outpainting
POST /v3/outpainting
SyncBase64 image + prompt + dimensions
Merge Face
POST /v3/merge-face
SyncBase64 face + base64 target
Upscale
POST /v3/upscale
SyncBase64 image
Inpainting
POST /v3/async/inpainting
AsyncBase64 image + base64 mask + prompt
All image inputs use base64-encoded local files. For full parameters → references/image-api.md
端点路径模式输入
移除背景
POST /v3/remove-background
同步Base64编码图像
替换背景
POST /v3/replace-background
同步Base64编码图像 + 文本提示词
重绘
POST /v3/reimagine
同步Base64编码图像
图生提示词
POST /v3/img2prompt
同步Base64编码图像 → 返回文本描述
移除文字
POST /v3/remove-text
同步Base64编码图像
区域擦除
POST /v3/cleanup
同步Base64编码图像 + Base64编码遮罩
扩图
POST /v3/outpainting
同步Base64编码图像 + 提示词 + 尺寸参数
人脸融合
POST /v3/merge-face
同步Base64编码人脸图 + Base64编码目标图
图像放大
POST /v3/upscale
同步Base64编码图像
图像修复
POST /v3/async/inpainting
异步Base64编码图像 + Base64编码遮罩 + 提示词
所有图像输入均使用Base64编码的本地文件。完整参数 → references/image-api.md

Video Generation

视频生成

All video endpoints are async — they return a task_id for polling. The Unified Video API provides a single endpoint for all models.
EndpointPathDescription
Unified Video API
POST /v3/video/create
Single endpoint for all video models
SD Text-to-Video
POST /v3/async/txt2video
Legacy Stable Diffusion video
SD Image-to-Video
POST /v3/async/img2video
SVD/SVD-XT models
Hunyuan Video Fast
POST /v3/async/hunyuan-video-fast
Cost-effective text-to-video
所有视频端点均为异步——返回task_id用于轮询结果。统一视频API提供单一端点适配所有模型。
端点路径描述
统一视频API
POST /v3/video/create
适配所有视频模型的单一端点
SD文生视频
POST /v3/async/txt2video
旧版Stable Diffusion视频生成
SD图生视频
POST /v3/async/img2video
SVD/SVD-XT模型
混元视频快速版
POST /v3/async/hunyuan-video-fast
高性价比文生视频

Available Video Models

可用视频模型

ModelCapabilitiesNotable Features
Kling v2.1 / v2.5 / v2.6T2V, I2V, ref2v, video-editMotion control, camera control
Wan 2.5 / 2.6T2V, I2VFast preview modes
Minimax Hailuo 02 / 2.3T2V, I2VFast I2V variant
Hunyuan Video FastT2VCost-effective
Vidu Q1 / Q2 / Q3T2V, I2V, startend2v, ref2vMulti-frame, templates
PixVerse v4.5T2V, I2V
Seedance v1 / v1.5T2V, I2VLite and Pro variants
For full parameters → references/video-api.md
模型能力显著特性
Kling v2.1 / v2.5 / v2.6文生视频、图生视频、参考图生视频、视频编辑运动控制、镜头控制
Wan 2.5 / 2.6文生视频、图生视频快速预览模式
Minimax Hailuo 02 / 2.3文生视频、图生视频快速图生视频变体
混元视频快速版文生视频高性价比
Vidu Q1 / Q2 / Q3文生视频、图生视频、首尾图生视频、参考图生视频多帧支持、模板功能
PixVerse v4.5文生视频、图生视频
Seedance v1 / v1.5文生视频、图生视频轻量版与专业版变体
完整参数 → references/video-api.md

Audio

音频服务

EndpointPathModeUse When
MiniMax Speech 02 HD
POST /v3/minimax-speech-02-hd
SyncEnglish TTS, high quality, 17 voices
GLM TTS
POST /v3/glm-tts
SyncChinese TTS, low latency, 7 voices
GLM ASR
POST /v3/glm-asr
SyncSpeech-to-text transcription
MiniMax Voice Cloning
POST /v3/minimax-voice-cloning
SyncClone a voice from audio
Fish Audio TTSAsyncAsyncCustom voice TTS
MiniMax voices: Wise_Woman, Calm_Woman, Friendly_Person, Deep_Voice_Man, Inspirational_girl, Casual_Guy, Lively_Girl, Patient_Man, Young_Knight, Lovely_Girl, Sweet_Girl_2, Elegant_Man
GLM voices: tongtong, chuichui, xiaochen, jam, kazi, douji, luodo
Emotion control (MiniMax): happy, sad, angry, fearful, disgusted, surprised, neutral
For full parameters → references/audio-api.md
端点路径模式使用场景
MiniMax Speech 02 HD
POST /v3/minimax-speech-02-hd
同步英文TTS,高质量,17种音色
GLM TTS
POST /v3/glm-tts
同步中文TTS,低延迟,7种音色
GLM ASR
POST /v3/glm-asr
同步语音转文本转录
MiniMax语音克隆
POST /v3/minimax-voice-cloning
同步通过音频克隆音色
Fish Audio TTS异步异步自定义音色TTS
MiniMax音色:Wise_Woman、Calm_Woman、Friendly_Person、Deep_Voice_Man、Inspirational_girl、Casual_Guy、Lively_Girl、Patient_Man、Young_Knight、Lovely_Girl、Sweet_Girl_2、Elegant_Man
GLM音色:tongtong、chuichui、xiaochen、jam、kazi、douji、luodo
情绪控制(MiniMax):happy、sad、angry、fearful、disgusted、surprised、neutral
完整参数 → references/audio-api.md

Async Task Polling

异步任务轮询

Async endpoints (SD images, video, some audio) return a task_id. Poll for results:
GET /v3/async/task-result
with query parameter
task_id
Status lifecycle: TASK_STATUS_QUEUED → TASK_STATUS_PROCESSING → TASK_STATUS_SUCCEED or TASK_STATUS_FAILED
Poll every 3-5 seconds. On success, results contain download URLs in
images[]
,
videos[]
, or
audios[]
arrays. You can also configure a webhook callback in the original request for async notification.
异步端点(SD图像、视频、部分音频)返回task_id。通过以下方式轮询结果:
使用查询参数
task_id
调用
GET /v3/async/task-result
状态生命周期:TASK_STATUS_QUEUED → TASK_STATUS_PROCESSING → TASK_STATUS_SUCCEED 或 TASK_STATUS_FAILED
每3-5秒轮询一次。成功时,结果包含
images[]
videos[]
audios[]
数组中的下载链接。你也可以在原始请求中配置Webhook回调以获取异步通知。

Batch Processing (OpenAI-Compatible)

批量处理(兼容OpenAI)

For bulk LLM jobs using the OpenAI-compatible batch API at
/openai/v1
:
  1. Upload a JSONL file via
    POST /openai/v1/files
  2. Create a batch via
    POST /openai/v1/batches
    with the file ID
  3. Poll batch status via
    GET /openai/v1/batches/{batch_id}
  4. Download results via
    GET /openai/v1/files/{output_file_id}/content
For full parameters → references/llm-api.md
使用
/openai/v1
下兼容OpenAI的批量API处理大规模LLM任务:
  1. 通过
    POST /openai/v1/files
    上传JSONL文件
  2. 通过
    POST /openai/v1/batches
    创建批量任务并传入文件ID
  3. 通过
    GET /openai/v1/batches/{batch_id}
    轮询批量任务状态
  4. 通过
    GET /openai/v1/files/{output_file_id}/content
    下载结果
完整参数 → references/llm-api.md

GPU Cloud

GPU云服务

Base:
/gpu-instance/openapi/v1
OperationMethodPath
List GPU productsGET
/products
List CPU productsGET
/cpu/products
List clustersGET
/clusters
Create instancePOST
/gpu/instance/create
List instancesGET
/gpu/instance/list
Get instanceGET
/gpu/instance/get
Start / Stop / RestartPOST
/gpu/instance/{action}
Delete instancePOST
/gpu/instance/delete
GPU creation costs real money — always check
/products
for pricing first.
Also supports: Templates (create/list/get/update/delete), Network Storage (create/list/delete), Serverless Endpoints (create/list/get/update/delete).
For full parameters → references/gpu-api.md
基础路径:
/gpu-instance/openapi/v1
操作请求方法路径
列出GPU产品GET
/products
列出CPU产品GET
/cpu/products
列出集群GET
/clusters
创建实例POST
/gpu/instance/create
列出实例GET
/gpu/instance/list
获取实例详情GET
/gpu/instance/get
启动/停止/重启POST
/gpu/instance/{action}
删除实例POST
/gpu/instance/delete
创建GPU实例会产生实际费用——请先通过
/products
查看定价。
同时支持:模板(创建/列出/获取/更新/删除)、网络存储(创建/列出/删除)、无服务器端点(创建/列出/获取/更新/删除)。
完整参数 → references/gpu-api.md

Account and Billing

账户与账单

OperationMethodPath
Get balanceGET
/openapi/v1/billing/balance/detail
Monthly billGET
/openapi/v1/billing/monthly/bill
Usage-based billingGET
/openapi/v1/billing/bill/list
Fixed-term billingGET
/openapi/v1/billing/fixed-term/bill
Balance amounts are in units of 0.0001 USD (divide by 10000 for dollars).
操作请求方法路径
获取余额GET
/openapi/v1/billing/balance/detail
月度账单GET
/openapi/v1/billing/monthly/bill
按量计费账单GET
/openapi/v1/billing/bill/list
包年包月账单GET
/openapi/v1/billing/fixed-term/bill
余额单位为0.0001美元(除以10000转换为美元)。

Decision Guide

决策指南

Which image endpoint?

如何选择图像端点?

IntentEndpointNotes
Text to image (fast)FLUX.1 SchnellSync, cheapest
Text to image (quality)FLUX Kontext, Seedream, SDAsync, more control
Image + text to new imageimg2imgStyle transfer
Edit region with promptInpaintingNeeds mask
Erase regionCleanupSync, needs mask
Extend canvasOutpaintingSync
Remove backgroundremove-backgroundSync
New backgroundreplace-backgroundSync
Remove text overlayremove-textSync
Describe imageimg2promptReturns text
Enlarge and enhanceUpscaleSync
Swap facemerge-faceSync
Restyle completelyReimagineSync
需求端点说明
快速文生图FLUX.1 Schnell同步,成本最低
高质量文生图FLUX Kontext、Seedream、SD异步,更多控制选项
图像+文本生成新图像img2img风格转换
用提示词编辑指定区域图像修复需要遮罩
擦除指定区域区域擦除同步,需要遮罩
扩展画布扩图同步
移除背景移除背景同步
替换背景替换背景同步
移除文字水印移除文字同步
图像描述图生提示词返回文本描述
放大并增强图像图像放大同步
人脸替换人脸融合同步
完全重绘风格重绘同步

Which TTS?

如何选择TTS服务?

  • English, multilingual, high quality: MiniMax Speech 02 HD
  • Chinese, low latency: GLM TTS
  • Custom voice: Fish Audio or MiniMax Voice Cloning
  • 英文、多语言、高质量:MiniMax Speech 02 HD
  • 中文、低延迟:GLM TTS
  • 自定义音色:Fish Audio或MiniMax语音克隆

Which video model?

如何选择视频模型?

  • General purpose: Kling v2.5 or Hailuo 02
  • Fast and cheap: Hunyuan Video Fast, Wan 2.5 Preview
  • High quality: Kling v2.6 Pro, Vidu Q3
  • Image-to-video: Kling I2V, Wan I2V, Hailuo fast-I2V
  • 通用场景:Kling v2.5或Hailuo 02
  • 快速低成本:混元视频快速版、Wan 2.5预览版
  • 高质量:Kling v2.6 Pro、Vidu Q3
  • 图生视频:Kling图生视频、Wan图生视频、Hailuo快速图生视频

Security

安全规范

  • Never hardcode API keys in code or commit them to version control. Use environment variables or secret managers.
  • Endpoints accepting media inputs should only receive content from trusted, verified sources.
  • When using async webhook callbacks, ensure your callback server validates the request origin.
  • Enable NSFW detection for user-facing applications.
  • 切勿在代码中硬编码API密钥或提交到版本控制系统。使用环境变量或密钥管理器。
  • 接收媒体输入的端点仅应处理来自可信、已验证来源的内容。
  • 使用异步Webhook回调时,确保回调服务器验证请求来源。
  • 面向用户的应用请启用NSFW检测。

Error Handling

错误处理

CodeHTTP StatusMeaning
INVALID_API_KEY403Bad or missing API key
RATE_LIMIT_EXCEEDED429Too many requests
BILLING_BALANCE_NOT_ENOUGH400Insufficient balance
MODEL_NOT_FOUND404Invalid model name
INVALID_REQUEST_BODY400Malformed request
SERVICE_NOT_AVAILABLE503Service temporarily down
错误码HTTP状态码含义
INVALID_API_KEY403API密钥无效或缺失
RATE_LIMIT_EXCEEDED429请求过于频繁,超出速率限制
BILLING_BALANCE_NOT_ENOUGH400账户余额不足
MODEL_NOT_FOUND404模型名称无效
INVALID_REQUEST_BODY400请求体格式错误
SERVICE_NOT_AVAILABLE503服务暂时不可用

API References

API参考文档

For detailed endpoint parameters, request and response schemas, and code examples:
  • LLM API: references/llm-api.md — Chat, embeddings, rerank, function calling, structured outputs, batch
  • Image API: references/image-api.md — All generation and editing endpoints with full parameter specs
  • Video API: references/video-api.md — Unified API, model-specific parameters
  • Audio API: references/audio-api.md — TTS variants, ASR, voice cloning, streaming
  • GPU Cloud API: references/gpu-api.md — Instances, templates, storage, serverless

如需详细的端点参数、请求与响应Schema以及代码示例:
  • LLM APIreferences/llm-api.md — 对话、嵌入、重排序、函数调用、结构化输出、批量处理
  • 图像APIreferences/image-api.md — 所有生成与编辑端点的完整参数说明
  • 视频APIreferences/video-api.md — 统一API、模型专属参数
  • 音频APIreferences/audio-api.md — TTS变体、ASR、语音克隆、流式传输
  • GPU云APIreferences/gpu-api.md — 实例、模板、存储、无服务器端点