通用开放接口模型 API
GET /v1/models
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 | 失败原因 |
错误格式说明见 网关扩展错误。