venice

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Venice AI

Venice AI

Privacy-first AI platform. OpenAI-compatible API at
https://api.venice.ai/api/v1
. Four privacy tiers — anonymized, private, TEE, E2EE. Zero data retention. No content filtering on most models.
This skill covers everything except chat completions. For chat, the right path is BYOK via the platform's
custom_models
tool — see "Chat onboarding" below.
注重隐私的AI平台。兼容OpenAI的API地址为
https://venice.ai/api/v1
。提供四个隐私层级——匿名、私有、TEE、E2EE。零数据留存。大多数模型无内容过滤。
本技能涵盖除聊天补全之外的所有功能。如需聊天功能,正确路径是通过平台的
custom_models
工具使用BYOK——请参阅下方的“聊天入门”部分。

Quick capability map

快速能力地图

SurfaceFunction
Catalog
list_models
,
list_model_traits
,
list_image_styles
,
list_characters
Account
account_balance
(balance + tier + rate-limit count)
Image
image_generate
,
image_edit
,
image_upscale
Audio
tts
,
transcribe
Embeddings
embeddings
(default
text-embedding-bge-m3
, dim 1024)
Chat probe
chat_with_venice_parameters
(one-shot)
Video
video_quote
,
video_queue
,
video_retrieve
,
video_complete
,
video_generate
(full loop),
video_transcribe_youtube
Endpoints intentionally NOT wrapped: standalone
/tools/search/web
(Venice removed it; use
enable_web_search
via venice_parameters in chat instead), admin-scoped
/api_keys
and
/billing/usage
(require an admin key the BYOK key can't use).
领域功能
模型目录
list_models
,
list_model_traits
,
list_image_styles
,
list_characters
账户管理
account_balance
(余额+层级+速率限制计数)
图像
image_generate
,
image_edit
,
image_upscale
音频
tts
,
transcribe
嵌入
embeddings
(默认模型
text-embedding-bge-m3
,维度1024)
聊天探测
chat_with_venice_parameters
(单次调用)
视频
video_quote
,
video_queue
,
video_retrieve
,
video_complete
,
video_generate
(完整流程),
video_transcribe_youtube
未封装的端点:独立的
/tools/search/web
(Venice已移除;聊天时通过venice_parameters中的
enable_web_search
替代)、管理员权限的
/api_keys
/billing/usage
(需要BYOK密钥无法使用的管理员密钥)。

Setup

配置步骤

  1. User goes to https://venice.ai/settings/api, creates a key.
  2. Add the key to the workspace via secure input — never paste in chat:
    • If the user wants chat: call
      custom_models(action='add_template', vendor='venice')
      . Auto-pops the secure input and registers Venice for chat completions in one shot.
    • If the user only wants this skill (image/audio/embeddings): call
      request_env_input(env_vars=[{key='VENICE_API_KEY', label='Venice API Key', required=True}], reason='Use Venice image/audio/embeddings via the venice skill')
      .
  3. The skill resolves the key in this order:
    VENICE_API_KEY
    → any
    CUSTOM_KEY_VENICE_*
    from BYOK registration. Either path works; both is fine.
account_balance()
is the cheapest probe (200 OK = key works).
  1. 用户访问https://venice.ai/settings/api,创建密钥。
  2. 通过安全输入将密钥添加到工作区——切勿在聊天中粘贴
    • 若用户需要聊天功能:调用
      custom_models(action='add_template', vendor='venice')
      。自动弹出安全输入框,一键完成Venice的聊天补全注册。
    • 若用户仅需本技能(图像/音频/嵌入):调用
      request_env_input(env_vars=[{key='VENICE_API_KEY', label='Venice API Key', required=True}], reason='通过venice技能使用Venice图像/音频/嵌入功能')
  3. 技能按以下顺序解析密钥:
    VENICE_API_KEY
    → BYOK注册生成的任意
    CUSTOM_KEY_VENICE_*
    。两种方式均可,同时存在也没问题。
account_balance()
是最轻便的验证方式(返回200 OK即表示密钥有效)。

Usage

使用示例

python
import sys
sys.path.insert(0, "/data/workspace/skills/venice")
from exports import (
    list_models, image_generate, image_edit, image_upscale,
    tts, transcribe, embeddings,
    list_image_styles, list_characters, list_model_traits,
    account_balance, chat_with_venice_parameters,
)
python
import sys
sys.path.insert(0, "/data/workspace/skills/venice")
from exports import (
    list_models, image_generate, image_edit, image_upscale,
    tts, transcribe, embeddings,
    list_image_styles, list_characters, list_model_traits,
    account_balance, chat_with_venice_parameters,
)

Browse models

浏览模型

python
undefined
python
undefined

Default returns text models only — pass type_filter to scope.

默认仅返回文本模型——可传入type_filter筛选范围。

text_vision = list_models(type_filter="text", only_capabilities=["supportsVision"]) images = list_models(type_filter="image") # 28 image models ttss = list_models(type_filter="tts") # 10 voices private_only = list_models(type_filter="text", privacy="private") all_models = list_models(type_filter="all") # ~244 entries — heavy, use sparingly

Each entry: `id, type, name, description, privacy, context_tokens, max_completion_tokens, capabilities, pricing_input_usd, pricing_output_usd, pricing_cache_input_usd, traits`.

`list_model_traits()` returns Venice's curated picks: `default`, `most_intelligent`, `most_uncensored`, `default_reasoning`, `default_vision`, `default_code`, `function_calling_default`, `fastest`. Use this when the user says "give me Venice's smartest model" — don't guess.
text_vision = list_models(type_filter="text", only_capabilities=["supportsVision"]) images = list_models(type_filter="image") # 28个图像模型 ttss = list_models(type_filter="tts") # 10种语音 private_only = list_models(type_filter="text", privacy="private") all_models = list_models(type_filter="all") # 约244个条目——数据量大,谨慎使用

每个条目包含:`id, type, name, description, privacy, context_tokens, max_completion_tokens, capabilities, pricing_input_usd, pricing_output_usd, pricing_cache_input_usd, traits`。

`list_model_traits()`返回Venice的精选模型分类:`default`, `most_intelligent`, `most_uncensored`, `default_reasoning`, `default_vision`, `default_code`, `function_calling_default`, `fastest`。当用户要求“推荐Venice最智能的模型”时使用该函数——不要自行猜测。

Image generation

图像生成

Don't guess model IDs. Venice rotates image models often (e.g.
flux-dev-uncensored
no longer exists;
flux-2-pro
does). Always confirm with
list_models(type_filter="image")
before passing a non-default
model=
. Same rule for
image_edit
and
image_upscale
.
python
g = image_generate(
    "neon cyberpunk cat in the rain",
    model="venice-sd35",       # default; see list_models(type_filter='image') for others
    width=1024, height=1024,   # any aspect-ratio Venice supports
    steps=20,
    style_preset="Cinematic",  # see list_image_styles() for the 76 presets
    save_path="cat.webp",      # → output/images/cat.webp (platform convention)
)
print(g["saved_path"])
Returns
{id, model, prompt, width, height, image_b64 (always), saved_path, timing}
.
不要自行编造模型ID。Venice会频繁轮换图像模型(例如
flux-dev-uncensored
已停用,
flux-2-pro
可用)。在传入非默认
model=
参数前,务必通过
list_models(type_filter="image")
确认有效ID。
image_edit
image_upscale
也遵循此规则。
python
g = image_generate(
    "雨中的霓虹赛博朋克猫咪",
    model="venice-sd35",       # 默认模型;可通过list_models(type_filter='image')查看其他模型
    width=1024, height=1024,   # Venice支持任意宽高比
    steps=20,
    style_preset="Cinematic",  # 可通过list_image_styles()查看76种预设风格
    save_path="cat.webp",      # → 输出路径:output/images/cat.webp(平台约定)
)
print(g["saved_path"])
返回结果:
{id, model, prompt, width, height, image_b64 (始终返回), saved_path, timing}

