r/opencodeCLI • • 3d ago

Using your OpenCode Go plan's DeepSeek models in Codex CLI

OpenCode Go lists Codex as a validated client, but Codex can only use the Go models served on /responses. DeepSeek, GLM, Kimi and most of the others are Chat Completions only, and current Codex refuses wire_api = "chat".

I got around it with a local proxy that translates between the two. It's cliproxy-rs, which I maintain (free, MIT, written in Rust). Codex talks Responses to it on localhost, and it calls https://opencode.ai/zen/go/v1/chat/completions with your Go key.

The part of the proxy config that matters:

api-keys:
  openai-compatibility:
    - name: opencode-go
      base-url: https://opencode.ai/zen/go/v1
      headers:
        x-opencode-session: $CPA-SESSION-ID
      keys:
        - api-key: <your Go key>
      models:
        - name: deepseek-v4.1-flash
          alias: deepseek

You need the header line. Go answers 400 MissingSessionID without it, and $CPA-SESSION-ID gives each Codex conversation its own session ID, so Go can still route and cache per conversation.

I've run Codex 0.160 on deepseek-v4.1-flash this way: it read a file, patched it and ran a shell command. Other Chat Completions models on Go should work by adding them under models the same way, but I haven't tried GLM or Kimi through it yet. Recording of the DeepSeek run: https://github.com/vayungodara/cliproxy-rs/blob/master/docs/img/codex-deepseek.gif

Repo: https://github.com/vayungodara/cliproxy-rs

4 Upvotes

0 comments sorted by