メインコンテンツへスキップ

レスポンス

object
string
常に list です。
data
array
モデルオブジェクトの配列です。各モデルには常に以下が含まれます:
  • id (string): モデル識別子
  • object (string): model
  • created (integer): 作成タイムスタンプ
  • owned_by (string): モデルプロバイダー
  • tokenlab.aliases (array): 同じモデルの公開エイリアス
  • tokenlab.pricing (object): スカラー形式の公開料金サマリー
  • tokenlab.capabilities (array): 公開機能タグ
  • tokenlab.max_input_tokens (number or null): 利用可能な場合の入力コンテキスト上限
  • tokenlab.max_output_tokens (number or null): 利用可能な場合の出力上限
  • tokenlab.category (string): 公開モデルカテゴリ
  • tokenlab.pricing_unit (string): 公開料金単位
  • tokenlab.has_complex_pricing (boolean): モデル固有の料金ディメンションがあるかどうか
  • tokenlab.lifecycle(object):ライフサイクル段階、リリース/非推奨日、代替モデル、latest バッジの由来
  • tokenlab.commercial(object):ユーザー課金ポリシー、無料理由、任意の無料終了時刻
  • tokenlab.badges(array):ライフサイクルと商用メタデータから派生した表示バッジ
条件付きの一覧メタデータ:
  • tokenlab.providers (array): 利用可能な場合の公開プロバイダー
  • tokenlab.cache_pricing (object or null): 利用可能な場合の prompt cache 料金
  • tokenlab.pricing_summary (object or null): 複雑な料金体系のモデルでのみ返されます
  • tokenlab.request_format_summary (object or null): public_operationsrequest_endpointrequest_endpoint_by_operation を含む軽量な非チャット発見用サマリー
  • tokenlab.agent_preferences (object): recommended_for がある場合のみ返されます
tokenlab.capability_flagstokenlab.supported_operationstokenlab.pricing_provenancetokenlab.request_format_details などの詳細専用フィールドは GET /v1/models/{model} でのみ返されます。
GET /v1/models は発見向けに最適化されています。capability_flagspricing_provenance、完全な request_format_details のような詳細専用メタデータは GET /v1/models/{model} にあります。

クエリパラメータ

category
string
任意の公開カテゴリフィルタです。chatimagevideoaudiottssttmusic3dembeddingreranktranslation をサポートします。
任意の非チャット推奨シーンです。imagevideomusic3dttssttembeddingreranktranslation をサポートします。
provider
string
openaianthropicgoogledeepseek などの任意のプロバイダーフィルタです。
tag
string
chatimagevideoembeddingtranslation などの任意のモデルタグフィルタです。
recommended_for がある場合、/v1/models は直近のキャッシュ済み 24 時間成功率スナップショットに基づいて非チャットモデルを並べ替えます。status = "insufficient_samples" のモデルも表示されますが、スコア付きモデルの後ろに並びます。
curl "https://api.tokenlab.sh/v1/models" \
  -H "Authorization: Bearer sk-your-api-key"
from openai import OpenAI

client = OpenAI(
    api_key="sk-your-api-key",
    base_url="https://api.tokenlab.sh/v1"
)

models = client.models.list()

for model in models.data:
    print(f"{model.id} ({model.owned_by})")
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'sk-your-api-key',
  baseURL: 'https://api.tokenlab.sh/v1'
});

const models = await client.models.list();

for (const model of models.data) {
  console.log(`${model.id} (${model.owned_by})`);
}
package main

import (
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.tokenlab.sh/v1/models", nil)
    req.Header.Set("Authorization", "Bearer sk-your-api-key")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var payload struct {
        Data []struct {
            ID      string `json:"id"`
            OwnedBy string `json:"owned_by"`
        } `json:"data"`
    }

    json.NewDecoder(resp.Body).Decode(&payload)

    for _, model := range payload.Data {
        fmt.Printf("%s (%s)\n", model.ID, model.OwnedBy)
    }
}
<?php
$ch = curl_init('https://api.tokenlab.sh/v1/models');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer sk-your-api-key'
    ]
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
foreach ($data['data'] as $model) {
    echo "{$model['id']} ({$model['owned_by']})\n";
}
{
  "object": "list",
  "data": [
    {
      "id": "gpt-5.4",
      "object": "model",
      "created": 1706000000,
      "owned_by": "openai"
    },
    {
      "id": "claude-sonnet-4-6",
      "object": "model",
      "created": 1706000000,
      "owned_by": "anthropic"
    },
    {
      "id": "gemini-3.5-flash",
      "object": "model",
      "created": 1706000000,
      "owned_by": "google"
    }
  ]
}

プロバイダーでのフィルタリング

# Get all OpenAI models
openai_models = [m for m in models.data if m.owned_by == "openai"]

# Get all Anthropic models
anthropic_models = [m for m in models.data if m.owned_by == "anthropic"]

モデルカテゴリ

プロバイダー例のモデル
openaigpt-5.4, gpt-5.4-mini, gpt-5-mini, gpt-4o, gpt-image-2
anthropicclaude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5
googlegemini-3.1-pro-preview, gemini-3.5-flash, gemini-2.5-pro
deepseekdeepseek-r1, deepseek-v3-2
xaigrok-4.1
moonshotkimi-k2.5
minimaxminimax-m3
metallama-3.3-70b, llama-3.1-405b

モデル削除

DELETE /v1/models/{model} はサポートされません。TokenLab のモデルは共有の公開カタログであり、ユーザー所有のファインチューニング済みモデルではありません。