切换主题
原生OpenAI格式
获取当前可用的模型列表。
根据请求头自动识别返回格式:
- 包含
x-api-key和anthropic-version头时返回 Anthropic 格式 - 包含
x-goog-api-key头或key查询参数时返回 Gemini 格式 - 其他情况返回 OpenAI 格式
原生OpenAI格式
GET /v1/models
获取当前可用的模型列表。
根据请求头自动识别返回格式:
- 包含
x-api-key和anthropic-version头时返回 Anthropic 格式 - 包含
x-goog-api-key头或key查询参数时返回 Gemini 格式 - 其他情况返回 OpenAI 格式
认证
BearerAuth
请求参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
| key | query | 否 | string | Google API Key (用于 Gemini 格式) |
| x-api-key | header | 否 | string | Anthropic API Key (用于 Claude 格式) |
| anthropic-version | header | 否 | string | Anthropic API 版本 |
| x-goog-api-key | header | 否 | string | Google API Key (用于 Gemini 格式) |
响应
200 成功获取模型列表
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| object | 否 | string | Examples: list |
| data | 否 | array<object> | - |
| data[].id | 否 | string | 模型 ID Examples: gpt-4 |
| data[].object | 否 | string | 对象类型 Examples: model |
| data[].created | 否 | integer | 创建时间戳 |
| data[].owned_by | 否 | string | 模型所有者 Examples: openai |
原始 Schema
json
{
"type": "object",
"properties": {
"object": {
"type": "string",
"examples": [
"list"
]
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "模型 ID",
"examples": [
"gpt-4"
]
},
"object": {
"type": "string",
"description": "对象类型",
"examples": [
"model"
]
},
"created": {
"type": "integer",
"description": "创建时间戳"
},
"owned_by": {
"type": "string",
"description": "模型所有者",
"examples": [
"openai"
]
}
},
"x-apifox-orders": [
"id",
"object",
"created",
"owned_by"
]
}
}
},
"x-apifox-orders": [
"object",
"data"
]
}401 认证失败
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| error | 否 | object | - |
| error.message | 否 | string | 错误信息 |
| error.type | 否 | string | 错误类型 |
| error.param | 否 | string | null | 相关参数 |
| error.code | 否 | string | null | 错误代码 |
原始 Schema
json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "错误信息"
},
"type": {
"type": "string",
"description": "错误类型"
},
"param": {
"type": [
"string",
"null"
],
"description": "相关参数"
},
"code": {
"type": [
"string",
"null"
],
"description": "错误代码"
}
},
"x-apifox-orders": [
"message",
"type",
"param",
"code"
]
}
},
"x-apifox-orders": [
"error"
]
}