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

# Create A Router

> Create an endpoint that routes across your enabled models.

Create a router from a local YAML manifest with the Dari CLI. This is the easiest way to keep a router configuration in source control.

## YAML

Create `router.yml`:

```yaml theme={null}
name: Production Router
enabled_models:
  - openai/gpt-6.1-sol
  - anthropic/claude-sonnet-5-5
provider_key_sources:
  openai: managed
  anthropic: managed
routing_strategy: dari
```

Sign in and create the router:

```bash theme={null}
dari auth login
dari router create ./router.yml
```

`dari` enables automatic routing. For BYOK providers, first [save an organization provider credential](https://docs.dari.dev/router/configure-provider-keys.md), then reference its stable ID with `provider_credential_ids`. The CLI uses the platform default and enables speculative routing. Add `session_pinning: true` to keep one model per session; see [Session Pinning](https://docs.dari.dev/router/session-pinning.md).

The command returns a router ID. Use it to retrieve the endpoint:

```bash theme={null}
dari router get <router_id>
```

## Dashboard

For a quick setup, open **Routers** in the [Dari Dashboard](https://app.dari.dev), select **Create Router**, choose your models and saved provider credentials, and copy the endpoint from the router detail page. The dashboard is also where you can disable speculative routing or turn on session pinning under **Advanced Settings**.

A router endpoint looks like this:

```text theme={null}
https://routing.dari.dev/rtr_123/chat/completions
```

## Next Steps

* [Configure Models](https://docs.dari.dev/router/configure-models.md)
* [Configure Provider Credentials](https://docs.dari.dev/router/configure-provider-keys.md)
* [Speculative Routing](https://docs.dari.dev/router/speculative-routing.md)
* [Session Pinning](https://docs.dari.dev/router/session-pinning.md)
* [Router Evals](https://docs.dari.dev/evals/overview.md)


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