> ## 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.

# Responses格式

> OpenAI Responses API，用于创建模型响应。支持多轮对话、工具调用、推理等功能。

## 请求头

**Authorization** `string` *required*

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

## 请求体

格式：`application/json`

**model** `string` *required*

模型 ID

**input** `string | object[]`

输入内容，可以是字符串或消息数组

**instructions** `string`

系统指令

**max\_output\_tokens** `integer`

最大输出 Token 数

**temperature** `number`

采样温度

**top\_p** `number`

核采样参数

**stream** `boolean`

是否流式响应

**tools** `object[]`

工具列表

**tool\_choice** `string | object`

工具选择策略

**reasoning** `object`

推理参数

**previous\_response\_id** `string`

前一轮响应 ID，用于多轮对话

**truncation** `string`

截断策略，可选值为 `"auto"` 或 `"disabled"`

## 响应

### 200 成功创建响应

格式：`application/json`

**id** `string`

响应 ID

**object** `string`

对象类型，值为 `response`

**created\_at** `integer`

创建时间戳

**status** `string`

状态，可选值：`completed`、`failed`、`in_progress`、`incomplete`

**model** `string`

模型 ID

**output** `object[]`

输出内容列表

**属性**

**type** `string`

输出类型

**id** `string`

输出项 ID

**status** `string`

输出项状态

**role** `string`

角色

**content** `array[object]`

内容列表

**属性**

**type** `string`

内容类型

**text** `string`

文本内容

**usage** `object`

Token 用量信息

**属性**

**prompt\_tokens** `integer`

提示 Token 数

**completion\_tokens** `integer`

补全 Token 数

**total\_tokens** `integer`

总 Token 数

**prompt\_tokens\_details** `object`

提示 Token 明细

**属性**

**cached\_tokens** `integer`

缓存 Token 数

**text\_tokens** `integer`

文本 Token 数

**audio\_tokens** `integer`

音频 Token 数

**image\_tokens** `integer`

图像 Token 数

**completion\_tokens\_details** `object`

补全 Token 明细

**属性**

**text\_tokens** `integer`

文本 Token 数

**audio\_tokens** `integer`

音频 Token 数

**reasoning\_tokens** `integer`

推理 Token 数

```bash cURL theme={"dark"}
curl -X POST "https://t.ato2.nodesms.com/v1/responses" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "string"
  }'
```

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

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

response = client.responses.create(
    model="string"
)
print(response.output)
```

```json 200 theme={"dark"}
{
  "id": "string",
  "object": "response",
  "created_at": 0,
  "status": "completed",
  "model": "string",
  "output": [
    {
      "type": "string",
      "id": "string",
      "status": "string",
      "role": "string",
      "content": [
        {
          "type": "string",
          "text": "string"
        }
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "text_tokens": 0,
      "audio_tokens": 0,
      "image_tokens": 0
    },
    "completion_tokens_details": {
      "text_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0
    }
  }
}
```


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