curl --location --request POST 'https://geekai.co/api/v1/responses' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-6.1-sol",
"input": "What is the weather like in Hangzhou today?",
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. Hangzhou, Zhejiang"
},
"unit": {
"type": "string",
"enum": ["℃", "℉"]
}
},
"required": ["location", "unit"]
}
}
],
"tool_choice": "auto"
}'
Response API
Function Calling
Function calling works much like it does with Chat Completions. This Responses API example looks up the local weather:
Was this page helpful?
