Skip to main content

deeptunnel

DeepSeek → Anthropic API proxy.
Run DeepSeek behind the Anthropic SDK, Claude Code, or any tool that speaks the Anthropic Messages API.

PyPI Python


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

  1. Receives Anthropic-format /v1/messages requests.
  2. Translates Anthropic tool definitions → XML schema in the prompt.
  3. Solves DeepSeek's proof-of-work challenge (via WASM).
  4. Forwards the request to chat.deepseek.com.
  5. Parses DeepSeek's plain-text response for <tool_use> blocks.
  6. Re-emits proper Anthropic tool_use / text content 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

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

deeptunnel-0.1.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file deeptunnel-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deeptunnel-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for deeptunnel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 181d1b26df2dc6615c386dc1ad1e10f6da02aa555dff2d49be6d0052a63fb0b4
MD5 6da92d0fa540153a22bba67101c4f077
BLAKE2b-256 ba113285325927f7e2d1bd91884d5b2599d6a4e853105cc734fe55fdec85151d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Supported by

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