> ## Documentation Index
> Fetch the complete documentation index at: https://doc.geekapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/models — 列出账户所有可访问模型

> 获取当前 API Key 可访问的模型列表，支持按类型（文字/图片/视频/音频）筛选，依据令牌权限与用户组动态过滤。

`GET https://geekapis.com/v1/models` 接口用于获取当前 API Key 可访问的模型列表，完全兼容 OpenAI Models API 格式。返回结果会依据令牌模型限制、用户组、可用渠道和模型计费配置**动态过滤**，不同 API Key 可能看到不同的模型列表。

## 鉴权

<ParamField header="Authorization" type="string" required>
  Bearer Token 认证。在请求头中添加：

  ```text theme={null}
  Authorization: Bearer YOUR_API_KEY
  ```

  前往 [API Key 管理页面](https://geekapis.com/keys) 获取您的 API Key。
</ParamField>

## 查询参数

<ParamField query="type" default="text" type="string">
  模型类型筛选。可选值：

  | 值               | 说明            |
  | --------------- | ------------- |
  | `text` 或 `chat` | 仅返回文字对话模型（默认） |
  | `image`         | 仅返回图片生成模型     |
  | `video`         | 仅返回视频生成模型     |
  | `audio`         | 仅返回音频模型       |
  | `all`           | 返回全部可用模型      |

  不传时默认只返回文字对话模型。**视频和音频等异步任务模型不会出现在默认结果中**，如需获取请使用 `type=all`。
</ParamField>

## 响应字段

<ResponseField name="success" type="boolean">
  请求是否成功。
</ResponseField>

<ResponseField name="object" type="string">
  列表对象类型，固定为 `list`。
</ResponseField>

<ResponseField name="data" type="object[]">
  模型列表。

  <Expandable title="data[n] 字段">
    <ResponseField name="id" type="string">
      模型 ID，在调用 Chat Completions、Responses 等接口时作为 `model` 参数传入。
    </ResponseField>

    <ResponseField name="object" type="string">
      对象类型，固定为 `model`。
    </ResponseField>

    <ResponseField name="created" type="integer">
      模型创建时间戳（Unix 时间戳）。部分自定义模型会返回平台默认时间戳。
    </ResponseField>

    <ResponseField name="owned_by" type="string">
      模型所属供应商或渠道名称。例如：`anthropic`、`openai`、`google`。
    </ResponseField>

    <ResponseField name="supported_endpoint_types" type="string[]">
      模型支持的接口类型列表。例如：`["chat_completions"]`、`["chat_completions", "responses"]`。
    </ResponseField>
  </Expandable>
</ResponseField>

## 代码示例

<CodeGroup>
  ```bash cURL（默认，仅文字模型） theme={null}
  curl --request GET \
    --url 'https://geekapis.com/v1/models' \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```bash cURL（获取全部类型） theme={null}
  curl --request GET \
    --url 'https://geekapis.com/v1/models?type=all' \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  # 获取所有文字模型
  response = requests.get("https://geekapis.com/v1/models", headers=headers)
  models = response.json()

  for model in models["data"]:
      print(f"{model['id']} — {model['owned_by']}")
      print(f"  支持接口: {', '.join(model['supported_endpoint_types'])}")
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://geekapis.com/v1/models", {
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  });

  const { data: models } = await response.json();
  for (const model of models) {
    console.log(`${model.id} — ${model.owned_by}`);
    console.log(`  支持接口: ${model.supported_endpoint_types.join(", ")}`);
  }
  ```
</CodeGroup>

## 响应示例

```json 200 - 成功响应 theme={null}
{
  "success": true,
  "object": "list",
  "data": [
    {
      "id": "claude-sonnet-4-6",
      "object": "model",
      "created": 1626777600,
      "owned_by": "anthropic",
      "supported_endpoint_types": ["chat_completions", "responses"]
    },
    {
      "id": "gpt-5",
      "object": "model",
      "created": 1626777600,
      "owned_by": "openai",
      "supported_endpoint_types": ["chat_completions"]
    },
    {
      "id": "gpt-5-pro-official",
      "object": "model",
      "created": 1626777600,
      "owned_by": "openai",
      "supported_endpoint_types": ["responses"]
    }
  ]
}
```

<Note>
  **关于 `supported_endpoint_types`**

  * 包含 `chat_completions` 的模型可通过 `POST /v1/chat/completions` 调用。
  * 包含 `responses` 的模型可通过 `POST /v1/responses` 调用。
  * **仅包含 `responses`** 的模型（Responses Only）不支持 Chat Completions 接口，必须使用 Responses API。

  完整模型说明及能力对比请参阅[模型一览](https://geekapis.com/pricing)。
</Note>

<Note>
  **过滤规则说明**

  * 若您的 API Key 配置了模型限制，列表中只会出现该令牌允许访问的模型。
  * 默认不返回图片、视频、音频等异步任务模型，如需获取请使用 `?type=all`。
</Note>
