モデル一覧メタデータAPI
curl --request GET \
--url https://api.apimart.ai/v1/modelsimport requests
url = "https://api.apimart.ai/v1/models"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.apimart.ai/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apimart.ai/v1/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.apimart.ai/v1/models"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.apimart.ai/v1/models")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apimart.ai/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyモデル
モデル一覧メタデータAPI
- GET /v1/models の基本一覧に expand パラメータでカテゴリ・機能・パラメータスキーマを追加
categoryフィルタとexpand=parametersによる JSON Schema の取得に対応- 自動連携、動的フォーム、事前検証に利用可能
GET
/
v1
/
models
モデル一覧メタデータAPI
curl --request GET \
--url https://api.apimart.ai/v1/modelsimport requests
url = "https://api.apimart.ai/v1/models"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.apimart.ai/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apimart.ai/v1/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.apimart.ai/v1/models"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.apimart.ai/v1/models")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apimart.ai/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyモデル一覧メタデータAPI(
GET /v1/models)は、デフォルトではモデル名などの基本フィールドのみを返します。expand クエリパラメータを追加すると、各モデルに次の情報が付加されます。- カテゴリ(
category):chat/image/video/audio - 機能タグ(
capability_tags):Text to Video、Image to Imageなど - パラメータ契約(
parameters):必須/任意、列挙値、範囲、デフォルト値を示す標準 JSON Schema
後方互換性:expand を指定しない場合(または認識されない値を指定した場合)、レスポンスは従来形式と同一で、既存クライアントには影響しません。
モデルの範囲:返されるモデルは API キーのモデル制限と所属グループによって決まります。
category=unknown は、プラットフォームにそのモデルのカテゴリメタデータがまだ登録されていないことを示します。メタデータ付きモデル一覧の取得
GET/v1/models
リクエストヘッダー
Authorization: Bearer YOUR_API_KEY
クエリパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
expand | string | いいえ | category:カテゴリと機能タグを追加(軽量)。parameters:パラメータの JSON Schema も追加(完全版、レスポンス大) |
category | string | いいえ | chat / image / video / audio / unknown でフィルタ。expand 指定時のみ有効 |
expand を指定しない場合と同じで、API キーのモデル制限と所属グループに従います。
例1:カテゴリのみ
cURL
curl -s "https://api.apimart.ai/v1/models?expand=category" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"object": "list",
"data": [
{
"id": "wan2.6",
"object": "model",
"created": 1626777600,
"owned_by": "alibaba",
"supported_endpoint_types": ["openai"],
"category": "video",
"capability_tags": ["Text to Video"]
},
{
"id": "gpt-4o",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": ["openai"],
"category": "chat",
"capability_tags": ["Text", "Vision"]
}
]
}
例2:動画モデルの完全なパラメータ契約
cURL
curl -s "https://api.apimart.ai/v1/models?expand=parameters&category=video" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept-Encoding: gzip" --compressed
input_schema.properties は一部のフィールドのみ表示):
{
"id": "wan2.6",
"object": "model",
"created": 1626777600,
"owned_by": "alibaba",
"supported_endpoint_types": ["openai"],
"category": "video",
"capability_tags": ["Text to Video"],
"parameters": {
"operation": "video_generation",
"method": "POST",
"endpoint": "/v1/videos/generations",
"schema_version": "2026-07-30",
"source": "task_model_registry",
"input_schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": true,
"required": ["model"],
"anyOf": [
{ "required": ["prompt"] },
{ "required": ["messages"] },
{ "required": ["image_urls"] },
{ "required": ["image_with_roles"] },
{ "required": ["video_urls"] }
],
"properties": {
"model": { "type": "string", "const": "wan2.6" },
"prompt": { "type": "string", "minLength": 1 },
"duration": { "type": "integer", "minimum": 1 },
"resolution": { "type": "string" },
"aspect_ratio": { "type": "string" }
}
}
}
}
レスポンスフィールド
項目フィールド
| フィールド | 型 | 出現条件 | 説明 |
|---|---|---|---|
id / object / created / owned_by / supported_endpoint_types | - | 常に | 従来のAPIと同じ |
category | string | expand 指定時 | chat / image / video / audio / unknown |
capability_tags | string[] | expand 指定時かつタグがある場合 | 下記の機能タグ表を参照 |
parameters | object | expand=parameters かつ契約がある場合 | 下記の parameters ブロックを参照 |
category=unknown は、プラットフォームにそのモデルのカテゴリメタデータがまだ登録されていないことを示します(通常は API キーのホワイトリストに非標準名が設定されている場合)。モデル自体は通常どおり呼び出せます。
機能タグ
| カテゴリ | タグの候補 |
|---|---|
| video | Text to Video、Image to Video、Video to Video |
| image | Text to Image、Image to Image |
| chat | Text、Embedding、Vision、Audio、Omni |
| audio | Audio |
parameters ブロック
| フィールド | 説明 |
|---|---|
operation | image_generation / video_generation |
method + endpoint | モデルの呼び出しに使用する HTTP メソッドとパス(例:POST /v1/videos/generations) |
schema_version | 契約バージョン(日付)。バージョン間ではフィールドの追加のみ |
source | トラブルシューティング用の契約データソース。base は共通の基本契約のみを意味する |
input_schema | JSON Schema draft 2020-12 による完全なリクエストボディ契約 |
input_schema の読み方
標準 JSON Schema であり、主要なツール(ajv、pydantic、openapi-generator など)から直接利用できます。- 必須パラメータ = 最上位の
required配列。anyOfは「次の組み合わせのうち少なくとも1つ」を意味します(上の例ではprompt、messages、3種類の参照メディア入力の5つから1つ) - 列挙値 = プロパティの
enum - 範囲 =
minimum/maximum - デフォルト値 =
default additionalProperties: true:スキーマにないモデル固有の拡張パラメータも許可します(metadata経由で渡されます)
単一モデルの照会
一覧APIとは別に、単一モデルの契約を取得する専用エンドポイントがあります(同じ構造に、冪等性とレスポンス契約の説明ブロックが追加されます)。curl -s "https://api.apimart.ai/v1/models/wan2.6/schema" \
-H "Authorization: Bearer YOUR_API_KEY"
# モデル名に "/" が含まれる場合はクエリパラメータ形式を使用
curl -s "https://api.apimart.ai/v1/model-schema?model=provider/model-name" \
-H "Authorization: Bearer YOUR_API_KEY"
注意事項
- 現在、chat / audio モデルには
categoryとcapability_tagsのみがあり、parametersはありません(パラメータ契約は現在 image / video のみを対象とし、今後追加予定です)。 - スキーマはベストエフォートの契約であり、最終的にはサーバー側の検証が優先されます。特定の解像度と長さの組み合わせなど、一部モデルの動的制約はスキーマで完全に表現されない場合があり、リクエストが拒否されて具体的な理由が返されることがあります。
- データの鮮度は分単位です。カタログはキャッシュされるため、新規モデルやパラメータ変更の反映に数分かかる場合があります。
expand=parametersの完全なレスポンスは数百KBに達する場合があります。必要に応じてcategoryで絞り込み、Accept-Encoding: gzipを指定してください。- このパラメータは OpenAI 形式のモデル一覧にのみ有効です。Anthropic / Gemini 形式のモデル一覧APIは
expandをサポートしません。