Integrations
Use Codex CLI with any model
Codex CLI reads custom model providers from its ~/.codex/config.toml file. Connect to Hopscotch to use any model in the catalog.
Set it up
- 01
The configuration surface
The file is ~/.codex/config.toml, with a project-scoped .codex/config.toml alongside it. Add a provider and select it:
~/.codex/config.tomlmodel_provider = "hopscotch" model = "unirouter/auto" [model_providers.hopscotch] name = "Hopscotch" base_url = "https://api.hopscotchlabs.ai/v1" env_key = "HOPSCOTCH_API_KEY" wire_api = "responses"bashexport HOPSCOTCH_API_KEY=ub_live_XXXXXXXXXXXXbase_url must include /v1. Codex appends only /responses to whatever you give it, so a base URL that stops at the hostname posts to /responses and receives a 404.
Do not name the provider openai. The built-in provider ids are reserved and a block of that name is ignored rather than refused, which is the kind of failure that costs an afternoon. Any other id works; hopscotch above is arbitrary.
- 02
The key comes from a variable you name
env_key names the environment variable Codex reads, and it reads it at request time rather than caching it.
Codex also has a login flow that writes a credential to ~/.codex/auth.json. That path belongs to the built-in OpenAI provider and is not how a custom provider is authenticated; leave it alone and use env_key.
- 03
Pin the model id
Codex's model field is free text and this API needs it to name a provider, so the default has to change before the first request.
There is one more model setting, review_model, which /review uses and which defaults to the session model. If you set it, pin it the same way.
Models that fit an agent
These models support tool calling and take at least 128K tokens of context. Prices are per million tokens.
| Model | Context | Max output | Input /1M | Output /1M | Cached input /1M | Providers | Released |
|---|---|---|---|---|---|---|---|
| Gemma 4 E4B ITGoogledeepinfra/gemma-4-E4B-it | 131K | 8K | $0.02 | $0.10 | n/a | Deepinfra | 2 Apr 2026 |
| GPT OSS 20BOpenAIdeepinfra/gpt-oss-20b | 131K | 16K | $0.03 | $0.14 | n/a | Deepinfra | 5 Aug 2025 |
| GPT OSS 120BOpenAIdeepinfra/gpt-oss-120b | 131K | 16K | $0.04 | $0.17 | n/a | Deepinfra | 5 Aug 2025 |
| Command R7BCoherecohere/command-r7b-12-2024 | 128K | 4K | $0.04 | $0.15 | $0.04 | Cohere | 2 Dec 2024 |
| Nemotron 3 Nano 30B A3BNVIDIAdeepinfra/Nemotron-3-Nano-30B-A3B | 262K | 262K | $0.05 | $0.20 | n/a | Deepinfra | 15 Dec 2025 |
| DeepSeek V4 Flash 0731DeepSeekdeepinfra/DeepSeek-V4-Flash-0731 | 1M | 384K | $0.06 | $0.18 | n/a | Deepinfra | 31 Jul 2026 |
What changes when Codex CLI runs through Hopscotch
- One key for every model
- Switch models in Codex CLI by changing the model name.
- A budget for this tool
- Give Codex CLI its own key with a daily limit. A long session stops at the limit.
- Every call in Activity
- Each request Codex CLI sends shows up with its model, provider, tokens and cost.
- List price
- You pay each provider's list price per token, with no markup.
Codex CLI questions
Do I need an account with each provider?
No. One Hopscotch key covers every model in the catalog, and you buy credit once.
Which model name goes in Codex CLI?
The ID from the models page, such as deepinfra/gemma-4-E4B-it. The provider comes first, then the model.
Will Codex CLI get a different model than the one I picked?
No. Hopscotch runs the model you name. To add a backup, set up a routing profile.
Can I use my own provider key with Codex CLI?
Yes. Add the key in your dashboard. Requests to that provider run on it.