模型 API 返回带价格的模型目录,无需 API 密钥。完整的结构见 OpenAPI 定义和 API 参考。
列出模型
章节标题“列出模型”GET /v1/models
查询参数均为可选,多个筛选条件按 AND 组合:
modality:只返回主模态(modality字段)匹配的模型。同时输出音频的视频模型只在video下返回,不会在audio下返回;全部输出模态列在capabilities.output_modalities中。取值为text,image,video,audio之一。task:只返回支持该任务的模型。取值为chat,text-to-image,image-edit,text-to-video,image-to-video,reference-to-video,text-to-speech之一。locale:summary、description和参数说明所用的语言。取值为en、ja、zh、ko之一,默认为en。
传入这些列表之外的值会返回 400 和 invalid_request,error.details.allowed 会列出可接受的值。
curl "https://api.sakuranbo.ai/v1/models?modality=image&locale=en"const response = await fetch("https://api.sakuranbo.ai/v1/models?modality=image&locale=en");const data = await response.json();console.log(data);import requests
response = requests.get("https://api.sakuranbo.ai/v1/models?modality=image&locale=en")print(response.json())响应包含 object: "list" 和模型的 data 数组。每个模型包含:
id、name、vendor、vendor_name、modality、tasks、status和endpoint(运行该模型的生成端点)。released_at(仅在发布日期已确认时提供)和updated_at。summary、description、capabilities和parameters(JSON Schema 风格的输入字段)。pricing:每个价格项一条,包含amount_micro_usd(整数)、amount_usd(十进制字符串)和conditions(决定该价格的输入值)。data_policy,以及指向模型页面及其 Markdown 版本的links。
获取单个模型
章节标题“获取单个模型”GET /v1/models/{vendor}/{model}
curl "https://api.sakuranbo.ai/v1/models/sakuranbo/cherryimage-1.0-pro"const response = await fetch("https://api.sakuranbo.ai/v1/models/sakuranbo/cherryimage-1.0-pro");const data = await response.json();console.log(data);import requests
response = requests.get("https://api.sakuranbo.ai/v1/models/sakuranbo/cherryimage-1.0-pro")print(response.json())目录中不存在的 ID 会返回 404 和 model_not_found。
缓存与 CORS
章节标题“缓存与 CORS”公开的 GET 响应允许任意来源,带有弱 ETag,并使用 Cache-Control: public, max-age=60。目录没有变化时,发送 If-None-Match 会得到 304。
可用模型
章节标题“可用模型”| 模型 ID | 模态 | 任务 | 上游状态 |
|---|---|---|---|
sakuranbo/cherrytext-1.0-flash | text | chat | GA(上游) |
sakuranbo/cherry-1.0-pro | video | text-to-video, image-to-video, reference-to-video | GA(上游) |
sakuranbo/cherryimage-1.0-pro | image | text-to-image, image-edit | GA(上游) |
所有价格均以 USD 计价,标价已包含我们的加价。