核心

列出模型

列出当前可用模型

GET
/v1/models

模型目录是公开接口,不需要 API 密钥。每个模型都带有当前能力、价格和 API 格式摘要;需要完整信息时,再查询单个模型。

提供 API 密钥时,TokenLab 会校验密钥,并按密钥的模型权限和有效交付策略筛选目录。设为 verified 的密钥只列出支持 TokenLab Verified 的模型;设为 official 时只列出支持 Official 的模型。切换密钥或交付策略后,应重新加载模型选择列表。请求中受支持的交付策略覆盖优先于密钥和工作区默认值。

查询参数

categorystringquery

按类别筛选:chat、image、video、audio、tts、stt、music、3d、embedding、rerank 或 translation。

recommended_forstringquery

获取某类任务的当前推荐模型,例如 image、video、music、3d、tts、stt、embedding、rerank 或 translation。

providerstringquery

按模型厂商筛选,例如 openai、anthropic、google 或 deepseek。

tagstringquery

按标签筛选,例如 chat、image、video、embedding 或 translation。

响应

objectstring

固定为 list。

dataarray

模型列表。每项包含 id、owned_by 和 tokenlab 摘要。

tokenlab 中常用的列表字段包括:

  • tokenlab.aliases:公开别名。
  • tokenlab.capabilities:模型能力。
  • tokenlab.deliveryAvailability:若提供,分别说明是否支持 verified 和 official;字段缺失表示未知,支持不代表实时可用保证。
  • tokenlab.pricing 与 tokenlab.pricing_unit:当前价格和计费单位。
  • tokenlab.max_input_tokens 与 tokenlab.max_output_tokens:上下文和输出上限。
  • tokenlab.category:模型类别。
  • tokenlab.lifecycle、tokenlab.commercial 与 tokenlab.badges:当前状态、收费方式和页面标签。
  • tokenlab.request_format_summary:适用的 API 地址和操作。
  • tokenlab.agent_preferences:使用 recommended_for 时返回的推荐信息。

使用 recommended_for 时,响应还可能包含推荐状态和更新时间。推荐顺序会变化,请在使用时读取最新结果。

示例

curl "https://api.tokenlab.sh/v1/models?category=video"
{
  "object": "list",
  "data": [
    {
      "id": "veo3.1",
      "object": "model",
      "owned_by": "google",
      "tokenlab": {
        "category": "video",
        "capabilities": ["text-to-video", "image-to-video"]
      }
    }
  ]
}

单个模型的完整字段见获取模型。

curl -X GET "https://example.com/v1/models"
{  "object": "list",  "data": [    {      "id": "string",      "object": "model",      "created": 0,      "owned_by": "string",      "tokenlab": {        "aliases": [          "string"        ],        "deliveryAvailability": {          "verified": true,          "official": true,          "operations": {            "property1": {              "verified": true,              "official": true            },            "property2": {              "verified": true,              "official": true            }          }        },        "pricing": {},        "capabilities": [          "string"        ],        "providers": [          "string"        ],        "max_input_tokens": 0,        "max_output_tokens": 0,        "category": "string",        "pricing_unit": "string",        "cache_pricing": {},        "has_complex_pricing": true,        "pricing_summary": {},        "agent_preferences": {},        "lifecycle": {          "stage": "active",          "reason": "string",          "replacement_model": "string",          "released_at": "2019-08-24T14:15:22Z",          "deprecated_at": "2019-08-24T14:15:22Z",          "retired_at": "2019-08-24T14:15:22Z",          "sunset_at": "2019-08-24T14:15:22Z",          "latest": true,          "latest_source": "auto",          "latest_window_days": 0        },        "commercial": {          "user_charge_policy": "paid",          "free_reason": "platform",          "free_until": "2019-08-24T14:15:22Z"        },        "badges": [          {            "key": "free",            "tone": "green",            "priority": 0,            "tooltip": {              "key": "string",              "values": {                "property1": "string",                "property2": "string"              }            }          }        ],        "request_format_summary": {          "public_operations": [            "string"          ],          "request_endpoint": "string",          "request_endpoint_by_operation": {            "property1": "string",            "property2": "string"          }        }      }    }  ]}

授权

BearerAuth
AuthorizationBearer <token>

API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。

位置: header

查询参数

provider?string

按公共模型提供商过滤,例如 openai、anthropic、google 或 minimax。

tag?string

按公共能力标签过滤。

category?string

按模型类别过滤。

可选值

  • "chat"
  • "embedding"
  • "translation"
  • "image"
  • "video"
  • "audio"
  • "tts"
  • "stt"
  • "rerank"
  • "3d"
  • "music"
  • "decision"
recommended_for?string

为任务类别排序支持的非聊天模型,并包含推荐依据。

可选值

  • "image"
  • "video"
  • "music"
  • "3d"
  • "tts"
  • "stt"
  • "embedding"
  • "rerank"
  • "translation"
view?string

选择紧凑的模型选择字段或完整的兼容 OpenAI 的列表格式。

默认值"full"

可选值

  • "compact"
  • "full"

响应

application/json

application/json

application/json

application/json

application/json