モデル API は、価格つきのモデルカタログを返します。API キーは不要です。完全なスキーマは、OpenAPI 定義と API リファレンスにあります。
モデルを一覧する
Section titled “モデルを一覧する”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: 価格の項目ごとに 1 件。amount_micro_usd(整数)、amount_usd(10 進文字列)、conditions(その価格を選ぶ入力値)を持ちます。data_policy、およびモデルのページと Markdown 版へのlinks。
モデルを 1 件取得する
Section titled “モデルを 1 件取得する”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
Section titled “キャッシュと CORS”公開の GET レスポンスは、すべての origin を許可し、弱い ETag を持ち、Cache-Control: public, max-age=60 を使います。If-None-Match を送ると、カタログが変わっていなければ 304 を返します。
利用できるモデル
Section titled “利用できるモデル”| モデル 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 表示です。表示価格には当社のマージンを含みます。