Codex (OpenAI CLI)
Connect Codex CLI to OneProvider through the streaming Responses API: add a custom provider, restart, run a task and confirm usage in your dashboard.
Run new local Codex tasks through OneProvider's streamed Responses API.
All models, capabilities, and prices Documentation index for AI agents:https://oneprovider.dev/docs/llms.txt Codex coding agent CLI and desktop app
Official documentationWhat works
Supports streamed responses, function calls, local tools such as apply_patch, and usage accounting. This changes new local CLI, desktop, and IDE tasks; it does not change Codex cloud chats.
Client limitation
Restart Codex and create a new local task after changing the provider. Existing tasks keep the model and provider they started with.
Before you start: a key from your cabinet Open your cabinet: the Telegram bot @oneprovider_robot (Account) or app.oneprovider.dev . Press “Issue a key”, give it a name (for example, this client) and a spend limit, and copy the key. You top up the balance in the same place. More about the cabinet and keys .Setup
-
Install or verify Codex
If codex --version already prints a version, continue. Otherwise install the current CLI.
npm install --global @openai/codex codex --version -
Make a dedicated key available
Create a dedicated OneProvider key and export it in the same terminal session that starts Codex.
export ONEPROVIDER_API_KEY="sk-your-key-here" -
Add the custom provider
Open ~/.codex/config.toml (desktop: Settings → Configuration → Open config.toml) and add the OneProvider provider.
model_provider = "oneprovider" model = "gpt-6.1-sol" [model_providers.oneprovider] name = "OneProvider" base_url = "https://api.oneprovider.dev/v1" env_key = "ONEPROVIDER_API_KEY" wire_api = "responses" -
Restart and test a new local task
CLI users should run a read-only probe. Desktop users must fully quit, reopen, and start a new local task.
codex
Verify the connection
Confirm the request in your dashboard
The completed request should show the selected model, /v1/responses, token usage, and a settled charge.
Connection details
- Protocol
- responses
- Endpoint
- https://api.oneprovider.dev/v1
Key security
Use a dedicated scoped key. On macOS, a desktop app opened from the Dock may not inherit terminal environment variables; use Codex command-backed Keychain authentication instead of placing the secret in config.toml.
Which model to choose
Set model in the same config.toml, below model_provider. gpt-6.1-sol is the frontier tier for hard agentic tasks, gpt-5.6-terra is the balanced default for everyday work, and gpt-5.6-luna is the low-cost tier for high-volume and quick tasks. Codex talks the Responses API, so pick GPT ids from the models page ; rates are on the pricing page .
Common errors and fixes
401 or “missing credentials”
ONEPROVIDER_API_KEY is not visible to Codex. Export it in the terminal that starts Codex. A desktop app opened from the Dock does not inherit it on macOS: use command-backed Keychain authentication.
404
base_url must be https://api.oneprovider.dev/v1 with /v1, and wire_api must be "responses".
Codex still uses the old model or provider
Existing tasks keep the provider they started with. Restart Codex and create a new local task.
“You've hit your usage limit” or Codex asks me to sign in to ChatGPT
That is the limit of a ChatGPT subscription: the request went to ChatGPT, so the OneProvider provider is not active. Put model_provider = "oneprovider" at the very top of config.toml, above any [table] (no smart quotes), quit Codex fully and start a new local task. Then sign out of ChatGPT with codex logout (desktop app: in its settings) and start codex in the terminal where ONEPROVIDER_API_KEY is exported: with the provider active it works on the key alone. Quick test: codex -c model_provider=oneprovider. wire_api accepts only "responses".
429 “Insufficient balance”
Balance or key limit is used up. Top up; retries will not help.
FAQ
Does this change Codex cloud chats?
No, only new local CLI, desktop and IDE tasks.
Do I need an OpenAI account?
No, the OneProvider key replaces it for local tasks.
Can I use Claude models in Codex?
Codex uses the Responses API with GPT ids. For Claude use Claude Code .
Where do I check cost?
In the dashboard Usage page: each request shows the model, /v1/responses and a settled charge.
Quick answers
Which base URL do I use?
Claude Code and Anthropic SDKs use https://api.oneprovider.dev. OpenAI SDKs and OpenAI-compatible clients use https://api.oneprovider.dev/v1. One key works behind both; the model list is on the models page ; rates are on the pricing page .
How do I authenticate?
Send the raw sk-… key in x-api-key or Authorization: Bearer: one of them, never both. Keep the key in an environment variable, not in a file that gets committed. More on authentication .
Where do I get a key?
Open your cabinet in the Telegram bot @oneprovider_robot or at app.oneprovider.dev, top up the balance and press “Issue a key”. Each key can carry its own spend limit. Cabinet & API keys .
What do 401, 404 and 429 mean?
401: the key is missing, mistyped or sent in the wrong header; paste the whole key without quotes or spaces. 404: usually a wrong base URL, for example a missing or doubled /v1. 429 with “Insufficient balance”: the cabinet balance or the key’s spend limit is used up, so top up instead of retrying; any other 429 is a rate limit, so wait for Retry-After. Details: error codes and troubleshooting .
Why do streams cut off or reset?
VPN and VLESS proxies often buffer SSE or break HTTP/2 negotiation. OneProvider has no regional restrictions and does not buffer streams, so turn the proxy off and retry.
Where do I ask if this is not enough?
Message @Oneproviderhelpbot on Telegram or open “Support” in the web cabinet, with the HTTP status code and the exact error message. How support works .
Last updated: 2026-10-05 Found a bug? @Oneproviderhelpbot