Chat
Create Response
创建一个 OpenAI Responses API 兼容请求。适用于使用 Responses API 的 OpenAI 兼容客户端,支持文本输入、指令和流式响应。
AuthorizationBearer <token>
使用 API Key 进行认证。在 Router One 控制台获取你的 API Key,格式为 sk-xxx。
In: header
modelstring
模型 ID。设为 auto 时由 Router One 自动选择。
inputstring|
instructions?string
可选系统指令。
stream?boolean
是否启用流式响应。
Default
falsetemperature?number
采样温度,范围 0-2。
Default
1Range
0 <= value <= 2max_output_tokens?integer
最大输出 token 数。
Range
1 <= valueResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.router.one/v1/responses" \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "input": "用一句话介绍 Router One" }'{
"id": "resp_abc123",
"object": "response",
"created_at": 1700000000,
"status": "completed",
"model": "gpt-4o",
"output_text": "Router One 是统一的 LLM API 网关。",
"output": [
{
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Router One 是统一的 LLM API 网关。"
}
]
}
],
"usage": {
"input_tokens": 12,
"output_tokens": 10,
"total_tokens": 22
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Insufficient balance",
"type": "billing_error",
"code": "insufficient_balance"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "string",
"type": "string",
"code": "string"
}
}