Image edit

图像编辑

python
e = image_edit(
    "output/images/cat.webp",
    "make the rain heavier and add lightning",
    model="qwen-edit",         # default ($0.04/edit). Other valid IDs:
                                # firered-image-edit, grok-imagine-edit,
                                # qwen-image-2-edit, qwen-image-2-pro-edit,
                                # wan-2-7-pro-edit, flux-2-max-edit,
                                # nano-banana-pro-edit, seedream-v5-lite-edit
    save_path="cat_edited.png",
)
image
accepts: bytes, Path, file path, http(s) URL, data URI, or base64 string. Anything else gets base64-encoded for transport. Endpoint returns raw bytes (NOT JSON).
python
e = image_edit(
    "output/images/cat.webp",
    "加大雨势并添加闪电",
    model="qwen-edit",         # 默认模型(0.04美元/次编辑)。其他有效ID包括:
                                # firered-image-edit, grok-imagine-edit,
                                # qwen-image-2-edit, qwen-image-2-pro-edit,
                                # wan-2-7-pro-edit, flux-2-max-edit,
                                # nano-banana-pro-edit, seedream-v5-lite-edit
    save_path="cat_edited.png",
)
image
参数接受:字节数据、Path对象、文件路径、http(s) URL、数据URI或base64字符串。其他格式会自动转换为base64进行传输。端点返回原始字节数据(非JSON格式)。

