模型 API
查询 API Key 可见的模型列表及各模型支持的端点类型
模型接口用于查询当前 API Key 可见的模型列表,以及各模型支持的端点类型。调用其他能力前,建议先通过本接口确认可用模型。
接口一览
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /v1/models | 获取当前令牌可见的模型列表 |
模型筛选:其他接口请求体中的 model 字段须为本接口返回的 data[].id;supported_endpoint_types 指示该模型可用于哪些能力。
GET /v1/models
获取当前令牌可见的模型列表。
鉴权:Bearer Token
请求:无请求体
请求示例(curl)
curl https://www.yunsell.com/v1/models \
-H "Authorization: Bearer sk-xxx"
响应体
HTTP 200
{
"success": true,
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": [
"openai",
"openai-response",
"image-generation"
]
},
{
"id": "agnes-video-v2.0",
"object": "model",
"created": 1626777600,
"owned_by": "agnes-ai",
"supported_endpoint_types": [
"openai-video"
]
}
]
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
success | boolean | 是否成功 |
object | string | 固定为 list |
data | array | 模型列表 |
data[].id | string | 模型 ID,其他接口 model 字段使用此值 |
data[].object | string | 固定为 model |
data[].created | number | Unix 时间戳(秒) |
data[].owned_by | string | 模型归属标识 |
data[].supported_endpoint_types | string | 支持的端点类型 |
data[].tags | string | 模型标签(若有) |
supported_endpoint_types 取值
| 值 | 说明 | 对应文档 |
|---|---|---|
openai | Chat / Completions | 文本 API |
openai-response | Responses 对话 | 文本 API |
image-generation | 图像生成 / 编辑 | 图像 API |
openai-video | 视频生成 | 视频 API |
失败响应
HTTP 200(业务失败)
{
"success": false,
"message": "get user group failed"
}
| 字段 | 类型 | 说明 |
|---|---|---|
success | boolean | 固定为 false |
message | string | 失败原因 |
错误格式说明见 网关扩展错误。

