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

# GET /v1/models

> OpenAI 兼容的模型列表接口，返回当前 API Key 可用的所有模型及其支持的 API 格式。

`/v1/models` 是 OpenAI 兼容的模型列表接口，返回当前令牌可用的所有模型。SDK 和客户端可使用此接口自动发现可用模型及其支持的 API 格式。

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.com.cn/v1/models \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://www.anyfast.com.cn/v1"
  )

  models = client.models.list()
  for model in models:
      print(f"{model.id} → {model.owned_by}")
  ```
</CodeGroup>

## 请求

| 请求头                               | 必填 | 说明             |
| --------------------------------- | -- | -------------- |
| `Authorization: Bearer <api-key>` | 是  | 使用 API Key 鉴权。 |
| `Content-Type: application/json`  | 否  | 可选。            |

请求方法为 `GET`，无请求体。

## 返回体

```json theme={null}
{
  "data": [
    {
      "id": "doubao-seed-2-0-pro-260215",
      "object": "model",
      "created": 1626777600,
      "owned_by": "volcengine",
      "supported_endpoint_types": ["openai"]
    },
    {
      "id": "doubao-seedance-2-0-260128",
      "object": "model",
      "created": 1626777600,
      "owned_by": "volcengine",
      "supported_endpoint_types": ["video"]
    }
  ]
}
```

## 返回字段

| 字段                         | 说明                                                                                                    |
| -------------------------- | ----------------------------------------------------------------------------------------------------- |
| `id`                       | 模型标识。调用模型接口时，将此值传入 `model` 参数。                                                                        |
| `object`                   | 固定为 `"model"`。                                                                                        |
| `created`                  | 固定时间戳，无实际业务含义。                                                                                        |
| `owned_by`                 | 模型提供方标识。                                                                                              |
| `supported_endpoint_types` | 该模型支持的 API 格式，例如 `openai`、`anthropic`、`openai-response`、`gemini`、`image-generation`、`video`、`mj-*` 等。 |

## 说明

* 不同 API Key 返回的模型列表可能不同，具体取决于账户配置和可用的模型范围。
* 未提供 API Key 时，接口会返回认证失败响应，例如 `401 {"error":{"message":"未提供令牌"}}`。

<script src="/feedback.js" />
