自动模型选择
基础 URL https://arteza.ai/api/v1
OpenAPI 3.1 规范,用于 SDK 生成器和代理: /api/v1/openapi.json
官方 TypeScript 和 Python SDK、命令行工具和代理技能: SDK 和命令行工具
发送 "model": "auto" 和一个 "route" 对象,Arteza 会选择模型:它读取您发送的媒体以确定任务(图像加 "video" 是图像转视频,音频加脸部是虚拟形象),保留能够使用这些字段完成任务的模型,并按 route.priority 排序 -- 质量(默认)、速度或成本 -- 可选在 route.max_credits 下限制。响应会包含一个 "routing" 对象,说明选择的模型、原因和备选方案。POST /v1/estimate 配合 "model": "auto" 是免费试运行。
curl https://arteza.ai/api/v1/generations \
-H "Authorization: Bearer $ARTEZA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"route": { "output": "video", "priority": "cost", "max_credits": 5 },
"input": { "prompt": "A red fox runs through fresh snow at dawn", "image_url": "https://example.com/fox.jpg" }
}'
# 202 ... "routing": {
# "task": "image-to-video", "priority": "cost",
# "chosen": { "model": "...", "credits": 1.7, "seconds": 90 },
# "reason": "the lowest price for image-to-video with these inputs ...",
# "alternatives": [ ... ], "dropped_fields": []
# }