← All integrations
Terminal coding agentOpenAI ResponsesVerified

Use DeepSeek V4 with Codex

Use DeepSeek V4 Flash in Codex through the DeepSeek-V4.io Responses API.

DeepSeek-V4.io is an independent API gateway, not the official DeepSeek website. A paid DeepSeek-V4.io key is required.

How the integration works

Current Codex clients use the Responses API for agentic tool loops. Configure a user-level custom provider, load the maintained model catalog, and keep the DeepSeek-V4.io API key in an environment variable.

One site key

Create and manage it on /developer.

OpenAI Responses

The client talks to its native compatible endpoint.

Upstream hidden

Provider credentials and routing stay on the server.

Before you start

  • Codex CLI 0.144.0 or newer
  • A paid DeepSeek-V4.io account with an API key from /developer
  • User-level access to ~/.codex/config.toml

Configure Codex

1.Install the maintained model catalog

Copy the printed absolute path into the next snippet. Codex requires an absolute model_catalog_json path and does not reliably expand ~ here.

CODEX_HOME_DIR="${CODEX_HOME:-$HOME/.codex}"
mkdir -p "$CODEX_HOME_DIR"
curl -fsSL https://deepseek-v4.io/codex/models.json -o "$CODEX_HOME_DIR/models.json"
printf 'Catalog path: %s\n' "$CODEX_HOME_DIR/models.json"
2.Add the custom provider to ~/.codex/config.toml
model = "deepseek-v4-flash"
model_provider = "deepseek_v4"
model_reasoning_effort = "high"
model_catalog_json = "/absolute/path/to/.codex/models.json"

[model_providers.deepseek_v4]
name = "DeepSeek-V4.io"
base_url = "https://deepseek-v4.io/api/v1"
env_key = "DEEPSEEK_V4_API_KEY"
wire_api = "responses"
3.Set the key and start Codex
export DEEPSEEK_V4_API_KEY="your-deepseek-v4-io-key"
cd /path/to/your/project
codex

Prefer to inspect the file first? Open the maintained models.json before downloading it.

Verify the setup

Verified against the public DeepSeek-V4.io gateway with Codex 0.147.0-alpha.1.2 on 2026-08-12.

  1. 1Confirm the startup banner shows deepseek-v4-flash.
  2. 2Ask Codex to read a file with a tool and summarize it without editing.
  3. 3Complete a full Responses tool loop: function call, tool result, follow-up request, and final answer.

Troubleshooting

Provider configuration is ignored

Put model_provider and model_providers in ~/.codex/config.toml. Codex ignores provider definitions in project-local .codex/config.toml files.

Codex asks for an OpenAI login

Confirm the provider id is deepseek_v4 and env_key is present under [model_providers.deepseek_v4]. Custom providers do not require OpenAI authentication by default.

Model metadata is missing

Download /codex/models.json and paste the printed absolute catalog path into model_catalog_json. Do not use ~ or a project-relative path.

The official guide mentions Moon Bridge

DeepSeek's generic Codex guide uses a forwarding layer because Codex requires the Responses API. DeepSeek-V4.io already exposes /api/v1/responses, so this gateway-specific setup connects Codex directly.

Sources and support boundary

Configuration fields are checked against the tool publisher's documentation. DeepSeek-V4.io owns this gateway guide and support for its endpoint; it does not represent the tool publisher.

Ready to connect Codex?

Create a DeepSeek-V4.io API key, copy the configuration above, and verify one read-only tool call before using it on a real project.