Skip to main content

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

Metadata

Release files for deepseek-proxy 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepseek-proxy 0.2.2
File Size Uploaded Provenance Actions
deepseek_proxy-0.2.2.tar.gz 12.9 kB Without provenance Details for deepseek_proxy-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deepseek-proxy 0.2.2
File Interpreter ABI Platform Actions
deepseek_proxy-0.2.2-py3-none-any.whl Python 3 none any Details for deepseek_proxy-0.2.2-py3-none-any.whl

Total release size: 25.3 kB

Release files / deepseek_proxy-0.2.2.tar.gz

Download URL deepseek_proxy-0.2.2.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dae4a8f3c55cc9f0fe82c629c1ed11bd1d331b125fda8f04fbe8f6c5985d46a1
BLAKE2b-256 checksum
How to use checksums
329bccb3fc69f78cf84dd6b510b40d084edf1ac1a4b031b34d75375bfa8dcae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / deepseek_proxy-0.2.2-py3-none-any.whl

Download URL deepseek_proxy-0.2.2-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd73191b8e2f4b957e2329f12829f1959d5e3c54b499eed9f3889e182e1550a9
BLAKE2b-256 checksum
How to use checksums
cdb7c0e56d519bc4e039b179fefae4926086f9e3a5515e00c9f2eac7eef5956c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for deepseek-proxy 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page