Codex app
Add CodaAPI as a custom provider for Codex in the ChatGPT desktop app, with the Base URL, key environment variable and model to use.
The Codex desktop app is now part of the ChatGPT desktop app: after you open the app, choose Codex instead of ChatGPT. It reads the same configuration file as the Codex CLI, ~/.codex/config.toml, and likewise calls models only through the Responses endpoint (/v1/responses). So connecting it to CodaAPI works the same way as for the CLI: add a custom provider whose address points at CodaAPI.
Not tested: this page follows the official ChatGPT and Codex documentation (learn.chatgpt.com, checked on November 30, 2026) and hasn't been tested on CodaAPI yet. Menu names follow the official English documentation; if the app is in another language, go by what you see.
What to fill in
| Item | Value |
|---|---|
| Provider type | Gateway or custom provider |
| Address (Base URL) | https://codaapi.com/v1, including /v1 |
| Key | Not the key itself, but the name of the environment variable that holds it, for example CODAAPI_API_KEY. Set the key's Group to OpenAI-Codex |
| Model | A model that can be called through the Responses endpoint and is in the key's group, for example gpt-6.2-sol |
Setup
- Put the key in the environment variable
CODAAPI_API_KEY. Create and copy the key under API Keys in the console (open it directly), with Group set toOpenAI-Codex; see the Quickstart for how to create one. On Windows, runsetx CODAAPI_API_KEY "sk-your-key"in PowerShell to store it as a user environment variable. The official documentation warns that a variable set in a terminal may not be available to an app launched from the desktop, so make sure the desktop app's process can see it. It doesn't describe how to do that on macOS; if the app can't see the variable, you can import with CC Switch instead. - Quit the ChatGPT desktop app completely and open it again so it picks up the new variable. Choose Codex in the app. The official documentation doesn't say whether you can skip signing in to a ChatGPT account when you only use a custom provider; go by the version you have.
- Open Settings (
Cmd+,on macOS,Ctrl+,on Windows) and select Model Providers. - Select Add → Gateway or custom provider.
- Enter CodaAPI in Name and
https://codaapi.com/v1in Base URL. - Under Authentication, choose Environment variable and enter
CODAAPI_API_KEYin API key environment variable (the variable name only, not the key itself). - Turn on Set as current provider and select Save.
- Start a new chat, pick a model, and send something like "Reply with just ok". A normal reply means it works. The matching request shows up in the console's Usage Logs.
Or edit config.toml directly
The desktop app reads ~/.codex/config.toml on macOS and Linux, and %USERPROFILE%\.codex\config.toml on Windows. Add [model_providers.codaapi] as shown on the Codex page, save, and restart the desktop app. To set the default model, put model = "gpt-6.2-sol" at the top of the file, before the first [...] table.
If you already use the Codex CLI configured as on that page, the desktop app needs no extra setup; restart it and it works. You can also import with CC Switch, which imports into the same configuration.
Which models to use
- Codex uses only the Responses endpoint, so pick a model that can be called through it, for example
gpt-6.2-sol(it's in all three of theOpenAI-Codex,OpenAI-官转andOpenAI-AZgroups). If a model errors saying it doesn't support this endpoint, switch to another one. - Codex applies its built-in model information (context length, reasoning levels and so on) by model name. The official documentation recommends OpenAI model names that Codex itself recognizes; a model with an unrecognized name may not support some features.
- The model must be in your key's group. For the models in groups such as
OpenAI-CodexandOpenAI-官转, see Groups; for prices, see Model Square.
FAQ
It says the key is missing, or returns 401
Most likely the desktop app can't see the environment variable. Make sure the variable is set system-wide (not just in one terminal) and that its name matches what you entered in API key environment variable exactly, then quit the app completely and open it again. If the variable is visible and you still get 401, check that the key itself is valid and Enabled. For each status code, see Error codes.
It returns 404 or says the address is wrong
Base URL must include /v1: https://codaapi.com/v1. Without /v1 the request doesn't reach the endpoint. A full address such as https://codaapi.com/v1/responses is wrong too, because Codex appends /responses itself.
It returns 404 saying the model isn't configured in your groups
The model name is misspelled, or the model isn't in your key's group. Copy the name exactly as it appears in Model Square, or edit the key and switch to a group that has the model.
I changed config.toml but it still uses the old provider
Top-level settings such as model and model_provider must come before the first [...] table; after it they are read as fields of that table. A .codex/config.toml inside a project directory can't define providers, so put the provider in the user-level file. Restart the desktop app after the change.