Models and billing

By default the panel uses Auto: Codity picks a model for each message and pays for it from your organization's Codity credits. You can choose how Auto weighs cost against capability, pick a specific model, or pay with your own provider keys.

Auto

Auto sends a small, clear request to a fast model and a hard one (debugging an unknown cause, a migration, a security change) to a frontier model, and moves to a stronger model if the agent starts struggling. Each reply shows the model that answered and what it cost. The models Auto chooses from, and how it decides, are described in Automatic model selection.

The model picker under the message box shows Auto with its priority, for example Auto · balance:

Priority Favours
cost Cheaper models; steps up only when a task needs it.
balance The default. A fast model for small tasks, a stronger one for real changes.
intelligence The strongest models.

Change it in the picker. The panel remembers your choice for this workspace and uses it for later sessions there too; codity.routerMode is the priority used until you pick one.

Choose a specific model

Open the model picker and choose any model your billing can pay for. That model answers every message until you switch back to Auto. A model you pick is still billed to Codity credits when you use them.

For models that support it, Effort next to the picker sets how much the model reasons before answering. More effort is slower and costs more.

Who pays: Codity credits or your own keys

The codity.billing setting decides who pays for model calls:

Value Who pays
auto (default) Your organization's Codity credits when the wallet has a balance, otherwise your own provider keys.
credits Only Codity credits.
byok Only your own provider keys, never credits.

With credits, Codity calls the providers for you and charges each call to your organization's wallet; you need no model keys.

Use your own keys (BYOK)

  1. Export one or more provider keys in your shell profile (~/.profile, ~/.bashrc or ~/.zshrc):

    export ANTHROPIC_API_KEY=sk-ant-...
    export OPENAI_API_KEY=sk-...
    export OPENROUTER_API_KEY=sk-or-...
    

    Any combination works. Auto only routes to providers you have a key for; with only an OpenRouter key, every tier goes through OpenRouter.

  2. Set codity.billing to byok in your user settings:

    "codity.billing": "byok"
    
  3. Quit VS Code completely and start it again, so it picks up the new environment. Alternatively, start it from a terminal where the keys are exported, with code ..

  4. Run Codity: Restart Agent. Billing is set when the agent starts, so a new chat in the running agent keeps the old setting.

The extension never stores your keys. It starts the agent with the environment VS Code was launched with, and the keys go from your machine to the provider. If byok is set and VS Code can't see any key, the panel says --billing byok uses this machine's model keys, and none is set with the variables to set. That almost always means VS Code was started before the keys were exported.

Costs

Each reply shows its model and cost, and the bar under the message box shows the session's total. The run's dashboard page (Dashboard in the panel) lists every model call with its cost. With credits, Codity holds the most a call could cost before it runs and charges what it actually used; if the wallet can't cover the next call, the agent stops and asks you to top up.