Codex Desktop
Run Codex in the ChatGPT desktop app on your OpenDunes balanceBalanceWhat you can spend, in DA.More on Balance and charges →.
The desktop app, Codex CLI and the IDE extension read the same ~/.codex/config.toml. The app sends every request to POST /v1/responses, as the CLI does. What the app lacks is your shell: it reads no export from your shell profile, so the key goes where it can read it.
- Install the app.
- Add OpenDunes as a provider.
- Make the key visible to the app.
- Restart and start a local chat.
1. Install the app
Download the ChatGPT desktop app for macOS or Windows from chatgpt.com, open it and sign in. To reach Codex, open the ChatGPT dropdown and choose Codex.
2. Add OpenDunes as a provider
If Codex CLI already runs on OpenDunes, skip this step: the app reads the same file (Codex CLI). If not, write the provider into ~/.codex/config.toml, or %USERPROFILE%\.codex\config.toml on Windows:
model = "anthropic/claude-sonnet-4.5"
model_provider = "opendunes"
[model_providers.opendunes]
name = "OpenDunes"
base_url = "https://opendunes.com/v1"
env_key = "OPENDUNES_API_KEY"
wire_api = "responses"
supports_websockets = falseThe provider holds in this file only, in your home folder: a project's .codex/config.toml cannot set it. Any model on sale goes in model, charged at its own rate shown on its page in Models.
3. Make the key visible to the app
Create an API keyAPI keyThe key you create and send with every request that calls a model.More on API keys → named Codex Desktop, and cap it on API Keys (API keys shows how). Then set OPENDUNES_API_KEY where the app reads it.
| On | Run once, in a terminal | Holds until |
|---|---|---|
| macOS | launchctl setenv OPENDUNES_API_KEY "…" | the Mac restarts |
| Windows | setx OPENDUNES_API_KEY "…" | you remove it |
On macOS, launchctl setenv is lost when the Mac restarts, and the app then sends no key and gets a 401. Run the line again after each restart, before you open the app.
4. Restart and start a local chat
Quit the app fully, not only its window, and open it again: it reads config.toml and the key at start. Choose Codex and start a new chat as Local or Worktree: both run on your computer, with your config.toml.
Send one short task, then open Activity, in the app on opendunes.com: each request Codex sent is there, with its charge in DADAThe Algerian dinar, the one currency the docs show.More on Balance and charges →.
Errors
| Status | Means | Do |
|---|---|---|
| 401 | the app sent no key, or a wrong, paused, revoked or expired one | set the key as in step 3, then quit and reopen the app |
| 402 | the balance is at zero or below, cannot pay the request's hold, or the key's cap is spent | make a depositDepositMoney entering your balance, by CIB or Edahabia card.More on Balance and charges →, or raise the cap |
| 404 | the model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models → is not on sale | copy the ID from Models |
Every other status: Errors and retries. Codex in a terminal: Coding agents.
Last modified on