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

# Routing

> Standard routing, fallback chains, and privacy-class routing.

## Standard mode

The MESH router picks an upstream based on the requested model (or router mode), provider health,
and the requested privacy class. By default, every call is served at `standard_route` privacy
unless you ask for a stronger class.

## Fallback chains

Pass `route: "fallback"` with a primary `model` and ordered backup `models` list. MESH returns
the selected model and full chain in the response `routing` field.

```json theme={null}
{
  "model": "mesh/claude-sonnet-4.5",
  "models": ["mesh/claude-opus-4.5", "mesh/llama-4-maverick"],
  "route": "fallback",
  "messages": [{ "role": "user", "content": "Summarize this document." }]
}
```

Fallback candidates are filtered to the privacy class actually being served — the router will
never silently downgrade your class when a candidate can't earn it. If no candidate can serve
the requested class, the call returns `privacy_class_unavailable_for_model`.

## Privacy classes

Pick the upstream privacy guarantee per call. See [MESH privacy classes](/privacy/mesh) for the
full taxonomy.

```json theme={null}
{
  "model": "auto",
  "privacy": {
    "class": "protected_provider_route"
  },
  "messages": [{ "role": "user", "content": "sensitive prompt" }]
}
```

Four classes are available: `standard_route`, `protected_provider_route`, `private_gateway_route`,
`confidential_runtime_route`. The legacy `mode: "standard"` and `mode: "mesh"` aliases continue
to work and map to `standard_route` and `private_gateway_route` respectively.

To let the router pick the strongest class the requested model supports:

```json theme={null}
{ "privacy": { "bestAvailable": true } }
```

To allow a downgrade if the model can't earn the requested class:

```json theme={null}
{
  "privacy": {
    "class": "protected_provider_route",
    "allowFallbackToLowerClass": true
  }
}
```

The actual class served is always in the response `privacy.class` field.
