Skip to main content

Translate OpenAI Responses API ↔ DeepSeek Chat Completions API for codex

Project description

DeepSeek Proxy

Translate OpenAI Responses API (/v1/responses) requests into DeepSeek Chat Completions API calls — so codex (Claude Code CLI) can use DeepSeek as its backend model.


Install

pip install deepseek-proxy

Usage

# Set your API key
export DEEPSEEK_API_KEY=sk-your-key-here

# Start proxy (foreground)
deepseek-proxy

# Or start as a daemon (background)
deepseek-proxy start --daemon

# Stop the daemon
deepseek-proxy stop

# Restart
deepseek-proxy restart

# Custom host/port
deepseek-proxy --host 0.0.0.0 --port 8080 start --daemon

The proxy listens on http://127.0.0.1:8787 by default.

Configure codex

Point codex to the proxy via ~/.codex/config.toml:

Add to ~/.codex/config.toml:

model = "deepseek-v4-flash"
model_provider = "deepseek"

[model_providers.deepseek]
name = "DeepSeek"
base_url = "http://127.0.0.1:8787/v1"
env_key = "DEEPSEEK_API_KEY"
wire_api = "responses"

Field reference:

Field Value Description
model "deepseek-v4-flash" Default model for codex
model_provider "deepseek" Matches the provider section name
base_url "http://127.0.0.1:8787/v1" Proxy endpoint (no /responses suffix)
env_key "DEEPSEEK_API_KEY" Env var for the API key
wire_api "responses" Required value for this proxy

Verify

curl -X POST http://127.0.0.1:8787/v1/responses \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":[{"role":"user","content":[{"type":"input_text","text":"hello"}]}],"model":"deepseek-v4-flash"}'

Why?

codex uses the OpenAI Responses API natively. DeepSeek provides a Chat Completions API. The two protocols are incompatible — this proxy bridges the gap.


GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepseek_proxy-0.1.9.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepseek_proxy-0.1.9-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file deepseek_proxy-0.1.9.tar.gz.

File metadata

  • Download URL: deepseek_proxy-0.1.9.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for deepseek_proxy-0.1.9.tar.gz
Algorithm Hash digest
SHA256 f700e734fb38b77ad59c7faf83094b4c55a0c1f8c2e072faf2e79e010b57c0da
MD5 5ccd70c9b7f8ff3256dfc493545669d3
BLAKE2b-256 c2a6c34f73e6de784b7afcacabe048261e535dee9b47016ee0a69f1dd806e8e2

See more details on using hashes here.

File details

Details for the file deepseek_proxy-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: deepseek_proxy-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for deepseek_proxy-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8bec40c73960348ac1f55e64fda9f1cb726af5abff8449b4d7812694da056a20
MD5 f1257538a265821507a592f48b7f5925
BLAKE2b-256 1fea30d073a61d1862b7c9f96ff9548e6b3849b22f57a54f30b6a31cdc593e49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page