Skip to content

Codex setup

Connect OpenCode Go to Codex

Configure OpenCode Go in Codex with the Console CLI, verify model and session routing, and fix authorization, entitlement, and proxy problems.

A translucent workstation tunnel routing a secure signal into an agent core

The short answer

Connect Codex with npx @opencode/console setup codex. The CLI opens Console for browser approval, selects a workspace, and adds the models, policies, MCP servers, skills, and instructions that workspace makes available.

How do you connect OpenCode Go to Codex?

Use Node.js 22 or later, run the Codex setup command, complete browser approval, and select the workspace with the desired Go subscription.

Connect Codex
npx @opencode/console setup codex

The Console CLI performs a browser-based sign-in instead of asking you to copy a password or token into the terminal. After approval, Codex receives the workspace configuration managed by Console.

Run the command as the same operating-system user that launches Codex. Installing configuration under a different home directory can leave the app using an older configuration.

Can Codex keep its existing ChatGPT or coding plan?

Yes. The Console CLI supports keeping the harness provider when you still want the existing Codex sign-in and models while adding workspace policy and integration features.

The documented option is --keep-provider. It keeps the harness provider while still applying workspace policies, MCP servers, skills, and instructions through Console.

Use that option when you want the organization layer without replacing the model billing path. Omit it when you intend Codex model requests to use the selected Console workspace and Go subscription.

Why is session routing important in Codex?

OpenCode Go uses session identity to keep conversation routing consistent and reuse prompt cache. Codex normally sends a native session header, but some proxies omit it.

If Codex connects directly through Console setup, the managed integration handles the session behavior. Problems become more likely when a custom gateway or network proxy recreates requests without preserving headers.

Keep the native session header intact when forwarding traffic. A stable x-opencode-session can be used by clients that do not have a recognized native header, but replacing a recognized header with a new value on every request defeats its purpose.

What base URL should a manual Codex gateway use?

Use https://opencode.ai/inference/go for Go access and append the OpenAI Responses or Chat Completions path required by the gateway.

OpenAI-compatible Go paths
APIPath
Responses/openai/v1/responses
Chat Completions/openai/v1/chat/completions

Manual configuration should use a key from a Go-enabled workspace. The pay-as-you-go base URL has a different billing path and is not a drop-in replacement when the request must consume Go allowance.

Do not hard-code a model list from this guide. Query the official model catalog and choose a current chat model that supports tool calls and reasoning when the Codex workflow depends on them.

How do you verify OpenCode Go inside Codex?

Run a read-only prompt, confirm the expected model, check the workspace usage meter, and test a small reversible edit before using a production repository.

  1. 01

    Open Codex from the same user environment where setup was completed.

  2. 02

    Ask it to report the active provider and model.

  3. 03

    Run a read-only repository question.

  4. 04

    Check that the Console workspace shows the corresponding usage.

  5. 05

    Test one small reversible file change and review the diff before continuing.

Why does Codex not see the Go models?

Check the selected workspace, the setup command, the Go base URL, the current model catalog, and any proxy that may remove request headers.

  • Rerun the setup command if the selected workspace was wrong.
  • Confirm the workspace has active Go or Go Plus access.
  • Refresh the official model catalog instead of using stale model IDs.
  • Inspect proxy logs for dropped session headers without logging Authorization values.
  • Check the usage endpoint when calls succeed but capacity disappears unexpectedly.

Primary sources

Verify the current details

Product availability, model limits, pricing, and data terms can change. These primary sources are the authority for the facts on this page.

Next step

Choose the right Codex allowance

Go supports everyday agent work. Go Plus provides more included usage for sustained repository sessions.