Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Setup guide - Documented by DeepSeek

Use DeepSeek in Codex CLI

DeepSeek publishes a Codex integration that uses DeepSeek's native Responses API support. You add a [model_providers.deepseek] section to ~/.codex/config.toml with wire_api = "responses", plus a ~/.codex/models.json model catalog, either with a one-click setup script or by hand. The same config also covers the ChatGPT desktop app and the Codex IDE extension.

Last verified 5 steps3 official sources

Steps

  1. Step 1.

    Make sure Codex CLI (or the ChatGPT desktop app) is installed and has been launched at least once, so that ~/.codex exists. Option 1 (recommended): run DeepSeek's setup script, choose menu option 1 (deepseek-flash) or 2 (deepseek-v4-pro) and enter your API key (it starts with sk-). macOS / Linux:

    Terminal
    bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)
  2. Step 2.

    Windows (PowerShell):

    Terminal
    irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
  3. Step 3.

    Option 2 (manual), part 1: create ~/.codex/models.json with the full model catalog given on DeepSeek's Codex page. It declares the deepseek-flash and deepseek-v4-pro entries (context_window 1048576, supported reasoning levels low/high/max, minimal_client_version "0.144.0"). The JSON is long, so copy it from the source page.

  4. Step 4.

    Option 2 (manual), part 2: edit ~/.codex/config.toml (create it if it does not exist) and add the following, with your API key as experimental_bearer_token. If config.toml already has a [desktop] section, put enabled-reasoning-efforts in that section rather than adding a second one, because a duplicate section makes the file invalid.

    TOML
    model = "deepseek-flash"
    model_provider = "deepseek"
    preferred_auth_method = "apikey"
    forced_login_method = "api"
    model_reasoning_effort = "high"
    web_search = "disabled"
    show_raw_agent_reasoning = true
    model_catalog_json = "~/.codex/models.json"
    
    [model_providers.deepseek]
    name = "deepseek"
    base_url = "https://api.deepseek.com/"
    wire_api = "responses"
    experimental_bearer_token = "<your DeepSeek API Key>"
    
    [desktop]
    enabled-reasoning-efforts = ["low", "medium", "high", "xhigh", "ultra", "max"]
  5. Step 5.

    Go to your project and run codex. The config is working if the startup banner shows model: deepseek-flash.

    Terminal
    cd /path/to/my-project
    codex

Caveats

  • The script backs up ~/.codex/config.toml to ~/.codex/backup-deepseek/. Menu option 9 restores the default Codex configuration.
  • Codex keeps session history separately for each login method, so sessions from a ChatGPT subscription are hidden while DeepSeek is configured (nothing is deleted).
  • The API key is stored in plain text in config.toml (experimental_bearer_token).
  • Only deepseek-flash accepts image input (input_modalities includes image). deepseek-v4-pro does not support vision.
  • Re-running the script removes older deepseek-v4-flash / deepseek-v4-flash-vision-exp entries and leaves only deepseek-flash and deepseek-v4-pro.

FAQ

How do I use DeepSeek in Codex CLI?

DeepSeek publishes a Codex integration that uses DeepSeek's native Responses API support. You add a [model_providers.deepseek] section to ~/.codex/config.toml with wire_api = "responses", plus a ~/.codex/models.json model catalog, either with a one-click setup script or by hand. The same config also covers the ChatGPT desktop app and the Codex IDE extension.

Which DeepSeek model ids work in Codex CLI?

The official docs read for this guide list deepseek-flash and deepseek-v4-pro. Requests go to https://api.deepseek.com/.

Is this an official DeepSeek and Codex CLI setup?

DeepSeek documents this setup in its own docs. It was last checked against 3 official pages on October 17, 2026.

Sources

Last verified against 3 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.