Image upscale

图像超分辨率

python
image_upscale("output/images/cat.webp", scale=2, save_path="cat_2x.png")
Topaz-quality upscale. Scale 2 or 4. ~3 MB result for a 512×512 source at 2x.
python
image_upscale("output/images/cat.webp", scale=2, save_path="cat_2x.png")
达到Topaz级别的超分辨率效果。支持2倍或4倍缩放。512×512的原图经2倍缩放后,结果约3MB。

TTS

TTS(文本转语音)

python
tts(
    "Welcome to Venice",
    model="tts-kokoro",        # default; alts: tts-xai-v1, tts-elevenlabs-turbo-v2-5,
                                # tts-orpheus, tts-chatterbox-hd, tts-inworld-1-5-max,
                                # tts-qwen3-0-6b, tts-qwen3-1-7b
    voice="af_alloy",          # voice list per model in Venice docs
    response_format="mp3",     # mp3 | opus | aac | flac | wav | pcm
    save_path="welcome.mp3",   # → output/audio/welcome.mp3
)
python
tts(
    "Welcome to Venice",
    model="tts-kokoro",        # 默认模型;可选模型包括:tts-xai-v1, tts-elevenlabs-turbo-v2-5,
                                # tts-orpheus, tts-chatterbox-hd, tts-inworld-1-5-max,
                                # tts-qwen3-0-6b, tts-qwen3-1-7b
    voice="af_alloy",          # 各模型的语音列表请查阅Venice文档
    response_format="mp3",     # 可选格式:mp3 | opus | aac | flac | wav | pcm
    save_path="welcome.mp3",   # → 输出路径:output/audio/welcome.mp3
)

Transcribe (STT)

Transcribe(语音转文本,STT)

python
result = transcribe(
    "output/audio/welcome.mp3",
    model="openai/whisper-large-v3",  # default. Alt: stt-xai-v1
                                       # The `openai/` prefix is REQUIRED —
                                       # bare `whisper-large-v3` returns 404.
)
print(result["text"])      # transcribed text
print(result["duration"])  # seconds
python
result = transcribe(
    "output/audio/welcome.mp3",
    model="openai/whisper-large-v3",  # 默认模型。可选模型:stt-xai-v1
                                       # 必须添加`openai/`前缀——
                                       # 仅传入`whisper-large-v3`会返回404错误。
)
print(result["text"])      # 转录文本
print(result["duration"])  # 时长(秒)

Embeddings

嵌入功能

python
out = embeddings(["hello world", "second sentence"])
python
out = embeddings(["hello world", "second sentence"])

→ {model, count, dim: 1024 (for bge-m3), vectors: list[list[float]], usage}

→ 返回结果:{model, count, dim: 1024 (对应bge-m3模型), vectors: list[list[float]], usage}

undefined
undefined

Characters

角色功能

python
list_characters(limit=20)  # [{slug, name, description, tags}, ...]
python
list_characters(limit=20)  # 返回结果:[{slug, name, description, tags}, ...]

Use the slug in chat via venice_parameters['character_slug']

在聊天中通过venice_parameters['character_slug']使用slug参数

undefined
undefined

Chat onboarding (BYOK is the answer)

聊天入门(BYOK是解决方案)

Don't try to wrap chat completions in this skill. The platform has a first-class BYOK flow that handles streaming, history, cost tracking, and model-switcher integration.
Standard flow when the user says "I want to chat with Venice":
  1. custom_models(action='templates')
    — confirm Venice is in the curated list (it is, with
    supports_dynamic_models: true
    ).
  2. Optional but recommended for picky users:
    custom_models(action='list_vendor_models', vendor='venice')
    — returns the live catalog (~75 text models) with capabilities, pricing, and privacy tier. Filter and present the top picks.
  3. custom_models(action='add_template', vendor='venice', upstream_model='<id>')
    — registers Venice with one of Venice's models as the chat target. The
    upstream_model
    parameter accepts ANY id from step 2's response (Venice has dynamic discovery). Auto-pops the secure-input prompt for the API key.
  4. Tell the user how to switch:
    /model custom/<id>
    in chat, or use the model picker.
