curl -X POST https://www.anyfast.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": "Get the current system time and calculate 123.5 + 456.7"
}
],
"tool_choice": "auto",
"tools": [
{
"type": "function",
"name": "get_time",
"description": "Get the current system time",
"parameters": {
"type": "object",
"properties": {}
}
},
{
"type": "function",
"name": "calculate",
"description": "Calculate a math expression",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "The math expression to calculate"
}
},
"required": ["expression"]
}
}
]
}'
{
"id": "resp_68ac1558e9488190bcc2cbb94c7d7a140b8064b15a091a77",
"object": "response",
"created_at": 1756108120,
"status": "completed",
"model": "gpt-4.1-data",
"output": [
{
"id": "fc_68ac15594be88190a58217f75a6a54cc0b8064b15a091a77",
"type": "function_call",
"status": "completed",
"arguments": "{\"sign\":\"Aquarius\"}",
"call_id": "call_6kbB2GTk62PPUNdGuBJPx9KQ",
"name": "get_horoscope"
}
],
"parallel_tool_calls": true,
"usage": {
"input_tokens": 62,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 18,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 80
}
}
Use function calling with the Responses API
curl -X POST https://www.anyfast.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": "Get the current system time and calculate 123.5 + 456.7"
}
],
"tool_choice": "auto",
"tools": [
{
"type": "function",
"name": "get_time",
"description": "Get the current system time",
"parameters": {
"type": "object",
"properties": {}
}
},
{
"type": "function",
"name": "calculate",
"description": "Calculate a math expression",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "The math expression to calculate"
}
},
"required": ["expression"]
}
}
]
}'
{
"id": "resp_68ac1558e9488190bcc2cbb94c7d7a140b8064b15a091a77",
"object": "response",
"created_at": 1756108120,
"status": "completed",
"model": "gpt-4.1-data",
"output": [
{
"id": "fc_68ac15594be88190a58217f75a6a54cc0b8064b15a091a77",
"type": "function_call",
"status": "completed",
"arguments": "{\"sign\":\"Aquarius\"}",
"call_id": "call_6kbB2GTk62PPUNdGuBJPx9KQ",
"name": "get_horoscope"
}
],
"parallel_tool_calls": true,
"usage": {
"input_tokens": 62,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 18,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 80
}
}
gpt-4.1type (string): Tool type, e.g. "function"name (string): Function namedescription (string): Function descriptionparameters (object): JSON Schema for function parametersauto, none, requiredcurl -X POST https://www.anyfast.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": "Get the current system time and calculate 123.5 + 456.7"
}
],
"tool_choice": "auto",
"tools": [
{
"type": "function",
"name": "get_time",
"description": "Get the current system time",
"parameters": {
"type": "object",
"properties": {}
}
},
{
"type": "function",
"name": "calculate",
"description": "Calculate a math expression",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "The math expression to calculate"
}
},
"required": ["expression"]
}
}
]
}'
{
"id": "resp_68ac1558e9488190bcc2cbb94c7d7a140b8064b15a091a77",
"object": "response",
"created_at": 1756108120,
"status": "completed",
"model": "gpt-4.1-data",
"output": [
{
"id": "fc_68ac15594be88190a58217f75a6a54cc0b8064b15a091a77",
"type": "function_call",
"status": "completed",
"arguments": "{\"sign\":\"Aquarius\"}",
"call_id": "call_6kbB2GTk62PPUNdGuBJPx9KQ",
"name": "get_horoscope"
}
],
"parallel_tool_calls": true,
"usage": {
"input_tokens": 62,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 18,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 80
}
}