Models API
列出和查看所有可用的模型及其详细信息
GET/v1/models
公开接口
Models API 是公开接口,无需 API Key 即可调用。这使得它可以方便地用于获取模型列表、 查看模型能力等场景。
列出所有模型
返回平台上所有可用的模型列表,包括来自不同供应商的模型。
请求示例
curl https://api.mintcloud.ai/v1/models \
-H "Authorization: Bearer $MINT_API_KEY"响应格式
{
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1712361441,
"description": "用于理解图像的多模态 GPT-4o 模型",
"context_length": 128000,
"architecture": "decoder",
"pricing": {
"prompt": "0.005",
"completion": "0.015"
},
"top_provider": "OpenAI",
"supported_parameters": [
"temperature",
"max_tokens",
"stream"
]
},
{
"id": "claude-3-5-sonnet",
"object": "model",
"created": 1715038800,
"description": "Anthropic Claude 3.5 Sonnet 模型",
"context_length": 200000,
"architecture": "decoder",
"pricing": {
"prompt": "0.003",
"completion": "0.015"
},
"top_provider": "Anthropic",
"supported_parameters": [
"temperature",
"max_tokens"
]
}
]
}Model 对象字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | string | 否 | 模型唯一标识符,如 gpt-4o、claude-3-5-sonnet |
| object | string | 否 | 总是返回 'model' |
| created | number | 否 | 模型创建时间戳 |
| description | string | 否 | 模型的详细描述 |
| context_length | number | 否 | 模型支持的最大上下文长度(token) |
| architecture | string | 否 | 模型架构,如 decoder、encoder-decoder |
| pricing | object | 否 | 模型定价信息,包含 prompt 和 completion 价格 |
| top_provider | string | 否 | 提供该模型的主要供应商 |
| supported_parameters | string[] | 否 | 模型支持的参数列表 |
按供应商过滤
使用 GET /v1/models/{provider} 端点 可以只返回特定供应商的模型。
支持的供应商
openaianthropicgoogledeepseekzhipuyi
# 列出 OpenAI 提供商的所有模型
curl https://api.mintcloud.ai/v1/models/openai \
-H "Authorization: Bearer $MINT_API_KEY"
# 列出 Anthropic 提供商的所有模型
curl https://api.mintcloud.ai/v1/models/anthropic \
-H "Authorization: Bearer $MINT_API_KEY"获取模型详情
使用 GET /v1/models/{provider}/{model_id} 端点可以获取特定模型的详细信息。
# 获取特定模型详情
curl https://api.mintcloud.ai/v1/models/openai/gpt-4o \
-H "Authorization: Bearer $MINT_API_KEY"响应格式
字段说明
object总是返回 "list"
dataModel 对象数组,包含所有可用模型的详细信息
使用场景
动态模型选择
根据模型能力、定价和可用性动态选择最适合的模型
成本估算
通过模型定价信息估算不同模型的使用成本
能力检查
检查模型支持的参数和能力,确保请求参数兼容
上下文长度验证
根据模型的 context_length 验证输入长度是否超限