Skip to main content
GET
/
v1
/
models
获取模型列表
curl --request GET \
  --url https://api.qhaigc.net/v1/models \
  --header 'Authorization: Bearer <token>'

功能说明

获取当前 API Key 有权访问的所有模型列表,包括模型 ID、创建时间、所属厂商和功能标签等信息。

请求方式

GET /v1/models

调用示例

import openai

client = openai.OpenAI(
    api_key="sk-your-api-key-here",
    base_url="https://api.qhaigc.net/v1"
)

models = client.models.list()
for model in models:
    print(f"ID: {model.id}, Group: {model.group}")

返回结果

返回包含模型对象的列表。
{
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1626777600,
      "group": "openai",
      "tags": ["文本聊天"],
      "description": "OpenAI 旗舰级多模态模型..."
    },
    {
      "id": "qh-draw-x2-preview",
      "object": "model",
      "created": 1626777600,
      "group": "qh-draw",
      "tags": ["绘图(Image格式)"],
      "description": "自研专业级绘图模型..."
    }
  ]
}

相关页面

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200

模型列表