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

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Advisor Server Tool

> Let one model consult another model mid-generation.

Use `phaseo:advisor` when the main model should be able to ask another model for a review, plan, sanity check, or specialist opinion before it finishes.

The main model calls Advisor like any other tool. Phaseo runs the Advisor model server-side and returns the advice as the tool result. The main model then writes the final response.

> [!NOTE]
>
> Advisor is gateway-managed across supported text models. It is not converted into Anthropic's native Advisor tool unless the client explicitly sends Anthropic's native tool shape.

## Quick start

```bash theme={null}
curl https://api.phaseo.app/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [
      { "role": "user", "content": "Design a rate limiter for a distributed API gateway." }
    ],
    "tools": [
      {
        "type": "phaseo:advisor",
        "parameters": {
          "model": "anthropic/claude-opus-5",
          "max_uses": 1,
          "max_completion_tokens": 1400
        }
      }
    ]
  }'
```

## Choosing the Advisor model

You can pin the Advisor model in the tool definition:

```json theme={null}
{
  "type": "phaseo:advisor",
  "parameters": {
    "model": "anthropic/claude-opus-5"
  }
}
```

If `parameters.model` is omitted, the tool call may provide `model`. If neither is set, Phaseo falls back to the outer request model.

## Parameters

```json theme={null}
{
  "type": "phaseo:advisor",
  "parameters": {
    "name": "reviewer",
    "model": "anthropic/claude-opus-5",
    "instructions": "Review plans for correctness, missing edge cases, and implementation risk.",
    "forward_transcript": true,
    "max_uses": 2,
    "max_completion_tokens": 1400,
    "reasoning": { "effort": "high" },
    "temperature": 0.2
  }
}
```

| Parameter | Type | Default | Description |
| - | - | - | - |
| `name` | string | none | Optional Advisor name. Names must be unique after trimming and may contain letters, numbers, spaces, underscores, and dashes. |
| `model` | string | outer model | Advisor model to call. If omitted, the tool call can provide `model`. |
| `instructions` | string | default Advisor behavior | Extra instructions for the Advisor model. |
| `forward_transcript` | boolean | `false` | Include the current conversation transcript in the Advisor request. |
| `max_uses` | integer | `1` | Maximum calls for this Advisor during the server-tool loop. |
| `max_completion_tokens` | integer | `1400` | Max output tokens for the Advisor response. |
| `max_tokens` | integer | `1400` | Legacy alias for `max_completion_tokens`. |
| `reasoning` | object | provider default | Reasoning config forwarded to the Advisor call when supported by the selected model/provider. |
| `temperature` | number | provider default | Sampling temperature for the Advisor call. |

## Tool-call arguments

The model normally calls Advisor with a `prompt`:

```json theme={null}
{
  "prompt": "Review this migration plan and identify the riskiest assumptions."
}
```

If the Advisor definition does not pin a model, the tool call may also include `model`:

```json theme={null}
{
  "model": "anthropic/claude-opus-5",
  "prompt": "Check this security design for missing controls."
}
```

When `forward_transcript` is `true`, Phaseo can execute a transcript-only Advisor call if the model does not supply a prompt.

## Multiple advisors

Add one `phaseo:advisor` entry per advisor. Each named advisor becomes a distinct internal tool, such as `phaseo_advisor_security_reviewer` or `phaseo_advisor_architect`.

```json theme={null}
{
  "tools": [
    {
      "type": "phaseo:advisor",
      "parameters": {
        "name": "security-reviewer",
        "model": "anthropic/claude-opus-5",
        "instructions": "Review for vulnerabilities, abuse cases, and missing mitigations."
      }
    },
    {
      "type": "phaseo:advisor",
      "parameters": {
        "name": "architect",
        "model": "openai/gpt-5",
        "instructions": "Review system design tradeoffs and operational risks."
      }
    }
  ]
}
```

At most one Advisor entry may omit `name`. If you force `tool_choice: "phaseo:advisor"` with multiple advisors, Phaseo maps that alias to the first configured Advisor.

## What the tool returns

Advisor returns JSON as the tool result:

```json theme={null}
{
  "status": "ok",
  "name": "reviewer",
  "model": "anthropic/claude-opus-5",
  "advice": "Start with a smaller migration slice and define rollback criteria before changing traffic routing."
}
```

If the Advisor request cannot run, Phaseo returns a tool error such as `advisor_invalid_request`, `advisor_max_uses_exceeded`, or `advisor_request_failed`.

## Conversation memory

Advisor does not keep hidden cross-request state. If you replay prior messages and tool results in the next request, the main model can see the prior consultation. If `forward_transcript` is enabled, the Advisor can also see the forwarded conversation transcript for that request.

## Usage and pricing

Advisor calls increment:

```json theme={null}
{
  "usage": {
    "server_tool_use": {
      "advisor_requests": 1
    }
  }
}
```

The Advisor model's tokens are included in total usage and can be priced at the selected Advisor model's rates. Server-tool pricing can also use `server_tool_advisor_requests`.

## Current limits

* Advisor advice streaming is not enabled yet.
* Advisor calls do not expose additional tools to the consulted model.

## Related

* [Server Tools](https://phaseo.app/docs/v1/guides/server-tools/index.md)
* [Subagent](https://phaseo.app/docs/v1/guides/server-tools/subagent.md)
* [Tool Calling](https://phaseo.app/docs/v1/guides/tool-calling.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.