curl --request POST \
--url https://api.tikway.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.6-sol",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Write a short bedtime story about a unicorn."
}
]
}
]
}
'"{\n \"background\": false,\n \"completed_at\": 1788668639,\n \"created_at\": 1788668638,\n \"error\": null,\n \"frequency_penalty\": 0,\n \"id\": \"resp_074472f9988a119f006a9ceade27888194add2283781e99db5::Q_Olg6GjTjN-VysDZS83LBWBO3NVTBTLcLGOvp0PrBP_XWO97d8Yq9ztZQZONcJzIV1Cug\",\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"metadata\": {},\n \"model\": \"gpt-5.6-sol\",\n \"object\": \"response\",\n \"output\": [\n {\n \"content\": [\n {\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"Hello! How can I help?\",\n \"type\": \"output_text\"\n }\n ],\n \"id\": \"msg_074472f9988a119f006a9ceadecd488194a8a5c2f9f4c1d83e\",\n \"phase\": \"final_answer\",\n \"role\": \"assistant\",\n \"status\": \"completed\",\n \"type\": \"message\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"presence_penalty\": 0,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": \"24h\",\n \"reasoning\": {\n \"context\": \"all_turns\",\n \"effort\": \"medium\",\n \"mode\": \"standard\",\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"status\": \"completed\",\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 0.98,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 7,\n \"input_tokens_details\": {\n \"cache_write_tokens\": 0,\n \"cached_read_tokens\": 0,\n \"cached_tokens\": 0,\n \"cached_write_tokens\": 0\n },\n \"output_tokens\": 11,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 18\n }\n}"Responses
curl --request POST \
--url https://api.tikway.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.6-sol",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Write a short bedtime story about a unicorn."
}
]
}
]
}
'"{\n \"background\": false,\n \"completed_at\": 1788668639,\n \"created_at\": 1788668638,\n \"error\": null,\n \"frequency_penalty\": 0,\n \"id\": \"resp_074472f9988a119f006a9ceade27888194add2283781e99db5::Q_Olg6GjTjN-VysDZS83LBWBO3NVTBTLcLGOvp0PrBP_XWO97d8Yq9ztZQZONcJzIV1Cug\",\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"metadata\": {},\n \"model\": \"gpt-5.6-sol\",\n \"object\": \"response\",\n \"output\": [\n {\n \"content\": [\n {\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"Hello! How can I help?\",\n \"type\": \"output_text\"\n }\n ],\n \"id\": \"msg_074472f9988a119f006a9ceadecd488194a8a5c2f9f4c1d83e\",\n \"phase\": \"final_answer\",\n \"role\": \"assistant\",\n \"status\": \"completed\",\n \"type\": \"message\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"presence_penalty\": 0,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": \"24h\",\n \"reasoning\": {\n \"context\": \"all_turns\",\n \"effort\": \"medium\",\n \"mode\": \"standard\",\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"status\": \"completed\",\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 0.98,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 7,\n \"input_tokens_details\": {\n \"cache_write_tokens\": 0,\n \"cached_read_tokens\": 0,\n \"cached_tokens\": 0,\n \"cached_write_tokens\": 0\n },\n \"output_tokens\": 11,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 18\n }\n}"授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
用于生成响应的模型 ID,例如 gpt-5.6-sol。
提供给模型的文本、图片、音频或文件输入。可直接为字符串,或为输入消息数组。
插入模型上下文的系统或开发者指令。使用 previous_response_id 时,前一响应的 instructions 不会自动继承。
上一条 Response 的唯一 ID,用于多轮对话;不能与 conversation 同时使用。
本次响应所属的会话。会话项会自动加入本次上下文,输入和输出项也会写入该会话。
是否在后台运行模型响应。
指定需要额外包含在响应中的数据。
web_search_call.action.sources, code_interpreter_call.outputs, computer_call_output.output.image_url, file_search_call.results, message.input_image.image_url, message.output_text.logprobs, reasoning.encrypted_content 生成响应允许使用的最大词元数,包含可见输出和推理词元。
x >= 1响应中可处理的内置工具调用总次数上限。
x >= 0是否允许模型并行调用工具。
用于提高相似请求缓存命中率的稳定键;取代 user 字段。
已弃用,请使用 prompt_cache_options.ttl。
in_memory, 24h 稳定的终端用户标识符,用于协助检测滥用;建议使用用户名或邮箱的哈希值。
64请求的服务层级。
auto, default, flex, scale, priority, fast, ultrafast 是否存储生成的 Response 以供后续通过 API 获取。
是否以 SSE 流式返回事件。
采样温度;通常与 top_p 二选一调整。
0 <= x <= 2核采样阈值;通常与 temperature 二选一调整。
0 <= x <= 1文本或结构化 JSON 输出配置。
Hide child attributes
Hide child attributes
文本输出详细程度。
low, medium, high 模型在生成响应时可调用的工具,包括 function、web_search、file_search、code_interpreter、computer、MCP 等。
Hide child attributes
Hide child attributes
工具类型。
函数或工具名称。
工具用途说明。
函数输入参数的 JSON Schema。
函数参数是否严格遵循 Schema。
函数输出的 JSON Schema。
file_search 使用的向量存储 ID 列表。
file_search 的筛选条件。
code_interpreter 容器配置。
MCP 服务器标签。
MCP 服务器 URL。
控制模型如何选择工具。
none, auto, required 每个输出位置最多返回的高概率词元数量。
0 <= x <= 20已弃用。输入超出上下文窗口时的截断策略。
auto, disabled 已弃用,请使用 safety_identifier 和 prompt_cache_key。
响应
Response 的唯一 ID。
对象类型,固定为 response。
response Response 创建时间的 Unix 时间戳,单位为秒。
实际使用的模型 ID。
模型生成的输出项列表,顺序和数量取决于模型响应。
Hide child attributes
Hide child attributes
输出项 ID。
输出项类型。
message, function_call, custom_tool_call, reasoning, web_search_call, file_search_call, code_interpreter_call, computer_call, image_generation_call 输出项状态。
message 输出项的角色。
assistant message 输出项的内容块。
Hide child attributes
Hide child attributes
内容块类型。
output_text, refusal, summary_text output_text 或 summary_text 的文本。
模型拒绝说明。
文本注释,例如文件引用或 URL 引用。
Hide child attributes
Hide child attributes
注释类型。
被引用文件的 ID。
被引用文件名。
被引用 URL。
引用标题。
引用起始字符位置。
引用结束字符位置。
函数或工具调用 ID。
被调用函数或自定义工具名称。
JSON 字符串形式的函数调用参数。
自定义工具调用输入。
加密的推理内容;需通过 include 请求。
推理摘要内容。
Response 完成时间的 Unix 时间戳;仅 status 为 completed 时出现。
响应生成状态。
completed, failed, in_progress, cancelled, queued, incomplete SDK 便捷字段:输出中所有文本内容的拼接结果。
应用于该响应的系统或开发者指令。
上一条 Response 的 ID。
词元使用统计。
Hide child attributes
Hide child attributes
输入词元数。
输出词元数。
总词元数。
是否允许并行工具调用。
本响应使用的采样温度。
本响应使用的核采样阈值。
请求设置的最大输出词元数。
请求设置的最大工具调用次数。
实际使用的服务层级。
是否后台运行。
是否存储该响应。
请求使用的安全标识符。