Recommended models (use
list_model_traits()
to keep this fresh):
Use caseTraitTypical pick
Smartest text
most_intelligent
zai-org-glm-4.7
Uncensored
most_uncensored
venice-uncensored-1-2
Reasoning
default_reasoning
qwen3-235b-a22b-thinking-2507
Vision
default_vision
qwen3-vl-235b-a22b
Code
default_code
qwen3-coder-*
Cheap & fast
fastest
llama-3.2-3b
Function calling
function_calling_default
zai-org-glm-4.7
Privacy: TEE/E2EEfilter
list_models(privacy='tee')
or
'e2ee'
varies
Pricing varies wildly:
llama-3.2-3b
is $0.15/$0.60 per 1M tokens;
zai-org-glm-5-1
is $1.75/$5.50; Grok 4.20 is even higher. Always check
list_models()
before recommending if the user is cost-sensitive.
不要尝试在本技能中封装聊天补全功能。平台提供原生BYOK流程,可处理流式传输、历史记录、成本跟踪和模型切换集成。
当用户说“我想使用Venice聊天”时的标准流程:
  1. 调用
    custom_models(action='templates')
    ——确认Venice在精选模板列表中(已包含,且
    supports_dynamic_models: true
    )。
  2. 对要求较高的用户,可选但推荐:调用
    custom_models(action='list_vendor_models', vendor='venice')
    ——返回实时模型目录(约75个文本模型),包含能力、定价和隐私层级信息。筛选并推荐最优模型。
  3. 调用
    custom_models(action='add_template', vendor='venice', upstream_model='<id>')
    ——将Venice注册为聊天目标模型,
    upstream_model
    参数可接受步骤2返回的任意模型ID(Venice支持动态发现)。自动弹出API密钥的安全输入提示框。
  4. 告知用户切换方式:在聊天中输入
    /model custom/<id>
    ,或使用模型选择器。
推荐模型(使用
list_model_traits()
保持信息更新):
使用场景分类标签典型选择
最智能文本模型
most_intelligent
zai-org-glm-4.7
无审查模型
most_uncensored
venice-uncensored-1-2
推理模型
default_reasoning
qwen3-235b-a22b-thinking-2507
视觉模型
default_vision
qwen3-vl-235b-a22b
代码模型
default_code
qwen3-coder-*
低成本快速模型
fastest
llama-3.2-3b
函数调用模型
function_calling_default
zai-org-glm-4.7
隐私优先:TEE/E2EE筛选
list_models(privacy='tee')
'e2ee'
随模型更新变化
定价差异极大:
llama-3.2-3b
为每百万令牌0.15/0.60美元;
zai-org-glm-5-1
为1.75/5.50美元;Grok 4.20定价更高。若用户对成本敏感,推荐前务必通过
list_models()
确认定价。

venice_parameters — Venice-specific chat extensions

venice_parameters — Venice专属聊天扩展参数

These pass through
extra_body
in the OpenAI-compatible chat-completions call. Currently the platform's BYOK chat path doesn't have a UI for them, so users typically:
  • Test them here via
    chat_with_venice_parameters()
    to see what they do.
  • Use them in production by directly calling Venice from a script (also via this skill's
    chat_with_venice_parameters
    , or any OpenAI SDK pointed at Venice).
python
chat_with_venice_parameters(
    "What's the latest Bitcoin price?",
    venice_parameters={
        "enable_web_search": "on",            # "auto" | "on" | "off"
        "include_venice_system_prompt": False, # drop Venice's default sysprompt
        "enable_web_citations": True,         # ask for inline citations
    },
)
ParameterTypeEffect
enable_web_search
"auto" | "on" | "off"Real-time web search via Brave (ZDR)
enable_web_scraping
boolAuto-fetch URLs in user messages (Firecrawl)
enable_web_citations
boolInline citations in the response
enable_x_search
boolxAI native search (web + X) for Grok models
character_slug
strUse a Venice character persona (see
list_characters
)
include_venice_system_prompt
boolDefault True. Set False to strip Venice's defaults
strip_thinking_response
boolDrop
<think>
blocks from reasoning model output
disable_thinking
boolForce-off thinking on reasoning-capable models
enable_e2ee
boolEnable E2EE on E2EE-capable models
The Venice response echoes a
venice_parameters
block in the body so you can verify the request was actually applied (look for it in
raw_response_keys
).
这些参数通过兼容OpenAI的聊天补全调用中的
extra_body
传递。目前平台的BYOK聊天路径暂无UI设置这些参数,因此用户通常:
  • 通过
    chat_with_venice_parameters()
    测试参数效果。
  • 通过脚本直接调用Venice实现生产环境使用(也可通过本技能的
    chat_with_venice_parameters
    ,或指向Venice的任意OpenAI SDK)。
