curl -X POST "https://t.ato2.nodesms.com/v1/responses" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string"
}'
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)
{
"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
}
}
}
Responses格式
OpenAI Responses API,用于创建模型响应。支持多轮对话、工具调用、推理等功能。
POST
/
v1
/
responses
curl -X POST "https://t.ato2.nodesms.com/v1/responses" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string"
}'
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)
{
"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
}
}
}
请求头
string
必填
使用 Bearer Token 认证。格式:
Authorization: Bearer sk-xxxxxx请求体
格式:application/json
string
必填
模型 ID
string | object[]
输入内容,可以是字符串或消息数组
string
系统指令
integer
最大输出 Token 数
number
采样温度
number
核采样参数
boolean
是否流式响应
object[]
工具列表
string | object
工具选择策略
object
推理参数
string
前一轮响应 ID,用于多轮对话
string
截断策略,可选值为
"auto" 或 "disabled"响应
200 成功创建响应
格式:application/json
string
响应 ID
string
对象类型,值为
responseinteger
创建时间戳
string
状态,可选值:
completed、failed、in_progress、incompletestring
模型 ID
object[]
object
curl -X POST "https://t.ato2.nodesms.com/v1/responses" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string"
}'
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)
{
"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
}
}
}
最后修改于 2026年10月28日
此页面对您有帮助吗?