subscriptions: true use them.
Connect A Plan
Rundari accounts and choose Add a subscription. It can also buy a new plan: it opens the provider’s plan page, then connects the new account.
Scripts connect each plan with one command. Point the Dari CLI at your gateway first:
- Claude Code. Sign in with Anthropic in your browser, then paste the code it shows into the terminal.
- ChatGPT (
codex). Enter the device code shown in the terminal on OpenAI’s page. The gateway waits for you to approve it. - GitHub Copilot. Enter the device code shown in the terminal on GitHub’s page, with the account that holds your Copilot plan. GitHub Enterprise accounts aren’t supported yet.
- Grok. Enter the device code shown in the terminal on xAI’s page, with the account that holds your SuperGrok plan.
- Muse Code. Enter the device code shown in the terminal on Meta’s page. The gateway then mints a Model API key for the subscription.
- OpenCode Go. Enter the device code shown in the terminal in the OpenCode console, and choose the workspace that holds your Go subscription. This is the sign-in
opencode auth loginruns. - Vercel Token Pass. Create a Token Pass key with
vercel token-pass, or create an AI Gateway API key and choose Restrict to Token Pass only, then paste it into the terminal. A Token Pass key serves only Vercel’s featured models and never bills overage.
Manage Plans
dari accounts lists each plan with its usage and reset times. ChatGPT plans also show their plan and renewal date. Choose a plan there to manage it at the provider, rename, reconnect, mark it available, or disconnect it.
The same operations work from scripts:
Reconnect a plan that has expired with
--reconnect <name>. Commands that take a plan accept claude-code or codex, or the name of a connection from list.
Usage Limits
When a plan hits its usage limit, the gateway holds it until the provider’s reset time. The refused request goes to the next connection at once, so the client gets an answer instead of the error.- Per-model limits. A limit on one model holds only that model. The connection keeps serving the router’s other models. The refused request returns a retryable
503, and the retry routes elsewhere.dari accounts subscription listshows these asmodel_holds. - No connection left. If every connection of a plan is held, the request moves to the next plan that serves the model, then to the provider’s API key, if one is set. Otherwise the request returns
424 personal_subscription_unavailable. - Ending a hold. A held connection or model returns when its reset passes, or when you run
mark-available.listshows each connection’s reportedusage.
One Model, Several Plans
Several plans can serve the same model. GitHub Copilot, for example, also serves Claude and GPT models. A request tries the model maker’s plan first, then the other connected plans that serve it, in this order: Claude Code, ChatGPT, Grok, Muse Code, OpenCode Go, GitHub Copilot, Vercel Token Pass. The provider’s API key comes last. The gateway moves on within the same request, before the client sees any output, when a plan is held, hits its limit, or the provider rejects its sign-in.Pooling
Connect more than one account per provider to pool them. The gateway picks a connection for each conversation:- A conversation stays on its connection, so its prompt cache stays warm.
- New conversations start on the connection whose quota resets soonest, so quota about to reset is used first. Ties go to the connection used last, then to connection order.
- Claude Code connections report usage on every response. Once a connection has used 95% of a window, its conversations move to another connection at their next turn, before the provider starts refusing requests.
Who Can Use Which Plan
Each plan serves only the clients its terms allow:
The gateway recognizes Muse Code by the
x-client-id header it sends. Requests from other clients fall through to the provider’s API key, or are refused if none is set.
Turn Subscriptions Off
A router withsubscriptions: false never uses a connected plan. Its requests use API keys only. See Configure Routers.
Storage
Connected plans are stored in the gateway database atDARI_GATEWAY_DB, with each plan’s access tokens in plaintext. Protect the database like a secret. See Operations.
Details
Usage reporting by provider
Usage reporting by provider
Muse Code plans report their five-hour and weekly windows at the end of every response. OpenCode Go plans don’t report usage on responses, so
dari accounts reads their five-hour, weekly, and monthly windows from OpenCode, at most once a minute.Connection names and pooling edge cases
Connection names and pooling edge cases
The CLI names each connection in the order it was connected. When every connection is past 95%, the least used one serves. ChatGPT plans report usage only in their response stream, which the gateway does not read yet, so they switch only on a usage limit.