Skip to main content
Install the Dari CLI, then run:
The first launch signs you in and opens an Accounts page. Connect one or more ChatGPT subscriptions, an API key (Vercel AI Gateway, OpenRouter, or direct provider keys), or use Dari credits. Setup then asks which models Codex can use and when Dari picks the model, and creates a Dari Codex router (Dari Codex (Managed) without a ChatGPT subscription). After that, dari codex goes straight to Codex. Your own Codex configuration is left alone. Arguments are passed through to Codex:

Choose A Model

Switch models with /model, or request dari/model/<model> directly. Each model shows what pays for it: a subscription, an API key, or Dari credits. Press s in the setup model picker to change it. Dari Routing (dari/routing) picks the model for each request. It needs the Autorouting plan ($20/month for individuals); run dari accounts and choose Get auto-routing (or press a in the setup model picker). Without it, Codex starts on your router’s first model. Check Activity to see each selection.

Usage Limits

When a ChatGPT subscription hits its limit, Dari pauses it until it resets and moves to your next subscription, or to the API key for models with API Fallback on. See Usage Limits.

Use Another Router

Edit the Dari Codex router, or make a new one, then assign it to Codex:
You can also add Codex to the router’s card on the Routers page. Assign the default router to move it back.

Desktop App

dari codex never changes your Codex config. To make the Codex desktop app route through Dari, set it up once:
The app shares its config with plain codex, so this sets up both, and --cli does the same. Restart the app afterward. Run setup again after you change your router’s models, and dari setup codex --remove to undo it.

Manual Setup

To skip the launcher, create a Routing key and export it as DARI_ROUTING_API_KEY. With Codex 0.134.0 or later, create ~/.codex/dari.config.toml (the filename matches the profile name):
For another router, use https://routing.dari.dev/<router_id>/v1 as base_url.

Details

The launcher disables reasoning summaries, which are unsupported. On Dari Routing, the router picks the reasoning level even if Codex sends a global effort preference. On a specific dari/model/<id>, the effort you pick in /model is used.
Setup makes Dari the default provider in ~/.codex/config.toml, which the app shares with the codex CLI, and writes the model menu to ~/.codex/dari-models.json. Top-level keys it replaces, such as model, are commented out and restored on dari setup codex --remove. The Routing key is stored there because desktop apps don’t inherit shell variables.
Set DARI_ROUTING_API_KEY to use an existing key instead of the one the CLI creates. Router and subscription settings are stored in Dari, so a new computer reuses them after sign-in. Run dari accounts to manage accounts and see each plan’s usage.