python
chat_with_venice_parameters(
    "比特币最新价格是多少?",
    venice_parameters={
        "enable_web_search": "on",            # 可选值:"auto" | "on" | "off"
        "include_venice_system_prompt": False, # 移除Venice默认系统提示词
        "enable_web_citations": True,         # 请求在响应中添加内联引用
    },
)
参数类型作用
enable_web_search
"auto" | "on" | "off"通过Brave (ZDR)实现实时网页搜索
enable_web_scraping
bool自动抓取用户消息中的URL内容(基于Firecrawl)
enable_web_citations
bool在响应中添加内联引用
enable_x_search
bool为Grok模型启用xAI原生搜索(网页+X平台)
character_slug
str使用Venice角色人设(需调用
list_characters
获取)
include_venice_system_prompt
bool默认值True。设为False可移除Venice默认提示词
strip_thinking_response
bool移除推理模型输出中的
<think>
disable_thinking
bool强制关闭支持推理的模型的思考功能
enable_e2ee
bool为支持E2EE的模型启用端到端加密
Venice的响应会在返回体中回显
venice_parameters
块,便于验证请求是否已正确应用(可在
raw_response_keys
中查看)。

Errors

错误处理

VeniceError(status, message, body)
is raised on any 4xx/5xx. Common ones:
StatusMessage hintFix
401
Admin API key required
Endpoint needs an admin-scope key the BYOK key doesn't have. Skip — no workaround.
401
VENICE_API_KEY not set
Run
request_env_input
for
VENICE_API_KEY
, or
custom_models(add_template, vendor='venice')
.
400
Invalid model id
Wrong model name. Check
list_models(type_filter='image')
for valid ids — many models in
/models
are NOT valid for
/image/edit
(only the
*-edit
family).
404
Specified model not found: …. Did you mean: …
Use the suggested model name. STT requires
openai/whisper-large-v3
(with prefix).
遇到4xx/5xx状态码时会抛出
VeniceError(status, message, body)
。常见错误如下:
状态码提示信息解决方法
401
Admin API key required
该端点需要管理员权限密钥,BYOK密钥无法使用。跳过此功能——无解决办法。
401
VENICE_API_KEY not set
调用
request_env_input
获取
VENICE_API_KEY
,或调用
custom_models(add_template, vendor='venice')
400
Invalid model id
模型名称错误。通过
list_models(type_filter='image')
查看有效ID——
/models
中的许多模型无法用于
/image/edit
(仅
*-edit
系列模型支持)。
404
Specified model not found: …. Did you mean: …
使用建议的模型名称。STT功能必须使用
openai/whisper-large-v3
(需带前缀)。

Costs

费用说明

This skill talks directly to Venice — costs are billed against the user's Venice balance, not against platform credits. The platform's per-tool ledger does NOT track Venice spend. Tell the user to check
account_balance()
periodically. Image edit is $0.04/edit, TTS depends on chars, image generate depends on resolution + steps.
account_balance()
returns both
balance_usd
and
balance_diem
— Venice supports two parallel cost models:
本技能直接与Venice交互——费用从用户的Venice余额中扣除,而非平台 credits。平台的工具账本不追踪Venice消费。请告知用户定期调用
account_balance()
查看余额。图像编辑费用为0.04美元/次,TTS费用取决于字符数,图像生成费用取决于分辨率和步数。
account_balance()
返回
balance_usd
balance_diem
——Venice支持两种并行计费模式:

Pay-as-you-go (USD top-up) — default

按需付费(美元充值)——默认模式

User funds the API key with USD at https://venice.ai/settings/api. Each request decrements
balance_usd
. Standard SaaS billing. This is what 99% of users want.
用户在https://venice.ai/settings/api为API密钥充值美元。每次请求扣除
balance_usd
。标准SaaS计费模式。99%的用户适用此模式

