deeptunnel
DeepSeek → Anthropic API proxy.
Run DeepSeek behind the Anthropic SDK, Claude Code, or any tool that speaks the Anthropic Messages API.
Install
pip install deeptunnel
The WASM proof-of-work solver (sha3_wasm_bg.wasm, ~26 KB) is downloaded
automatically from GitHub on the first run and cached in ~/.cache/deeptunnel/.
You can also place the file next to the script manually to skip the download.
Quick start
# 1. Set your DeepSeek bearer token
# Get it: browser DevTools → Network → any DeepSeek request → Authorization header
export DEEPSEEK_TOKEN="your-token-here"
# 2. Start the proxy
deeptunnel
# 3. In another shell, point the Anthropic SDK at it
export ANTHROPIC_BASE_URL="http://localhost:8765"
export ANTHROPIC_API_KEY="local-proxy-key"
claude # or any other Anthropic SDK client
Flags
| Flag | Default | Description |
|---|---|---|
--model fast |
✓ | Use the fast DeepSeek model (model_type="default") |
--model expert |
Use the expert model (model_type=null) |
|
--search |
✓ | Enable web search |
--no-search |
Disable web search | |
--think |
Enable thinking mode | |
--port PORT |
8765 |
Port to listen on |
deeptunnel --model expert --no-search --think --port 9000
Environment variables
| Variable | Default | Description |
|---|---|---|
DEEPSEEK_TOKEN |
required | Bearer token(s), comma-separated for rotation |
DEEPSEEK_COOKIES |
Optional cookie string | |
PROXY_PORT |
8765 |
Port override (CLI --port takes precedence) |
PROXY_MAX_SESSIONS |
64 |
Max cached DeepSeek sessions |
PROXY_MAX_HISTORY_MESSAGES |
40 |
Max history messages per prompt |
Multiple tokens (auto-rotation)
export DEEPSEEK_TOKEN="token1,token2,token3"
deeptunnel
Tokens rotate automatically when DeepSeek returns a "server busy" /
generation_timeout response.
How it works
- Receives Anthropic-format
/v1/messagesrequests. - Translates Anthropic tool definitions → XML schema in the prompt.
- Solves DeepSeek's proof-of-work challenge (via WASM).
- Forwards the request to
chat.deepseek.com. - Parses DeepSeek's plain-text response for
<tool_use>blocks. - Re-emits proper Anthropic
tool_use/textcontent blocks as SSE.
Manual WASM placement
If the automatic download fails (firewall, air-gapped environment), download
the file manually and place it in ~/.cache/deeptunnel/:
mkdir -p ~/.cache/deeptunnel
curl -L 'https://github.com/IMApurbo/deepseek_scrapper/blob/main/deepseek-cli/sha3_wasm_bg.wasm' \
-o ~/.cache/deeptunnel/sha3_wasm_bg.wasm
License
MIT © IMApurbo
Metadata
Release files for deeptunnel 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deeptunnel-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for deeptunnel-0.1.3-py3-none-any.whl |
Release files / deeptunnel-0.1.3-py3-none-any.whl
| Download URL | deeptunnel-0.1.3-py3-none-any.whl |
|---|---|
| Size | 33.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df5f64cc7f3706a16c9a3a218489949c2dcaba40a6f712edfdbcbaae8ef81cb0
|
|
BLAKE2b-256 checksum How to use checksums |
9ae2b131894dc085a0b495bfa63c4a741530c44ae57cae1f338b94ff409b8696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for deeptunnel 0.1.3
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.