Skip to main content
GoModel is a good fit for Codex because Codex already targets the OpenAI Responses API. Codex -> GoModel -> upstream Codex talks to GoModel with a GoModel master key, so every request shows up in the dashboard. The one choice to make is which provider serves the model, because that decides what pays for it: Everything after this point is the same either way.

Before you start

  • Install Codex on your machine.
  • Choose a GoModel master key, for example change-me.
To bill Codex to your ChatGPT plan, sign in once so Codex writes its token file, then hand that token to GoModel:
See the ChatGPT provider page for the model list, the token’s ~10-day lifetime, and which Responses parameters that backend accepts. To bill it to API credit instead, configure any other provider as usual — for example -e OPENAI_API_KEY="sk-..." — and use one of its models in step 2.

1. Confirm the Responses API

Optional: check that GoModel answers a plain Responses request before involving Codex. Use a model your configured provider actually serves.
The response contains ok. For the Python and JavaScript equivalents, see the Responses API reference.

2. Configure Codex to use GoModel

Add a Responses-based provider to ~/.codex/config.toml:
Then export the GoModel master key for that provider:
Codex requires this variable even when you are signed in with ChatGPT, and it carries the GoModel master key — not an OpenAI key. Without it the provider fails to start.
To try it without editing your config, pass the same settings inline:
Codex ignores OPENAI_BASE_URL. Use the provider config above, or set openai_base_url in Codex config if you intentionally want to override the built-in OpenAI provider.

3. Run a Codex test prompt

The validated result was:
Codex 0.147.0 logs failed to refresh available models: missing field "models" at startup. It calls its own catalogue endpoint, which GoModel answers with the standard OpenAI /v1/models shape. The message is cosmetic — Codex falls back and the session works.

4. Check the traffic in GoModel

Open the GoModel dashboard audit logs: http://localhost:8080/admin/dashboard/audit This lets you confirm that Codex is reaching GoModel and inspect the full request and response trail. From the same dashboard, you can keep following your GoModel traffic and usage.

DeepSeek V4

Codex sends POST /v1/responses, which DeepSeek does not serve natively. Use type: deepseek rather than type: openai: the DeepSeek provider translates /responses to /chat/completions, while the generic OpenAI provider forwards it upstream unchanged.
Then set model = "deepseek-v4-pro" in the Codex config from step 2. See the DeepSeek page for the reasoning-effort mapping, and Responses compatibility for what chat-translated providers drop — including the reasoning.encrypted_content Codex asks for on every request.

Current status

  • the recommended integration path is Codex custom provider -> standard http://localhost:8080/v1
  • Codex custom provider mode sends POST /v1/responses as plain JSON, so the old --disable enable_request_compression workaround is no longer required

References

Validated on August 20, 2026

This guide was validated against a local GoModel instance and Codex CLI 0.147.0. Local validation confirmed:
  • codex exec returned ok through Codex -> GoModel -> ChatGPT subscription
  • POST /v1/responses returned 200 OK for both streaming and non-streaming callers
  • Codex sent plain JSON; no Content-Encoding: zstd header was present
  • the custom gomodel provider failed without its env_key, because Codex still requires that variable when signed in with ChatGPT
Last modified on August 22, 2026