DIEM staking — for high-volume / always-on users

DIEM质押——面向高用量/全天候用户

DIEM is an ERC-20 on Base. Each staked DIEM unlocks $1 of AI compute per day, every day, no expiry (unused daily credits do NOT roll over). Burning DIEM returns the locked VVV (Venice's native token) used to mint it.
Pricing in
list_models()
shows both currencies, e.g. GLM 5.1 input is
$1.75/1M usd, 1.75/1M diem
— meaning Venice's backend auto-detects whether the wallet behind the API key has staked DIEM and routes spend to that bucket first. No skill changes needed to use DIEM — the API key resolves the right pool server-side.
PathWhen it makes sense
USD top-upCasual / variable usage. Pay only what you spend. Zero idle cost.
Stake DIEMDaily Venice spend ≥ $1 sustained, OR running 24h agent loops, OR want predictable cost ceiling. Capital is locked in DIEM, but unused daily credits = pure waste, so size to floor of your daily usage.
Break-even rule of thumb: stake N DIEM only if your projected daily Venice spend is ≥ $N. At any DIEM market price, the math is simple: 1 DIEM costs (current market price) once, gives $1/day forever — break-even time = price / 1.
Setup:
https://venice.ai/token
— connect a wallet on Base, stake there. Never send DIEM directly to the contract address — use the staking page only. This skill does NOT automate staking (involves wallet ops + Base chain + VVV/DIEM contracts that are out of scope for an inference skill); the user does it once on the website.
DIEM是Base链上的ERC-20代币。每质押1枚DIEM,每天可解锁1美元的AI计算额度,无有效期(未使用的每日额度不结转)。销毁DIEM可赎回用于铸造它的VVV(Venice原生代币)。
list_models()
中的定价会显示两种货币,例如GLM 5.1的输入定价为
$1.75/1M usd, 1.75/1M diem
——这意味着Venice后端会自动检测API密钥对应的钱包是否质押了DIEM,并优先从该额度池扣费。使用DIEM无需修改技能——API密钥会在服务器端自动解析正确的额度池。
模式适用场景
美元充值偶尔使用/用量波动大。仅为实际消费付费。无闲置成本。
DIEM质押每日Venice消费≥1美元且持续稳定,或运行24小时Agent循环,或需要可预测的成本上限。资金会锁定在DIEM中,但未使用的每日额度会被浪费,因此需根据每日最低用量确定质押数量。
收支平衡经验法则:仅当预计每日Venice消费≥N美元时,才质押N枚DIEM。无论DIEM当前市价如何,计算逻辑简单:1枚DIEM花费(当前市价)一次,每天提供1美元额度——回本时间=市价/1。
配置方法:访问
https://venice.ai/token
——连接Base链钱包,在该页面完成质押。切勿直接向合约地址发送DIEM——仅使用官方质押页面。本技能不自动处理质押流程(涉及钱包操作+Base链+VVV/DIEM合约,超出推理技能范围);用户需在网站上手动完成一次配置。

Video

视频功能

Video is async — the API returns a queue id and you poll. Use
video_generate()
for one-shot end-to-end (quote → queue → poll → download → optional cleanup), or call the four primitives directly when you need control.
Audio support is per-model, not universal. Pass
audio=True
only after confirming via
list_models(type_filter="video")
that the chosen model exposes audio capability.
wan-2-7-text-to-video
and most text-to-video models do NOT support audio — passing
audio=True
returns
400: This model does not support audio configuration
. The
video_queue
/
video_generate
defaults default to
audio=False
for that reason; opt in only when you've checked the capability.
python
from exports import video_generate, video_quote, list_models
视频功能为异步——API返回队列ID,需轮询获取结果。可使用
video_generate()
实现端到端单次调用(报价→排队→轮询→下载→可选清理),或在需要精细控制时直接调用四个基础函数。
音频支持因模型而异,并非所有模型都支持。仅在通过
list_models(type_filter="video")
确认所选模型具备音频能力后,再传入
audio=True
wan-2-7-text-to-video
和大多数文本转视频模型不支持音频——传入
audio=True
会返回
400: This model does not support audio configuration
。因此
video_queue
/
video_generate
默认
audio=False
;仅在确认模型支持后才启用该参数。
python
from exports import video_generate, video_quote, list_models

Browse video models — confirm capabilities before picking

浏览视频模型——选择前确认能力

videos = list_models(type_filter="video")
videos = list_models(type_filter="video")

Common families: seedance-2-0-text-to-video, wan-2-7-text-to-video,

常见模型系列:seedance-2-0-text-to-video, wan-2-7-text-to-video,

seedance-2-0-image-to-video, seedance-2-0-reference-to-video, kling-o3-r2v.

seedance-2-0-image-to-video, seedance-2-0-reference-to-video, kling-o3-r2v.

Upscale models use upscale_factor instead of resolution.

超分辨率模型使用upscale_factor而非resolution参数。

Audio-capable models are a subset — check
capabilities
on each entry.

支持音频的模型为子集——需查看每个条目的
capabilities

1. Cheap path — quote first (free, no balance charge)

1. 低成本路径——先获取报价(免费,不扣除余额)

q = video_quote( model="wan-2-7-text-to-video", duration="5s", aspect_ratio="16:9", resolution="720p", # audio omitted → defaults to False (safe for wan-2-7) )
q = video_quote( model="wan-2-7-text-to-video", duration="5s", aspect_ratio="16:9", resolution="720p", # 省略audio参数→默认False(wan-2-7模型安全设置) )

{"quote": 0.55} — USD against your Venice balance

返回结果:{"quote": 0.55} —— 从Venice余额中扣除美元

2. End-to-end (charges balance, polls until done)

2. 端到端调用(扣除余额,轮询直至完成)

v = video_generate( model="wan-2-7-text-to-video", prompt="A golden retriever chasing a frisbee at sunset, slow motion.", duration="5s", resolution="720p", save_path="retriever.mp4", # → output/videos/retriever.mp4 on_progress=lambda r: print(r.get("status"), r.get("execution_duration", 0) // 1000, "s"), )
v = video_generate( model="wan-2-7-text-to-video", prompt="日落时分,金毛猎犬慢动作追逐飞盘。", duration="5s", resolution="720p", save_path="retriever.mp4", # → 输出路径:output/videos/retriever.mp4 on_progress=lambda r: print(r.get("status"), r.get("execution_duration", 0) // 1000, "s"), )

{queue_id, saved_path, bytes, quote_usd, elapsed_s, polls, ...}

返回结果:{queue_id, saved_path, bytes, quote_usd, elapsed_s, polls, ...}


`video_generate` accepts every queue parameter via `**queue_kwargs`:

| Field | Purpose |
|---|---|
| `negative_prompt` | What to avoid |
| `image_url` | First-frame reference (image-to-video) |
| `end_image_url` | Last-frame reference (transition) |
| `audio_url` | Background music input (WAV/MP3, ≤30s, ≤15MB) |
| `video_url` | Video-to-video / upscale input (MP4/MOV/WebM) |
| `reference_image_urls` | Up to 9 character/style references |
| `elements` | Up to 4 advanced elements (Kling O3 R2V style); reference in prompt as `@Element1` |
| `scene_image_urls` | Up to 4 scene references; reference as `@Image1` |
| `upscale_factor` | 1 / 2 / 4 — for upscale models (use instead of resolution) |
| `delete_media_on_completion` | Auto-delete from Venice storage after retrieve |

**Manual loop** when you want fine control (interactive ETA, custom storage, batched jobs):

```python
queued = video_queue(model="...", prompt="...", duration="5s",
                      resolution="720p", aspect_ratio="16:9")

`video_generate`通过`**queue_kwargs`接受所有排队参数:

| 字段 | 用途 |
|---|---|
| `negative_prompt` | 指定需要避免的内容 |
| `image_url` | 首帧参考图(图像转视频) |
| `end_image_url` | 末帧参考图(转场效果) |
| `audio_url` | 背景音乐输入(WAV/MP3格式,≤30秒,≤15MB) |
| `video_url` | 视频转视频/超分辨率输入(MP4/MOV/WebM格式) |
| `reference_image_urls` | 最多9张角色/风格参考图 |
| `elements` | 最多4个高级元素(Kling O3 R2V风格);在提示词中通过`@Element1`引用 |
| `scene_image_urls` | 最多4张场景参考图;通过`@Image1`引用 |
| `upscale_factor` | 1 / 2 / 4 —— 超分辨率模型使用(替代resolution参数) |
| `delete_media_on_completion` | 完成后自动从Venice存储中删除媒体文件 |

**手动流程(需要精细控制时使用,如交互式ETA、自定义存储、批量任务):**

```python
queued = video_queue(model="...", prompt="...", duration="5s",
                      resolution="720p", aspect_ratio="16:9")

Add audio=True only when the model's
capabilities
include audio.

仅当模型
capabilities
包含音频时,才添加audio=True参数。

qid = queued["queue_id"] download_url = queued.get("download_url") # only for VPS-backed models
while True: r = video_retrieve(model="...", queue_id=qid) if "video_bytes" in r: open("out.mp4", "wb").write(r["video_bytes"]); break if r.get("status") == "COMPLETED": # VPS-backed model — fetch download_url import requests; v = requests.get(download_url, timeout=120) open("out.mp4", "wb").write(v.content); break if r.get("status") != "PROCESSING": raise RuntimeError(r) time.sleep(5)
video_complete(model="...", queue_id=qid) # cleanup

**Video transcription (YouTube only)**:

```python
video_transcribe_youtube("https://www.youtube.com/watch?v=...")
qid = queued["queue_id"] download_url = queued.get("download_url") # 仅VPS托管模型返回该字段
while True: r = video_retrieve(model="...", queue_id=qid) if "video_bytes" in r: open("out.mp4", "wb").write(r["video_bytes"]); break if r.get("status") == "COMPLETED": # VPS托管模型——获取download_url import requests; v = requests.get(download_url, timeout=120) open("out.mp4", "wb").write(v.content); break if r.get("status") != "PROCESSING": raise RuntimeError(r) time.sleep(5)
video_complete(model="...", queue_id=qid) # 清理任务

**视频转录(仅支持YouTube):**

```python
video_transcribe_youtube("https://www.youtube.com/watch?v=...")

→ {"transcript": "...", "lang": "en"}

→ 返回结果:{"transcript": "...", "lang": "en"}


For arbitrary local audio/video files, use `transcribe()` (uploads to /audio/transcriptions and accepts file paths). For non-YouTube hosted video, strip audio with ffmpeg first then call `transcribe()`.

**Video errors** beyond the table above:

| Code | Meaning |
|---|---|
| 400 | Bad params: model doesn't support that duration/resolution combo, missing `image_url` for i2v, or `prompt` empty |
| 402 | Insufficient balance — top up at venice.ai |
| 413 | Payload too big — use hosted URLs instead of base64 data URIs |
| 422 | Content policy violation (rare on Venice but possible on i2v) |
| 503 | Queue saturated — wait and retry |

Gotchas:
- `duration` is required even for `Auto` (pass it explicitly).
- `download_url` from queue is valid 24h — fetch promptly.
- Upscale models require `upscale_factor`, NOT `resolution`.
- Quote varies wildly by model and duration — wan 5s @ 720p ≈ $0.55, seedance-2-0-pro 10s @ 1080p can be $5+.

对于本地任意音频/视频文件,使用`transcribe()`(上传至/audio/transcriptions,支持文件路径)。对于非YouTube托管的视频,先使用ffmpeg提取音频,再调用`transcribe()`。

**除上述表格外的视频错误:**

| 状态码 | 含义 |
|---|---|
| 400 | 参数错误:模型不支持该时长/分辨率组合,图像转视频缺少`image_url`,或`prompt`为空 |
| 402 | 余额不足——前往venice.ai充值 |
| 413 | 负载过大——使用托管URL替代base64数据URI |
| 422 | 违反内容政策(Venice上很少见,但图像转视频可能出现) |
| 503 | 队列饱和——等待后重试 |

注意事项:
- 即使选择“Auto”,`duration`参数也必须显式传入。
- 队列返回的`download_url`有效期为24小时——请及时下载。
- 超分辨率模型需要`upscale_factor`参数,而非`resolution`。
- 报价因模型和时长差异极大:wan模型5秒720p约0.55美元,seedance-2-0-pro模型10秒1080p可能超过5美元。

Don't

禁忌操作

  • Don't wrap chat as a function here. Use BYOK.
  • Don't fabricate a model id from training data — Venice ships new models weekly. Always
    list_models()
    or
    list_model_traits()
    first.
  • Don't ask the user to paste the API key in chat. Use
    request_env_input
    (or
    custom_models add_template
    ).
  • 不要在本技能中封装聊天功能。请使用BYOK流程。
  • 不要根据训练数据编造模型ID——Venice每周都会发布新模型。务必先调用
    list_models()
    list_model_traits()
  • 不要让用户在聊天中粘贴API密钥。请使用
    request_env_input
    (或
    custom_models add_template
    )。