venice-api-overview
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVenice API Overview
Venice API 概览
Venice.ai is an OpenAI-compatible inference platform for text, image, audio, video, and embeddings. One API — two ways to pay: a traditional API key (Pro account), or a wallet (x402, USDC on Base, no account required).
Venice.ai 是一个兼容OpenAI的推理平台,支持文本、图像、音频、视频以及嵌入任务。一个API,两种付费方式:传统的API key(专业账户),或钱包(x402,基于Base网络的USDC,无需注册账户)。
Use when
适用场景
- You're writing code against for the first time.
api.venice.ai - You need to decide between API-key and x402/wallet authentication.
- You want a quick map of which endpoint to call for which task.
- You need to understand the common response headers (,
X-Balance-Remaining, etc.).PAYMENT-REQUIRED
- 首次针对编写代码时。
api.venice.ai - 需要在API-key和x402/钱包认证方式之间做选择时。
- 需要快速了解不同任务对应的调用端点时。
- 需要理解常见响应头(如、
X-Balance-Remaining等)时。PAYMENT-REQUIRED
Base URL
基础URL
All endpoints live under:
https://api.venice.ai/api/v1The OpenAPI spec is distributed at (current version ).
outerface/swagger.yaml20260420.235001所有端点均位于:
https://api.venice.ai/api/v1OpenAPI规范发布于(当前版本)。
outerface/swagger.yaml20260420.235001Authentication (pick one per request)
认证方式(每次请求选择一种)
| Scheme | Header | Best for |
|---|---|---|
| | Server-side apps, dashboards, usage analytics, bundled credits |
| | No account, pay-as-you-go with USDC on Base, serverless / agents |
Every inference endpoint accepts either — see .
venice-authbash
undefined| 方案 | 请求头 | 最佳适用场景 |
|---|---|---|
| | 后端应用、控制面板、使用分析、套餐额度 |
| | 无需账户、基于Base网络USDC按需付费、无服务器/Agent场景 |
所有推理端点均支持上述任意一种认证方式——详见。
venice-authbash
undefinedBearer
Bearer
curl https://api.venice.ai/api/v1/models
-H "Authorization: Bearer $VENICE_API_KEY"
-H "Authorization: Bearer $VENICE_API_KEY"
curl https://api.venice.ai/api/v1/models
-H "Authorization: Bearer $VENICE_API_KEY"
-H "Authorization: Bearer $VENICE_API_KEY"
x402 / SIWE (one-liner via the SDK)
x402 / SIWE (one-liner via the SDK)
import { VeniceClient } from 'venice-x402-client'
const v = new VeniceClient(process.env.WALLET_KEY)
await v.models.list()
undefinedimport { VeniceClient } from 'venice-x402-client'
const v = new VeniceClient(process.env.WALLET_KEY)
await v.models.list()
undefinedEndpoint map
端点映射
Inference
推理
| Category | Endpoints | Skill |
|---|---|---|
| Chat | | |
| Responses (Alpha) | | |
| Embeddings | | |
| Image gen | | |
| Image edit | | |
| TTS | | |
| STT | | |
| Music (async) | | |
| Video (async) | | |
| 分类 | 端点 | Skill |
|---|---|---|
| 对话 | | |
| 响应(测试版) | | |
| 嵌入 | | |
| 图像生成 | | |
| 图像编辑 | | |
| 文本转语音(TTS) | | |
| 语音转文本(STT) | | |
| 音乐(异步) | | |
| 视频(异步) | | |
Catalog
资源目录
| Category | Endpoints | Skill |
|---|---|---|
| Models | | |
| Characters | | |
| 分类 | 端点 | Skill |
|---|---|---|
| 模型 | | |
| 角色 | | |
Account, billing, wallet
账户、计费与钱包
| Category | Endpoints | Skill |
|---|---|---|
| API keys | `GET | POST |
| Billing | | |
| x402 wallet | | |
| 分类 | 端点 | Skill |
|---|---|---|
| API密钥 | `GET | POST |
| 计费 | | |
| x402钱包 | | |
Utility
工具类
| Category | Endpoints | Skill |
|---|---|---|
| Crypto RPC proxy | | |
| Augment | | |
| 分类 | 端点 | Skill |
|---|---|---|
| 加密货币RPC代理 | | |
| 增强工具 | | |
Response headers to watch
需要关注的响应头
| Header | When | Meaning |
|---|---|---|
| x402 inference success | USDC credits left, e.g. |
| all inference | your current per-minute/day caps |
| | base64 JSON with top-up + SIWX challenge (x402 v2) |
| | compression (embeddings, chat) |
| 响应头 | 触发场景 | 含义 |
|---|---|---|
| x402推理请求成功时 | 剩余USDC额度,例如 |
| 所有推理请求 | 当前的每分钟/每日请求上限 |
| x402推理请求返回 | 包含充值说明和SIWX挑战的base64格式JSON(x402 v2) |
| 客户端发送 | 压缩方式(适用于嵌入、对话接口) |
Pricing model at a glance
定价模型概览
- Pricing is dynamic per request, metered in USD.
- Paid inference endpoints in the spec carry an block with
x-payment-infoandminbounds in USD (typicallymax,min: 0.001; higher for bulk video/audio). Read-only discovery routes likemax: 10.00,GET /models, and/models/traitsdo not./models/compatibility_mapping - Pro (Bearer) accounts draw from DIEM (staked credits), USD balance, and bundled credits in priority order.
- x402 (wallet) users draw from a prepaid USDC credit balance on Base.
- The authoritative per-model price is on →
GET /models(when present — video models omit it; usemodel_spec.pricingfor video pricing) (see/video/quote).venice-models
- 定价为按请求动态计算,以美元为计价单位。
- 规范中的付费推理端点包含字段,标注了美元计价的最低和最高费用(通常
x-payment-info,min: 0.001;批量视频/音频任务费用更高)。max: 10.00、GET /models和/models/traits等只读发现接口无需付费。/models/compatibility_mapping - 专业版(Bearer)账户将按优先级依次从DIEM(质押额度)、美元余额和套餐额度中扣费。
- x402(钱包)用户从Base网络上的预付费USDC额度余额中扣费。
- 每个模型的官方定价可通过接口的
GET /models字段获取(部分视频模型未提供该字段;视频定价请使用model_spec.pricing接口)(详见/video/quote)。venice-models
Standard error shape
标准错误格式
Every error body follows one of:
json
{ "error": "Human-readable message" }or, for 400 validation errors:
json
{ "error": "...", "details": { "fieldName": { "_errors": ["Field is required"] } } }402topUpInstructionssiwxChallengevenice-errors所有错误响应体均遵循以下格式之一:
json
{ "error": "Human-readable message" }或者,针对400验证错误:
json
{ "error": "...", "details": { "fieldName": { "_errors": ["Field is required"] } } }x402方式返回状态码时,会额外包含结构化的和字段。完整的错误码表和重试策略请详见。
402topUpInstructionssiwxChallengevenice-errorsOpenAI compatibility — what works and what doesn't
OpenAI兼容性说明——支持与不支持的功能
- Drop-in: ,
/chat/completions,/embeddings,/images/generations,/audio/speech,/audio/transcriptions./models - Ignored but accepted for compat: ,
user.store - Venice-only extensions live under:
- (chat completions)
venice_parameters - is rejected on
venice_parameters— use headers / native fields instead/responses
- Model feature suffixes (e.g. ,
zai-org-glm-5-1:enable_web_search=on) flipkimi-k2-6:strip_thinking_response=true&disable_thinking=truevia the model ID — seevenice_parameters.venice-chat
- 即插即用:、
/chat/completions、/embeddings、/images/generations、/audio/speech、/audio/transcriptions。/models - 为兼容而接受但会被忽略的参数:、
user。store - Venice专属扩展参数位于:
- (对话补全接口)
venice_parameters - 接口不接受
/responses参数——请使用请求头或原生字段替代venice_parameters
- 模型功能后缀(例如、
zai-org-glm-5-1:enable_web_search=on)可通过模型ID设置kimi-k2-6:strip_thinking_response=true&disable_thinking=true参数——详见venice_parameters。venice-chat
Versioning
版本控制
- in
info.versionis a timestamp (swagger.yaml). There is noYYYYMMDD.HHMMSS; features roll forward on the single/v2surface and are guarded by:/api/v1- Alpha/Beta tags in endpoint descriptions (e.g. , Billing).
/responses - / model capability flags on
x-guidance./models
- Alpha/Beta tags in endpoint descriptions (e.g.
- Always check the model's from
model_spec.capabilitiesfor feature flags (GET /models,supportsWebSearch,supportsReasoning,supportsE2EE,supportsXSearch,supportsMultipleImages,supportsFunctionCalling,supportsAudioInput, …) before relying on a feature.supportsVideoInput
- 中的
swagger.yaml为时间戳格式(info.version)。平台不提供YYYYMMDD.HHMMSS版本;所有功能均在单一的/v2接口集上迭代更新,并通过以下方式区分:/api/v1- 端点描述中的Alpha/Beta标签(例如、计费接口)。
/responses - 接口中的
/models/模型能力标识。x-guidance
- 端点描述中的Alpha/Beta标签(例如
- 在依赖某项功能前,请务必通过接口查看模型的
GET /models字段中的功能标识(如model_spec.capabilities、supportsWebSearch、supportsReasoning、supportsE2EE、supportsXSearch、supportsMultipleImages、supportsFunctionCalling、supportsAudioInput等)。supportsVideoInput
Fast start checklist
快速上手清单
- Read and choose Bearer vs x402.
venice-auth - — pick a model and note its
GET /modelsandmodel_spec.constraints.model_spec.pricing - Wire up one happy-path call from the matching skill.
- Add error handling using (402, 422, 429).
venice-errors - Hook up observability via /
X-Balance-Remaining//billing/usage./x402/transactions
- 阅读并选择Bearer或x402认证方式。
venice-auth - 调用接口——选择一个模型并记录其
GET /models和model_spec.constraints信息。model_spec.pricing - 根据对应的Skill编写一个正常流程的调用示例。
- 参考添加错误处理逻辑(针对402、422、429状态码)。
venice-errors - 通过响应头、
X-Balance-Remaining或/billing/usage接口实现监控功能。/x402/transactions