Authorization: Bearer ********************
{
"model": "gpt-4.1",
"input": "波士顿今天的天气如何?",
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "获取指定位置的当前天气",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市和州,例如 San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location",
"unit"
]
}
}
],
"tool_choice": "auto"
}
curl --location --request POST 'https://api2.aigcbest.top/v1/responses' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4.1",
"input": "波士顿今天的天气如何?",
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "获取指定位置的当前天气",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市和州,例如 San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location",
"unit"
]
}
}
],
"tool_choice": "auto"
}'
{
"id": "resp_0f3675c81213cac70068eee028ee58819791a17ac7f50b1ebc",
"object": "response",
"created_at": 1760485416,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4.1-data",
"output": [
{
"id": "fc_0f3675c81213cac70068eee0292ba081979b12de02ace3889f",
"type": "function_call",
"status": "completed",
"arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}",
"call_id": "call_ebE9bPEg0sVtsCqPOIItkpth",
"name": "get_current_weather"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"description": "获取指定位置的当前天气",
"name": "get_current_weather",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市和州,例如 San Francisco, CA"
},
"unit": {
"enum": [
"celsius",
"fahrenheit"
],
"type": "string"
}
},
"required": [
"location",
"unit"
],
"additionalProperties": false
},
"strict": true
}
],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 69,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 23,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 92
},
"user": null,
"metadata": {}
}