Skip to main content
POST
/
v1
/
responses
创建响应 (OpenAI Responses API)
curl --request POST \
  --url https://api.tkhub.ai/v1/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>",
  "instructions": "<string>",
  "max_output_tokens": 123,
  "temperature": 123,
  "top_p": 123,
  "stream": true,
  "tools": [
    {}
  ],
  "tool_choice": "<string>",
  "reasoning": {
    "effort": "low",
    "summary": "<string>"
  },
  "previous_response_id": "<string>",
  "truncation": "auto"
}
'
{
  "id": "<string>",
  "object": "response",
  "created_at": 123,
  "status": "completed",
  "model": "<string>",
  "output": [
    {
      "type": "<string>",
      "id": "<string>",
      "status": "<string>",
      "role": "<string>",
      "content": [
        {
          "type": "<string>",
          "text": "<string>"
        }
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "text_tokens": 123,
      "audio_tokens": 123,
      "image_tokens": 123
    },
    "completion_tokens_details": {
      "text_tokens": 123,
      "audio_tokens": 123,
      "reasoning_tokens": 123
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
model
string
required
input

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

instructions
string
max_output_tokens
integer
temperature
number
top_p
number
stream
boolean
tools
object[]
tool_choice
reasoning
object
previous_response_id
string
truncation
enum<string>
Available options:
auto,
disabled

Response

200 - application/json

成功创建响应

id
string
object
string
Example:

"response"

created_at
integer
status
enum<string>
Available options:
completed,
failed,
in_progress,
incomplete
model
string
output
object[]
usage
object