Spending limit for Codex CLI

Last updated 24 November 2026

Codex CLI on an OpenAI API key spends with every step it takes. OpenAI’s limits apply per organisation or project. With Xpenvo each developer gets their own hard limit, and a stuck loop is paused automatically.

1. Make a budget and a key

Create a free account, make a budget (for example $20 a day) and an agent key for it under Agent keys. The key starts with xpv_ and is shown once. You keep your own provider key and keep paying your provider directly; Xpenvo never stores it.

2. Add Xpenvo as a model provider

In ~/.codex/config.toml:

model_provider = "xpenvo"

[model_providers.xpenvo]
name = "Xpenvo"
base_url = "https://agents.xpenvo.com/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"
env_http_headers = { "X-Xpenvo-Key" = "XPENVO_KEY" }

Then set OPENAI_API_KEY to your OpenAI key and XPENVO_KEY to your agent key in your shell.

What happens at the limit

The request is stopped before it reaches OpenAI and Codex shows the reason. You can name cheaper fallback models in the dashboard, so Codex carries on with a cheaper model instead of stopping when money runs short.

Questions

How do I limit what Codex CLI spends?

Add Xpenvo Agents as a model provider in ~/.codex/config.toml with base_url set to the Xpenvo address and the X-Xpenvo-Key header, then give each developer a key on its own budget.

Can Codex switch to a cheaper model instead of stopping?

Yes. Set fallback models on the agent key; when the budget would block a request, Xpenvo sends it with the first fallback model that fits and tells Codex in a reply header.

More: full setup guide · model prices · tested guarantees · security. Questions? [email protected]