OhMyGPT
Coding Tools

ChatGPT desktop app

Run Codex in the ChatGPT desktop app on OhMyGPT models with your OhMyGPT key.

The ChatGPT desktop app for macOS and Windows has a Codex side that reads the same ~/.codex/config.toml as Codex CLI. Add an OhMyGPT provider to that file and save your key next to it, and every Codex chat in the app sends its requests to OhMyGPT. The ChatGPT side of the app, both Chat and Work, keeps sending requests to OpenAI on your ChatGPT plan.

Configure

  1. Add the provider to ~/.codex/config.toml. On Windows the file is %USERPROFILE%\.codex\config.toml.

    ~/.codex/config.toml
    model = "openai/gpt-5.5"
    model_provider = "ohmygpt"
    
    [model_providers.ohmygpt]
    name = "OhMyGPT"
    base_url = "https://api.ohmygpt.com/v1"
    env_key = "OHMYGPT_API_KEY"
    wire_api = "responses"
  2. Save your key in ~/.codex/.env. On Windows the file is %USERPROFILE%\.codex\.env.

    ~/.codex/.env
    OHMYGPT_API_KEY=sk-...
  3. Quit the app completely, not only its window, and open it again.

  4. Choose Codex and start a new chat.

Codex loads ~/.codex/.env each time it starts. An app opened from the Dock or the Start menu does not see variables exported in ~/.zshrc or in a terminal, so export OHMYGPT_API_KEY=... does not reach it.

Keep model_provider and [model_providers.ohmygpt] in the config.toml in your home directory. Codex ignores both in a project's .codex/config.toml.

Check the connection

Codex sends Responses requests. Send one to the free test model ohmygpt/mock:

curl https://api.ohmygpt.com/v1/responses \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "ohmygpt/mock", "input": "ping"}'
{
  "id": "resp_hC1CMOi7mwfldv2Wymxj3kVl",
  "object": "response",
  "status": "completed",
  "model": "ohmygpt/mock",
  "output": [
    {
      "type": "message",
      "id": "msg_0",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "This is a mock reply from OhMyGPT. Your integration works; switch to a real model when ready."
        }
      ]
    }
  ],
  "usage": { "input_tokens": 15, "output_tokens": 17, "total_tokens": 32 }
}

To check the app itself at no cost, set the model to the mock and turn off web search, which the mock does not support:

~/.codex/config.toml
model = "ohmygpt/mock"
model_provider = "ohmygpt"
web_search = "disabled"

[model_providers.ohmygpt]
name = "OhMyGPT"
base_url = "https://api.ohmygpt.com/v1"
env_key = "OHMYGPT_API_KEY"
wire_api = "responses"

Quit and reopen the app, then send any message in a new Codex chat. The reply is the mock text shown above. The mock is available once your account has been topped up.

Choose a model

The model picker in the app lists OpenAI's GPT models, such as gpt-6.2-sol and gpt-5.5. With this setup, each of them runs on OhMyGPT. The picker does not list other OhMyGPT models. To use one, set its ID as model in config.toml, then quit and reopen the app.

List the models you can use with Codex:

curl -s https://api.ohmygpt.com/v1/models \
  | jq -r '.data[] | select(.available and any(.protocols[]?; .id == "openai-responses")) | .id'

Prices for each are on the Models page.

Codex adds a web_search tool to every request. Models from other creators, such as zhipu/glm-5.3, reject it, so turn web search off when you use one:

~/.codex/config.toml
model = "zhipu/glm-5.3"
model_provider = "ohmygpt"
web_search = "disabled"

[model_providers.ohmygpt]
name = "OhMyGPT"
base_url = "https://api.ohmygpt.com/v1"
env_key = "OHMYGPT_API_KEY"
wire_api = "responses"

Put web_search above the [model_providers.ohmygpt] line. A key below that line belongs to the provider, and Codex does not read it as a setting.

Troubleshooting

SymptomCauseFix
Missing environment variable: `OHMYGPT_API_KEY`.~/.codex/.env is missing, is in another folder, or was saved after the app startedSave the key as in Configure, then quit and reopen the app
400 saying The `web_search` tool is not available for the modelThe model does not support web searchAdd web_search = "disabled" above [model_providers.ohmygpt]
failed to load configuration followed by a line and column in config.tomlThe file has a TOML syntax error at that positionFix the line, then quit and reopen the app
Codex replies, but Usage shows no requestsThe app did not load the provider. config.toml is in another folder, or the app was not fully quitMove the file to your home directory's .codex folder, then quit and reopen the app. If nothing changes, end the ChatGPT processes left in Activity Monitor or Task Manager
The app reports a usage limit and does not sendThe app checks the Codex allowance of the signed-in ChatGPT account, even when requests go to OhMyGPTWait for the ChatGPT allowance to reset
401 with Invalid API keyThe key is mistyped or was deletedCopy a key from API keys
404 saying the model does not existThe ID is misspelledCopy the ID from GET /v1/models
402The balance or the key's spending limit is used upTop up at Billing

Every response carries an X-Request-ID header, and Usage shows what each request cost.

Was this page helpful?

Still stuck? Live chat · [email protected] · Telegram group