# 获取模型列表

返回当前 API Key 可以使用的模型列表。

- 原文: https://www.unifyllm.com/zh/docs/api-reference/list-models/
- 语言: zh-CN

## 接口

```http
GET https://api.unifyllm.top/v1/models
```

认证与请求头以本页调用示例为准。 Content-Type: application/json

## 参数

| 参数 | 位置 | 类型 | 必填 | 说明 | 可选值 | 示例 |
| --- | --- | --- | --- | --- | --- | --- |

## 示例 1

```json
{}
```

### cURL

```bash
curl --request GET \
  --url 'https://api.unifyllm.top/v1/models' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
```

### JavaScript

```javascript
const response = await fetch("https://api.unifyllm.top/v1/models", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>"
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.get(
    "https://api.unifyllm.top/v1/models",
    headers={"Authorization": "Bearer <YOUR_API_KEY>"}
)
response.raise_for_status()
print(response.json())
```

## 示例 2

```json
{}
```

### cURL

```bash
curl --request GET \
  --url 'https://api.unifyllm.top/v1/models' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
```

### JavaScript

```javascript
const response = await fetch("https://api.unifyllm.top/v1/models", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>"
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.get(
    "https://api.unifyllm.top/v1/models",
    headers={"Authorization": "Bearer <YOUR_API_KEY>"}
)
response.raise_for_status()
print(response.json())
```

## 响应示例

### 示例 1 — HTTP 200

```json
{
  "data": [
    {
      "id": "az/claude-sonnet-4-20250514",
      "object": "model",
      "created": 1626777600,
      "owned_by": "custom",
      "supported_endpoint_types": [
        "anthropic",
        "openai"
      ]
    },
    {
      "id": "az/claude-sonnet-4-20250514-thinking",
      "object": "model",
      "created": 1626777600,
      "owned_by": "custom",
      "supported_endpoint_types": [
        "anthropic",
        "openai"
      ]
    }
  ],
  "object": "list",
  "success": true
}
```
