Install Codex CLI
bma-cli is tested with Codex CLI 0.165.0. Install that version by following OpenAI’s instructions, for example with npm:
npm install -g @openai/codex@0.165.0
You do not need an OpenAI account or API key. Requests go to the boostmyagents gateway with your boostmyagents key. If a different Codex version is installed, bma-cli prints a warning and still starts it, but only the tested version is supported.
You also need the bma-cli launcher. If you have not installed it yet, follow the launcher steps in the setup guide and check the download against the published SHA-256.
Set up and run
Save your key once. If you already did this for Claude Code, skip this step.
bma-cli setup
Then start Codex through the launcher:
bma-cli codex
To choose a saved key, put --repo <name> immediately after codex. bma-cli uses that pair to pick the key and removes it. Every remaining argument is passed to Codex unchanged. For example, to pick a key and a model:
bma-cli codex --repo octo/widgets --model gpt-6.1-sol
Codex keeps its normal approval prompts. bma-cli does not change Codex’s approval or sandbox settings.
Supported models
The gateway accepts these OpenAI model IDs from Codex. Requests for any other model are rejected and not charged.
gpt-6-astragpt-6.1-solgpt-6-solgpt-5.6-solgpt-6.1-terragpt-5.6-terragpt-6-lunagpt-5.6-luna
The launcher offers only the models enabled for your key and starts with gpt-6-astra unless you pass --model. You do not need to regenerate your key to use these models.
Codex settings
The launcher keeps a separate Codex profile under ~/.config/boostmyagents/codex and rewrites it each time it starts. It does not read or change ~/.codex, so your own Codex settings stay as they are and do not apply to boostmyagents sessions. The key reaches Codex only through the process environment.
Codex requires a model list that includes a system prompt. boostmyagents supplies OpenAI's own Codex prompt for each model, copied unchanged from the Codex version we test. We don't add to it, and your prompts stay private.
When Codex asks whether to trust a project folder, your answer is saved in that separate profile and kept for later runs. Trust answers from ~/.codex are not copied in, so Codex asks again the first time you open each folder through bma-cli.
The profile turns off automatic retries, hosted web search, analytics, feedback, saved history, telemetry export, update checks, and remote model lookups. It also runs one Codex agent at a time, because each key runs one request at a time.
When a turn is cut off
Before a request is sent, the gateway reserves the most it could cost: the exact input size plus the largest output the request is allowed. OpenAI reports the real usage at the end of the response, and you are charged that real amount.
If the response stops before that final report arrives, for example because the connection dropped, the gateway cannot know the real usage. In that case you are charged the reserved amount. Your key accepts its next request once that charge has been recorded, which can take a short time.
The launcher turns off Codex’s automatic retries, so a cut-off request is charged only once. Send the prompt again yourself if you still need the answer.
Input limit and compaction
A request with more than 272,000 input tokens is rejected before it reaches OpenAI and is not charged.
To stay under that limit, the launcher sets Codex to compact the conversation automatically at about 240,000 tokens. Codex counts tokens with its own estimate, so the gap leaves room for the difference. Codex runs compaction as a normal request through the gateway, charged like any other request. OpenAI’s server-side compaction endpoint is not available.
Gateway limits
The same rules that cap Claude Code requests apply to Codex, so your balance can never be overspent.
- One request at a time per key, shared between Claude Code and Codex.
- Only Codex CLI started with
bma-cliis supported. The gateway accepts only the requests Codex CLI sends, so other OpenAI clients and the OpenAI SDKs are not supported. - Each response is capped at 32,000 output tokens, or less when your balance is low. Reasoning tokens count toward that cap.
- Tools must be sent as standard function tools, such as Codex’s shell tool. Codex’s freeform
apply_patchtool is rejected. - Tools that run on OpenAI’s servers are rejected, such as hosted web search and code interpreter.
- Requests that set a service tier, such as priority or flex, are rejected.
- Requests that would cost more than what remains are rejected before they reach OpenAI.
Rejected requests are not charged. Error messages from the gateway start with boostmyagents:.
Checking your balance
Codex has no boostmyagents status line yet. Check your remaining balance with bma-cli status or on your dashboard.
bma-cli status
Prompt contents stay private with Codex too. The gateway records token counts and timings, never what you sent or what came back.
Troubleshooting
Codex CLI is not installed
bma-cli looks for a codex command on your PATH. Install Codex CLI, then open a new terminal.
A warning about the installed Codex version
Install the tested version shown in the warning. Other versions may send requests the gateway rejects.
Codex support is not available for your key yet
bma-cli codex stops with Codex support is not available for your key yet. when your key has no OpenAI models. Your key keeps working with Claude Code.
The saved Codex profile cannot be validated
Move ~/.config/boostmyagents/codex/config.toml out of the way and run bma-cli codex again. Codex will ask about folder trust again.
An error starts with boostmyagents:
The gateway rejected the request, and it was not charged. Check the gateway limits above. If you are out of balance, bma-cli status shows empty.
Stuck? Ask in our Discord.