This mirrors the Cookbook’s multi-tool flow. The model returns a function_call, you execute it locally, then send a function_call_result. Repeat for subsequent tool calls.

1) Initial request (expose multiple tools)

curl -X POST "https://api.incredible.one/v1/chat-completion" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $INCREDIBLE_API_KEY" \
  -d '{
    "model": "small-1",
    "stream": false,
    "messages": [{"role": "user", "content": "What's the weather in Tokyo right now?"}],
    "functions": [
      {
        "name": "get_weather_info",
        "description": "Get current weather information for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      },
      {
        "name": "get_current_time",
        "description": "Get the current time in a specified timezone",
        "parameters": {
          "type": "object",
          "properties": {"timezone": {"type": "string", "enum": ["UTC", "EST", "PST", "JST", "GMT"]}},
          "required": []
        }
      }
    ]
  }'
The response will include a type: "function_call" for the chosen tool.

2) Send the result back (repeat per tool)

curl -X POST "https://api.incredible.one/v1/chat-completion" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $INCREDIBLE_API_KEY" \
  -d '{
    "model": "small-1",
    "stream": false,
    "messages": [
      {"role": "user", "content": "What's the weather in Tokyo right now?"},
      {"type": "function_call", "function_call_id": "CALL_ID_FROM_STEP_1", "function_calls": [{
        "name": "get_weather_info", "input": {"city": "Tokyo"}
      }]},
      {"type": "function_call_result", "function_call_id": "CALL_ID_FROM_STEP_1", "function_call_results": ["Rainy, 68°F, Humidity: 90%"]}
    ],
    "functions": [
      {"name": "get_weather_info", "description": "Get current weather information for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}},
      {"name": "get_current_time", "description": "Get the current time in a specified timezone", "parameters": {"type": "object", "properties": {"timezone": {"type": "string", "enum": ["UTC", "EST", "PST", "JST", "GMT"]}}, "required": []}}
    ]
  }'
View source on GitHub → 2_multiple_tools.py