# lg_routing_preview: Explain a request's routing

Preview how a request would be routed, without sending it: providers considered, why, the order and the estimated cost.

- **Changes data:** yes
- **Credential scope:** `gateway:read` (an API key's scopes, or what you allowed when connecting with OAuth)
- **Assistant level:** any connected assistant (Read only and up)

## Inputs

| Field | Type | Required | Notes |
|---|---|---|---|
| `body` | object (format, request) | yes |  |
| `body.format` | "openai-chat" \\| "anthropic-messages" | no |  |
| `body.request` | object | yes |  |

## Example MCP call

A `tools/call` request to `https://manage.restolayer.com/mcp`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_routing_preview",
    "arguments": {
      "body": {
        "format": "openai-chat",
        "request": {
          "model": "anthropic/claude-sonnet-5-5",
          "messages": [
            {
              "role": "user",
              "content": "Hi"
            }
          ]
        }
      }
    }
  }
}
```

## Example REST call

The same thing over REST (`POST /v1/routing/preview`):

```bash
curl -s -X POST "https://manage.restolayer.com/v1/routing/preview" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"openai-chat","request":{"model":"anthropic/claude-sonnet-5-5","messages":[{"role":"user","content":"Hi"}]}}'
```

All tools: [MCP tools](https://www.restolayer.com/docs/mcp/tools). Connecting: [connect your assistant](https://www.restolayer.com/docs/connect).
