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

# Advisor server tool

> Let a model consult a configured secondary model for advice during a response.

The `orq:advisor` tool lets the primary model ask another model for advice during a response. The advisor receives the conversation transcript, the model's question, and optional context. Its answer goes back to the primary model, which writes the final response.

Advisor is useful at a decision point or before the primary model commits to a high-cost action. It is not a separate user-facing answer.

## Quick start

The examples use the client configuration from the [Server tools overview](/docs/ai-gateway/features/server-tools).

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/chat/completions \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-5.4-mini",
      "messages": [
        { "role": "user", "content": "Review this migration plan and identify the highest-risk assumption." }
      ],
      "tools": [
        {
          "type": "orq:advisor",
          "model": "anthropic/claude-sonnet-5",
          "max_transcript_tokens": 8000,
          "max_uses": 1
        }
      ]
    }'
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await client.chat.completions.create({
    model: 'openai/gpt-5.4-mini',
    messages: [
      {
        role: 'user',
        content:
          'Review this migration plan and identify the highest-risk assumption.',
      },
    ],
    tools: [
      {
        type: 'orq:advisor',
        model: 'anthropic/claude-sonnet-5',
        max_transcript_tokens: 8000,
        max_uses: 1,
      },
    ] as any,
  });

  console.log(response.choices[0].message.content);
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  response = client.chat.completions.create(
      model="openai/gpt-5.4-mini",
      messages=[
          {
              "role": "user",
              "content": "Review this migration plan and identify the highest-risk assumption.",
          }
      ],
      tools=[
          {
              "type": "orq:advisor",
              "model": "anthropic/claude-sonnet-5",
              "max_transcript_tokens": 8000,
              "max_uses": 1,
          }
      ],
  )

  print(response.choices[0].message.content)
  ```
</CodeGroup>

## Configuration

| Parameter               | Type    | Required | Default          | Description                                                                                               |
| ----------------------- | ------- | -------- | ---------------- | --------------------------------------------------------------------------------------------------------- |
| `type`                  | string  | Yes      |                  | Must be `orq:advisor`.                                                                                    |
| `model`                 | string  | Yes      |                  | Advisor model in `provider/model` format.                                                                 |
| `max_tokens`            | integer | No       | Provider default | Maximum advisor output tokens. Accepted range: 0 to 128,000. `0` uses the provider default.               |
| `max_transcript_tokens` | integer | No       | Full transcript  | Approximate transcript budget. The newest user turn is always retained. `0` includes the full transcript. |
| `reasoning_effort`      | string  | No       | Provider default | `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`, when supported by the advisor model.       |
| `temperature`           | number  | No       | Provider default | Advisor sampling temperature from 0 to 2. The selected model may impose a lower maximum.                  |
| `max_uses`              | integer | No       | Unlimited        | Maximum consultations during the request. Set `0` or omit the field for no tool-specific limit.           |

Transcript size is estimated from the serialized conversation. When a limit is set, the **AI Gateway** keeps the newest complete user turns that fit.

## Cost and usage

Advisor tokens are billed at the selected model's standard rate. Each Advisor call appears at `usage.server_tool_use.advisor_requests`.
