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

# Routing Overview

> Choose the model, the provider behind it, and what happens when a request cannot be served

Every chat, Messages, and Responses request is routed in three layers. Each layer is optional and they combine freely.

| Layer | Decides | Set it with | Page |
| - | - | - | - |
| Model selection | Which model answers | `model: "auto"` | [Auto Router](https://docs.electronhub.ai/routing/auto-router.md) |
| Provider selection | Which provider serves the chosen model | `provider` object, `:nitro` / `:floor` / `:exacto` suffixes, `<provider-id>/<model>` | [Provider Routing](https://docs.electronhub.ai/routing/provider-routing.md), [Model Variants](https://docs.electronhub.ai/routing/model-variants.md) |
| Fallbacks | Which model runs if the first one cannot be served | `models` (Chat, Responses) or `fallbacks` (Messages) | [Model Fallbacks](https://docs.electronhub.ai/routing/model-fallbacks.md) |

Without any of these, a request goes to the model you name, served by the cheapest healthy provider that fits the request.

## Quick examples

```json Auto Router theme={null}
{
  "model": "auto",
  "messages": [{ "role": "user", "content": "Refactor this function to be faster." }]
}
```

```json Fastest provider theme={null}
{
  "model": "kimi-k2.6:nitro",
  "messages": [{ "role": "user", "content": "Summarize this log." }]
}
```

```json Provider controls theme={null}
{
  "model": "kimi-k2.6",
  "provider": { "ignore": ["<provider-id>"], "sort": "latency" },
  "messages": [{ "role": "user", "content": "Hello" }]
}
```

```json Model fallbacks theme={null}
{
  "model": "claude-sonnet-4-5-20250929",
  "models": ["gpt-5.1", "deepseek-v4-flash"],
  "messages": [{ "role": "user", "content": "Hello" }]
}
```

## Which model served the request

The response `model` field always names the model that produced the answer. Billing uses that model's price. Auto Router responses also carry the `X-EH-Routed-Model` header.

## Supported endpoints

| Endpoint | `auto` | `provider` | Suffixes | Fallbacks |
| - | - | - | - | - |
| `POST /v1/chat/completions` (and `/v1legacy`, `/v1thinking`) | Yes | Yes | Yes | `models` |
| `POST /v1/messages` | Yes | Yes | Yes | `fallbacks` or `models` |
| `POST /v1/responses` | Yes | Yes | Yes | `models` |
| Embeddings, images, audio, video, moderations | No (`400`) | No | No | No |


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