> For clean Markdown of any page, append `.md` to the page URL.
> Documentation index: https://you.com/docs/llms.txt (section indexes: append `/llms.txt` to any section URL).
> Search these docs: Docs MCP at https://you.com/docs/_mcp/server (`searchDocs`, no API key).
> Call live You.com APIs: Product MCP at https://api.you.com/mcp (keyless `?profile=free` exposes `you-search` and `you-discover`. Research and finance use `/mcp/research`, `/mcp/finance`, or `?tools=` on `/mcp`). To pick an API or integration path, call `you-discover` on that server instead of guessing.
> OpenAPI: https://you.com/docs/openapi.json—auth header `X-API-Key`, env `YDC_API_KEY`.

# Inference Router Tool Calling

## Declare a Function Tool

Declare function tools as you would for the OpenAI Chat Completions or Anthropic Messages API. The router passes them to the model. When the model calls one, the response has `finish_reason: "tool_calls"` and the calls in `message.tool_calls`.

```bash
curl https://api.you.com/v1/chat/completions \
  -H "Authorization: Bearer $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3",
    "messages": [{"role": "user", "content": "What is the weather in Paris?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get the weather for a city.",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }]
  }'
```

Run the function yourself, then send its result back in a message with `role: "tool"` and the `tool_call_id` of the call. The model then answers.

Whether a model honors `tool_choice` is up to the model's vendor.

---

## Combine With Web Tools

A request can declare function tools and [web tools](/docs/guides/inference-router/web-tools) together. The router runs a turn that calls only web tools and continues. A turn that calls one of your function tools comes back to you with the tool calls, and the router does not run web tools in that turn. When a request declares both kinds, `parallel_tool_calls` defaults to `true` unless you set it.