> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Calling

> Production-verified tool calling with the latest GPT, Claude, and Gemini models

> Дата обновления: 2026-06-06

# Tool Calling

This page only documents Tool Calling flows that were **verified with real requests against Crazyrouter production**.

Verification date:

* `2026-03-22`

Verified models:

* `gpt-5.5`
* `claude-opus-4-8`
* `gemini-3.1-pro`

## Verified matrix

| Model             | Protocol                | Endpoint                                      | Success marker           |
| ----------------- | ----------------------- | --------------------------------------------- | ------------------------ |
| `gpt-5.5`         | OpenAI Chat Completions | `POST /v1/chat/completions`                   | Returns `tool_calls`     |
| `claude-opus-4-8` | Anthropic Messages      | `POST /v1/messages`                           | Returns `tool_use` block |
| `gemini-3.1-pro`  | Gemini Native           | `POST /v1beta/models/{model}:generateContent` | Returns `functionCall`   |

## GPT-5.4

```bash theme={null}
curl https://api.crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {
        "role": "user",
        "content": "Use the get_time tool for Asia/Shanghai. Do not answer without calling the tool."
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_time",
          "description": "Get the current time for a timezone",
          "parameters": {
            "type": "object",
            "properties": {
              "timezone": { "type": "string" }
            },
            "required": ["timezone"],
            "additionalProperties": false
          }
        }
      }
    ],
    "tool_choice": "required"
  }'
```

Verified response shape:

```json theme={null}
{
  "tool_calls": [
    {
      "type": "function",
      "function": {
        "name": "get_time"
      }
    }
  ]
}
```

## Claude Sonnet 4.6

```bash theme={null}
curl https://api.crazyrouter.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 256,
    "tools": [
      {
        "name": "get_time",
        "description": "Get the current time for a timezone",
        "input_schema": {
          "type": "object",
          "properties": {
            "timezone": { "type": "string" }
          },
          "required": ["timezone"]
        }
      }
    ],
    "tool_choice": {
      "type": "any"
    },
    "messages": [
      {
        "role": "user",
        "content": "Use the get_time tool for Asia/Shanghai. Do not answer directly."
      }
    ]
  }'
```

Verified response shape:

```json theme={null}
{
  "stop_reason": "tool_use",
  "content": [
    {
      "type": "tool_use",
      "name": "get_time"
    }
  ]
}
```

For first-pass validation, use an explicit `tool_choice` and clearly instruct Claude not to answer directly.

## Gemini 3 Pro

```bash theme={null}
curl "https://api.crazyrouter.com/v1beta/models/gemini-3.1-pro:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Use the get_time function for Asia/Shanghai."
          }
        ]
      }
    ],
    "tools": [
      {
        "functionDeclarations": [
          {
            "name": "get_time",
            "description": "Get the current time for a timezone",
            "parameters": {
              "type": "object",
              "properties": {
                "timezone": { "type": "string" }
              },
              "required": ["timezone"]
            }
          }
        ]
      }
    ]
  }'
```

Verified response shape:

```json theme={null}
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "functionCall": {
              "name": "get_time"
            }
          }
        ]
      }
    }
  ]
}
```

## See Also

* [OpenAI Function Calling](/ru/chat/openai/function-calling)
* [Responses Function Calling](/ru/chat/responses/function-calling)
* [Gemini Tools](/ru/chat/gemini/tools)
* [Claude Native Messages](/ru/chat/anthropic/messages)
