Authorization: Bearer ********************
gpt-4o
或 o3
。auto
、concise
或 detailed
。summary
。auto
、concise
或 detailed
。previous_response_id
一起使用时,之前响应中的指令不会被带入下一次响应。这使得在新响应中替换系统(或开发者)消息变得简单。{ "type": "json_schema" }
enables Structured Outputs,{ "type": "text" }
with no additional options.{ "type": "json_object" }
enables the older JSON mode, whichjson_schema
tool_choice
参数来指定使用哪个工具。tools
参数以了解如何指定模型可以调用的工具。none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one orrequired
means the model must call one or more tools.auto
:如果本次响应及之前的上下文超过了模型的上下文窗口大小,模型将通过丢弃对话中间的输入项来截断响应,以适应上下文窗口。disabled
(默认):如果模型响应将超过模型的上下文窗口大小,请求将以400错误失败。user
role.file_search_call.results
:包含文件搜索工具调用的搜索结果。message.input_image.image_url
:包含输入消息中的图片网址。computer_call_output.output.image_url
:包含计算机调用输出中的图片网址。top_p
,但不要同时调整两者。temperature
,但不要同时调整两者。service_tier
。{
"metadata": {
"property1": "string",
"property2": "string"
},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "string",
"model": "string",
"reasoning": {
"effort": "medium",
"summary": "auto",
"generate_summary": "auto"
},
"max_output_tokens": 0,
"instructions": "string",
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "file_search",
"vector_store_ids": [
"string"
],
"max_num_results": 0,
"ranking_options": {
"ranker": "auto",
"score_threshold": 0
},
"filters": {
"type": "eq",
"key": "string",
"value": "string"
}
}
],
"tool_choice": "none",
"truncation": "disabled",
"input": "string",
"include": [
"file_search_call.results"
],
"parallel_tool_calls": true,
"store": true,
"stream": false
}
curl --location --request POST 'https://api.uniapi.io/v1/responses' \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata": {
"property1": "string",
"property2": "string"
},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "string",
"model": "string",
"reasoning": {
"effort": "medium",
"summary": "auto",
"generate_summary": "auto"
},
"max_output_tokens": 0,
"instructions": "string",
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "file_search",
"vector_store_ids": [
"string"
],
"max_num_results": 0,
"ranking_options": {
"ranker": "auto",
"score_threshold": 0
},
"filters": {
"type": "eq",
"key": "string",
"value": "string"
}
}
],
"tool_choice": "none",
"truncation": "disabled",
"input": "string",
"include": [
"file_search_call.results"
],
"parallel_tool_calls": true,
"store": true,
"stream": false
}'
top_p
,但不要同时调整两者。temperature
,但不要同时调整两者。service_tier
。gpt-4o
或 o3
。auto
、concise
或 detailed
。summary
。auto
、concise
或 detailed
。previous_response_id
一起使用时,之前响应中的指令不会被带入下一次响应。这使得在新响应中替换系统(或开发者)消息变得简单。{ "type": "json_schema" }
enables Structured Outputs,{ "type": "text" }
with no additional options.{ "type": "json_object" }
enables the older JSON mode, whichjson_schema
tool_choice
参数来指定使用哪个工具。tools
参数以了解如何指定模型可以调用的工具。none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one orrequired
means the model must call one or more tools.auto
:如果本次响应及之前的上下文超过了模型的上下文窗口大小,模型将通过丢弃对话中间的输入项来截断响应,以适应上下文窗口。disabled
(默认):如果模型响应将超过模型的上下文窗口大小,请求将以400错误失败。response
。completed
(已完成)、failed
(失败)、in_progress
(进行中)或 incomplete
(未完成)之一。output
数组中项目的长度和顺序取决于模型的响应。output
数组中的第一个项目并假设它是模型生成内容的 assistant
消息,不如在支持的 SDK 中考虑使用 output_text
属性。output
数组中所有 output_text
项的聚合文本输出(如果存在)。{
"metadata": {
"property1": "string",
"property2": "string"
},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "string",
"model": "string",
"reasoning": {
"effort": "medium",
"summary": "auto",
"generate_summary": "auto"
},
"max_output_tokens": 0,
"instructions": "string",
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "file_search",
"vector_store_ids": [
"string"
],
"max_num_results": 0,
"ranking_options": {
"ranker": "auto",
"score_threshold": 0
},
"filters": {
"type": "eq",
"key": "string",
"value": "string"
}
}
],
"tool_choice": "none",
"truncation": "disabled",
"id": "string",
"object": "response",
"status": "completed",
"created_at": 0,
"error": {
"code": "server_error",
"message": "string"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"output": [
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "string",
"annotations": [
{
"type": "file_citation",
"file_id": "string",
"index": 0
}
]
}
],
"status": "in_progress"
}
],
"output_text": "string",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"parallel_tool_calls": true
}