novita-ai
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNovita 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
配置步骤
- Get an API key at novita.ai/settings/key-management
- Set the environment variable:
export NOVITA_API_KEY=your_key - All requests use header
Authorization: Bearer $NOVITA_API_KEY - Base URL:
https://api.novita.ai - Full documentation: novita.ai/docs/api-reference
- 在novita.ai/settings/key-management获取API密钥
- 设置环境变量:
export NOVITA_API_KEY=your_key - 所有请求使用请求头
Authorization: Bearer $NOVITA_API_KEY - 基础URL:
https://api.novita.ai - 完整文档:novita.ai/docs/api-reference
Services
服务列表
| Service | Use When | Endpoints | Mode |
|---|---|---|---|
| LLM | Chat, completion, embeddings, reranking | | Sync / Stream |
| Image Generation | Text-to-image, image-to-image | FLUX, SD, Seedream, Qwen, Hunyuan, GLM | Sync / Async |
| Image Editing | Remove BG, upscale, inpaint, outpaint, cleanup, reimagine, merge face | | Sync / Async |
| Video Generation | Text-to-video, image-to-video | Kling, Wan, Hunyuan, Hailuo, Vidu, PixVerse, Seedance | Async |
| Audio | TTS, ASR, voice cloning | MiniMax, GLM, Fish Audio | Sync |
| Batch | Bulk LLM processing | | Async |
| GPU Cloud | Instances, templates, storage, serverless | | Sync |
| Account | Balance, billing | | Sync |
| 服务类型 | 使用场景 | 端点 | 模式 |
|---|---|---|---|
| LLM | 对话、补全、嵌入、重排序 | | 同步/流式 |
| 图像生成 | 文生图、图生图 | FLUX、SD、Seedream、Qwen、混元、GLM | 同步/异步 |
| 图像编辑 | 移除背景、放大、修复、扩图、清理、重绘、人脸融合 | | 同步/异步 |
| 视频生成 | 文生视频、图生视频 | Kling、Wan、混元、Hailuo、Vidu、PixVerse、Seedance | 异步 |
| 音频 | TTS、ASR、语音克隆 | MiniMax、GLM、Fish Audio | 同步 |
| 批量处理 | 大规模LLM任务 | | 异步 |
| GPU云 | 实例、模板、存储、无服务器端点 | | 同步 |
| 账户服务 | 余额、账单 | | 同步 |
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/openaipython
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,
)| Method | Path | Purpose |
|---|---|---|
| POST | | Chat completion (streaming supported) |
| POST | | Text completion |
| POST | | Text embeddings |
| POST | | Document reranking |
| GET | | List available models |
Key models: , , , . Embedding: . Rerank: . Full list via .
deepseek/deepseek-v3-0324deepseek/deepseek-r1meta-llama/llama-3.1-70b-instructQwen/Qwen2.5-72B-Instructbaai/bge-m3baai/bge-reranker-v2-m3/modelsFeatures: 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/openaipython
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 | | 对话补全(支持流式输出) |
| POST | | 文本补全 |
| POST | | 文本嵌入 |
| POST | | 文档重排序 |
| GET | | 列出可用模型 |
核心模型:、、、。嵌入模型:。重排序模型:。完整模型列表可通过获取。
deepseek/deepseek-v3-0324deepseek/deepseek-r1meta-llama/llama-3.1-70b-instructQwen/Qwen2.5-72B-Instructbaai/bge-m3baai/bge-reranker-v2-m3/models功能特性:多模态视觉、推理、函数调用、结构化输出、提示词缓存、批量API。
完整参数与示例 → references/llm-api.md
Image Generation
图像生成
| Endpoint | Path | Mode | Description |
|---|---|---|---|
| FLUX.1 Schnell | | Sync | Fast text-to-image, cheapest option |
| FLUX Kontext Dev/Pro/Max | | Async | Advanced generation with image editing |
| FLUX 2 Dev/Flex/Pro | | Async | Latest FLUX models |
| Stable Diffusion txt2img | | Async | Full SD control with LoRAs, samplers |
| Stable Diffusion img2img | | Async | Image-to-image transformation |
| Seedream 3.0 / 4.0 / 4.5 / 5.0-lite | Async | Async | ByteDance image models |
| Qwen Image / Hunyuan Image 3 / GLM Image | Async | Async | Additional providers |
For full parameters and examples → references/image-api.md
| 端点 | 路径 | 模式 | 描述 |
|---|---|---|---|
| FLUX.1 Schnell | | 同步 | 快速文生图,成本最低 |
| FLUX Kontext Dev/Pro/Max | | 异步 | 支持图像编辑的高级生成功能 |
| FLUX 2 Dev/Flex/Pro | | 异步 | 最新FLUX模型 |
| Stable Diffusion文生图 | | 异步 | 支持LoRA、采样器的完整SD控制 |
| Stable Diffusion图生图 | | 异步 | 图像到图像的风格转换 |
| Seedream 3.0 / 4.0 / 4.5 / 5.0-lite | 异步 | 异步 | 字节跳动图像模型 |
| Qwen图像 / 混元图像3 / GLM图像 | 异步 | 异步 | 额外提供商模型 |
完整参数与示例 → references/image-api.md
Image Editing
图像编辑
| Endpoint | Path | Mode | Input |
|---|---|---|---|
| Remove Background | | Sync | Base64 image |
| Replace Background | | Sync | Base64 image + text prompt |
| Reimagine | | Sync | Base64 image |
| Image to Prompt | | Sync | Base64 image → returns text |
| Remove Text | | Sync | Base64 image |
| Cleanup (erase) | | Sync | Base64 image + base64 mask |
| Outpainting | | Sync | Base64 image + prompt + dimensions |
| Merge Face | | Sync | Base64 face + base64 target |
| Upscale | | Sync | Base64 image |
| Inpainting | | Async | Base64 image + base64 mask + prompt |
All image inputs use base64-encoded local files. For full parameters → references/image-api.md
| 端点 | 路径 | 模式 | 输入 |
|---|---|---|---|
| 移除背景 | | 同步 | Base64编码图像 |
| 替换背景 | | 同步 | Base64编码图像 + 文本提示词 |
| 重绘 | | 同步 | Base64编码图像 |
| 图生提示词 | | 同步 | Base64编码图像 → 返回文本描述 |
| 移除文字 | | 同步 | Base64编码图像 |
| 区域擦除 | | 同步 | Base64编码图像 + Base64编码遮罩 |
| 扩图 | | 同步 | Base64编码图像 + 提示词 + 尺寸参数 |
| 人脸融合 | | 同步 | Base64编码人脸图 + Base64编码目标图 |
| 图像放大 | | 同步 | Base64编码图像 |
| 图像修复 | | 异步 | 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.
| Endpoint | Path | Description |
|---|---|---|
| Unified Video API | | Single endpoint for all video models |
| SD Text-to-Video | | Legacy Stable Diffusion video |
| SD Image-to-Video | | SVD/SVD-XT models |
| Hunyuan Video Fast | | Cost-effective text-to-video |
所有视频端点均为异步——返回task_id用于轮询结果。统一视频API提供单一端点适配所有模型。
| 端点 | 路径 | 描述 |
|---|---|---|
| 统一视频API | | 适配所有视频模型的单一端点 |
| SD文生视频 | | 旧版Stable Diffusion视频生成 |
| SD图生视频 | | SVD/SVD-XT模型 |
| 混元视频快速版 | | 高性价比文生视频 |
Available Video Models
可用视频模型
| Model | Capabilities | Notable Features |
|---|---|---|
| Kling v2.1 / v2.5 / v2.6 | T2V, I2V, ref2v, video-edit | Motion control, camera control |
| Wan 2.5 / 2.6 | T2V, I2V | Fast preview modes |
| Minimax Hailuo 02 / 2.3 | T2V, I2V | Fast I2V variant |
| Hunyuan Video Fast | T2V | Cost-effective |
| Vidu Q1 / Q2 / Q3 | T2V, I2V, startend2v, ref2v | Multi-frame, templates |
| PixVerse v4.5 | T2V, I2V | — |
| Seedance v1 / v1.5 | T2V, I2V | Lite 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
音频服务
| Endpoint | Path | Mode | Use When |
|---|---|---|---|
| MiniMax Speech 02 HD | | Sync | English TTS, high quality, 17 voices |
| GLM TTS | | Sync | Chinese TTS, low latency, 7 voices |
| GLM ASR | | Sync | Speech-to-text transcription |
| MiniMax Voice Cloning | | Sync | Clone a voice from audio |
| Fish Audio TTS | Async | Async | Custom 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 | | 同步 | 英文TTS,高质量,17种音色 |
| GLM TTS | | 同步 | 中文TTS,低延迟,7种音色 |
| GLM ASR | | 同步 | 语音转文本转录 |
| MiniMax语音克隆 | | 同步 | 通过音频克隆音色 |
| 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-resulttask_idStatus 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 , , or arrays. You can also configure a webhook callback in the original request for async notification.
images[]videos[]audios[]异步端点(SD图像、视频、部分音频)返回task_id。通过以下方式轮询结果:
使用查询参数调用
task_idGET /v3/async/task-result状态生命周期:TASK_STATUS_QUEUED → TASK_STATUS_PROCESSING → TASK_STATUS_SUCCEED 或 TASK_STATUS_FAILED
每3-5秒轮询一次。成功时,结果包含、或数组中的下载链接。你也可以在原始请求中配置Webhook回调以获取异步通知。
images[]videos[]audios[]Batch Processing (OpenAI-Compatible)
批量处理(兼容OpenAI)
For bulk LLM jobs using the OpenAI-compatible batch API at :
/openai/v1- Upload a JSONL file via
POST /openai/v1/files - Create a batch via with the file ID
POST /openai/v1/batches - Poll batch status via
GET /openai/v1/batches/{batch_id} - Download results via
GET /openai/v1/files/{output_file_id}/content
For full parameters → references/llm-api.md
使用下兼容OpenAI的批量API处理大规模LLM任务:
/openai/v1- 通过上传JSONL文件
POST /openai/v1/files - 通过创建批量任务并传入文件ID
POST /openai/v1/batches - 通过轮询批量任务状态
GET /openai/v1/batches/{batch_id} - 通过下载结果
GET /openai/v1/files/{output_file_id}/content
完整参数 → references/llm-api.md
GPU Cloud
GPU云服务
Base:
/gpu-instance/openapi/v1| Operation | Method | Path |
|---|---|---|
| List GPU products | GET | |
| List CPU products | GET | |
| List clusters | GET | |
| Create instance | POST | |
| List instances | GET | |
| Get instance | GET | |
| Start / Stop / Restart | POST | |
| Delete instance | POST | |
GPU creation costs real money — always check for pricing first.
/productsAlso 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 | |
| 列出CPU产品 | GET | |
| 列出集群 | GET | |
| 创建实例 | POST | |
| 列出实例 | GET | |
| 获取实例详情 | GET | |
| 启动/停止/重启 | POST | |
| 删除实例 | POST | |
创建GPU实例会产生实际费用——请先通过查看定价。
/products同时支持:模板(创建/列出/获取/更新/删除)、网络存储(创建/列出/删除)、无服务器端点(创建/列出/获取/更新/删除)。
完整参数 → references/gpu-api.md
Account and Billing
账户与账单
| Operation | Method | Path |
|---|---|---|
| Get balance | GET | |
| Monthly bill | GET | |
| Usage-based billing | GET | |
| Fixed-term billing | GET | |
Balance amounts are in units of 0.0001 USD (divide by 10000 for dollars).
| 操作 | 请求方法 | 路径 |
|---|---|---|
| 获取余额 | GET | |
| 月度账单 | GET | |
| 按量计费账单 | GET | |
| 包年包月账单 | GET | |
余额单位为0.0001美元(除以10000转换为美元)。
Decision Guide
决策指南
Which image endpoint?
如何选择图像端点?
| Intent | Endpoint | Notes |
|---|---|---|
| Text to image (fast) | FLUX.1 Schnell | Sync, cheapest |
| Text to image (quality) | FLUX Kontext, Seedream, SD | Async, more control |
| Image + text to new image | img2img | Style transfer |
| Edit region with prompt | Inpainting | Needs mask |
| Erase region | Cleanup | Sync, needs mask |
| Extend canvas | Outpainting | Sync |
| Remove background | remove-background | Sync |
| New background | replace-background | Sync |
| Remove text overlay | remove-text | Sync |
| Describe image | img2prompt | Returns text |
| Enlarge and enhance | Upscale | Sync |
| Swap face | merge-face | Sync |
| Restyle completely | Reimagine | Sync |
| 需求 | 端点 | 说明 |
|---|---|---|
| 快速文生图 | 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
错误处理
| Code | HTTP Status | Meaning |
|---|---|---|
| INVALID_API_KEY | 403 | Bad or missing API key |
| RATE_LIMIT_EXCEEDED | 429 | Too many requests |
| BILLING_BALANCE_NOT_ENOUGH | 400 | Insufficient balance |
| MODEL_NOT_FOUND | 404 | Invalid model name |
| INVALID_REQUEST_BODY | 400 | Malformed request |
| SERVICE_NOT_AVAILABLE | 503 | Service temporarily down |
| 错误码 | HTTP状态码 | 含义 |
|---|---|---|
| INVALID_API_KEY | 403 | API密钥无效或缺失 |
| RATE_LIMIT_EXCEEDED | 429 | 请求过于频繁,超出速率限制 |
| BILLING_BALANCE_NOT_ENOUGH | 400 | 账户余额不足 |
| MODEL_NOT_FOUND | 404 | 模型名称无效 |
| INVALID_REQUEST_BODY | 400 | 请求体格式错误 |
| SERVICE_NOT_AVAILABLE | 503 | 服务暂时不可用 |
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 API:references/llm-api.md — 对话、嵌入、重排序、函数调用、结构化输出、批量处理
- 图像API:references/image-api.md — 所有生成与编辑端点的完整参数说明
- 视频API:references/video-api.md — 统一API、模型专属参数
- 音频API:references/audio-api.md — TTS变体、ASR、语音克隆、流式传输
- GPU云API:references/gpu-api.md — 实例、模板、存储、无服务器端点