Guides

Codex Desktop and AI Hub

Connect Codex Desktop to AI Hub's Responses API: configuration file, credential delivery and model IDs.

Connect

AI Hub serves the Responses API, the wire protocol Codex providers use. Desktop takes the same provider entry as the Codex CLI guide.

The Codex provider reference specifies responses as the wire protocol.

Desktop configuration and credentials

The official gateway guide documents ~/.codex/config.toml for the macOS app and %USERPROFILE%\.codex\config.toml for Windows. Restart the app after changing provider settings. Check the selected model and any managed configuration.

A credential exported in a terminal reaches the app only if the app process inherits it. Use your operator's secret delivery mechanism for the app process, and keep keys out of TOML and project files. MCP connections and plugins are configured separately from the inference provider.

Provider entry and models

Use the provider entry from the Codex CLI guide, with wire_api = "responses" and env_key = "TOKENHUB_API_KEY". Set the primary model, agent overrides, auxiliary requests and fallback routes to AI Hub model IDs from the catalogue:

bash
curl --fail "https://tokenhub-api.belive.sg/api/v1/models"

Create a dedicated workspace inference key in the same environment as the API, keep it in a secret store or process environment, and set a spend cap.

Troubleshooting

  • A Responses endpoint 404 against AI Hub: check the base_url; AI Hub serves /api/v1/responses.
  • Missing credentials in Desktop but not the CLI: check how the app receives its environment, without printing the credential.
  • Unexpected provider or model: check the active configuration, restart the app and inspect its selected model. See Codex CLI for the custom-provider settings.
  • Check Activity for the model, usage and cost of each request.

Other clients

For a Chat Completions setup, use the Qwen Code, Hermes Agent, OpenClaw or OpenCode guide. Do not put credentials in repository config, screenshots or diagnostic logs.