> ## 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.

# Quickstart

> Run the gateway locally, check it, and send it a first request.

This takes a few minutes: write a config, start the gateway, and send one request through it.

**1. Write a config file**

Create `dari-gateway.yaml` in the directory you will start the gateway from. This serves Claude Sonnet and GPT-6.2 Sol through the `default` router:

```yaml theme={null}
routers:
  default:
    models:
      - anthropic/claude-sonnet-5-5
      - id: openai/gpt-6.2-sol
        thinking: [medium, high]
    subscriptions: true
```

Every option is described in [Configure Routers](https://docs.dari.dev/gateway/configure-routers.md). The model ids are in [Models](https://docs.dari.dev/gateway/models.md).

**2. Set your keys**

Generate a gateway key for your clients, then set the provider keys you have. Provider keys are optional if you will serve from subscriptions instead.

```bash theme={null}
export DARI_GATEWAY_KEYS="$(openssl rand -hex 24)"
export ANTHROPIC_API_KEY=... OPENAI_API_KEY=...
```

`DARI_GATEWAY_KEYS` takes a comma-separated list, so you can add a second key later to rotate without downtime. For this quickstart, reuse the first key:

```bash theme={null}
export DARI_GATEWAY_KEY="$DARI_GATEWAY_KEYS"
```

**3. Start the gateway**

> [tab] Bun
>
> The gateway needs [Bun](https://bun.sh) 1.3 or later:
>
> ```bash theme={null}
> bunx @mupt-ai/dari-gateway
> ```
>
> It reads `dari-gateway.yaml` from the current directory and listens on `127.0.0.1:8080`.

> [tab] Docker
>
> The container listens on all interfaces inside the container. The `127.0.0.1:` prefix on the port keeps it reachable only from this machine:
>
> ```bash theme={null}
> docker run -p 127.0.0.1:8080:8080 \
>   -e DARI_GATEWAY_KEYS -e ANTHROPIC_API_KEY -e OPENAI_API_KEY \
>   -v "$PWD/dari-gateway.yaml:/config/dari-gateway.yaml" \
>   -v dari-gateway-data:/data \
>   ghcr.io/mupt-ai/dari-gateway
> ```
>
> The `dari-gateway-data` volume holds the SQLite database, which stores subscription tokens. Keep it across restarts and protect it like a secret.

At startup the gateway checks each provider key with its provider. If a provider rejects a key, the gateway refuses to start and names the provider. See [Provider Keys](https://docs.dari.dev/gateway/provider-keys.md).

**4. Check it is up**

The health route needs no key:

```bash theme={null}
curl http://127.0.0.1:8080/healthz
# {"status":"ok"}
```

**5. Send a request**

`dari/routing` lets the router choose the model. The response includes the model it picked in the `X-Dari-Selected-Model` header.

```bash theme={null}
curl -i http://127.0.0.1:8080/v1/chat/completions \
  -H "Authorization: Bearer $DARI_GATEWAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "dari/routing", "messages": [{"role": "user", "content": "Reply with one word: ready"}]}'
```

## Next Steps

* [Connect a subscription](https://docs.dari.dev/gateway/subscriptions.md) to serve from a Claude Code or ChatGPT plan instead of, or alongside, API keys.
* [Launch a coding agent](https://docs.dari.dev/gateway/coding-agents.md) against the gateway.
* [Review the HTTP API](https://docs.dari.dev/gateway/api.md) for the full set of routes, headers, and errors.


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