跳至主要内容

Models

GET /v1/models

列出所有可用的 AI 模型,包含定價資訊。

請求

GET /v1/models
Authorization: Bearer sk-your-api-key

查詢參數

參數類型說明
typestring篩選模型類型:chatembeddingrerank
owned_bystring篩選提供商:openaianthropicgoogle
model_idstring按模型 ID 搜尋

回應

{
"success": true,
"code": 0,
"message": "OK",
"data": [
{
"model_id": "openai/gpt-4o",
"name": "GPT-4o",
"type": "chat",
"owned_by": "openai",
"context_length": 128000,
"input_price_per_1m": 2.5,
"output_price_per_1m": 10.0,
"supports_streaming": true,
"supports_function_calling": true,
"active": true
}
]
}

回應欄位

欄位類型說明
model_idstring模型 ID,格式為 provider/model-name
namestring人類可讀的模型名稱
typestringchat / embedding / rerank
owned_bystring模型提供商
context_lengthnumber最大 Context 長度(Token 數)
input_price_per_1mnumber輸入定價,USD / 1M tokens
output_price_per_1mnumber輸出定價,USD / 1M tokens
supports_streamingboolean是否支援串流
activeboolean是否當前可用

範例:只列出 Chat 模型

GET /v1/models?type=chat

範例:只列出 OpenAI 的模型

GET /v1/models?owned_by=openai