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

# 模型列表

> 获取当前可用的模型列表。原生 OpenAI 格式。

根据请求头自动识别返回格式：

* 包含 `x-api-key` 和 `anthropic-version` 头时返回 Anthropic 格式
* 包含 `x-goog-api-key` 头或 `key` 查询参数时返回 Gemini 格式
* 其他情况返回 OpenAI 格式

## 请求头

**Authorization** `string` *required*

使用 Bearer Token 认证。格式：`Authorization: Bearer sk-xxxxxx`

**x-api-key** `string`

Anthropic API Key（用于 Claude 格式）

**anthropic-version** `string`

Anthropic API 版本

**x-goog-api-key** `string`

Google API Key（用于 Gemini 格式）

## 查询参数

**key** `string`

Google API Key（用于 Gemini 格式）

## 响应

### 200 成功获取模型列表

格式：`application/json`

**object** `string`

对象类型

**data** `object[]`

模型列表

**属性**

**id** `string`

模型 ID

**object** `string`

对象类型

**created** `integer`

创建时间戳

**owned\_by** `string`

模型所有者

### 401 认证失败

格式：`application/json`

**error** `object`

错误信息

**属性**

**message** `string`

错误信息

**type** `string`

错误类型

**param** `string | null`

相关参数

**code** `string | null`

错误代码

```bash cURL theme={"dark"}
curl -X GET "https://t.ato2.nodesms.com/v1/models" \
  -H "Authorization: Bearer $API_KEY"
```

```python Python theme={"dark"}
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxx",
    base_url="https://t.ato2.nodesms.com/v1"
)

models = client.models.list()
print(models)
```

```json 200 theme={"dark"}
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "object": "model",
      "created": 0,
      "owned_by": "string"
    }
  ]
}
```

```json 401 theme={"dark"}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": null,
    "code": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.