3MH

DeepSeek API Tools

BY 3MH TECHNOLOGIES

Telegram : t.me/j49_c

Base URL: https://deepseek-pow.contact-3mh.workers.dev
All endpoints accept POST with Content-Type: application/json.

Chat Full Proxy

POST /api/chat

Solves PoW automatically, sends your message to DeepSeek, returns thinking + response.

Note: PoW is solved server-side with DeepSeek’s official WASM (~50ms). No client-side solving is needed; pow_response remains as an optional override.
ParamTypeRequiredDescription
promptstringYesYour message
tokenstringYesYour DeepSeek token — the worker keeps no account (get one via POST /api/login)
session_idstringNoReuse existing session
parent_message_idstringNoContinue from a message (multi-turn)
thinking_enabledboolNoEnable thinking (default: true)
search_enabledboolNoEnable web search (default: false)
system_promptstringNoOverride system instructions
modelstringNoModel name (if supported)
temperaturenumberNoSampling 0.0–2.0 (default: 1.0)
max_tokensnumberNoMax output tokens (default: 8192)
presence_penaltynumberNo-2.0 to 2.0 (new topics)
frequency_penaltynumberNo-2.0 to 2.0 (repetition)
pow_responsestringNoPre-solved PoW (base64)
{"prompt": "Hello!", "token": "YOUR_TOKEN"}

Response: (parent_message_id lets you continue the conversation)

{
  "session_id": "uuid",
  "parent_message_id": "uuid",
  "thinking": "The user said hello...",
  "response": "Hi there! How can I help?",
  "usage": {"prompt_tokens": 12, "completion_tokens": 34, "total_tokens": 46},
  "pow_time": "0.6s",
  "pow_difficulty": 144000,
  "method": "worker"
}

Chat Stream SSE

POST /api/chat/stream

Same as Chat but returns a Server-Sent Events stream for real-time responses.

{"prompt": "Tell me a joke", "token": "YOUR_TOKEN"}

Chat Session Conversation

POST /api/chat/session

Create a new DeepSeek chat session. Reuse its id for threaded history.

{"token": "YOUR_DEEPSEEK_TOKEN"}

Response: {"success": true, "session_id": "uuid", "title": "..."}

List: POST /api/chat/sessions/list (alias /api/chat/sessions; GET with ?token= also works)
Delete: POST /api/chat/sessions/delete with {"chat_session_id": "uuid"}

PoW Solve Core

POST /api/pow

Solves a DeepSeek PoW challenge. Returns the nonce answer.

ParamTypeDescription
challengestring64-char hex hash
saltstringRandom salt
difficultynumberNonce search space
expire_atnumberExpiration timestamp
signaturestringOptional signature
startnumberChunk mode: first nonce to try
countnumberChunk mode: nonces per request (max 1200)
{"challenge":"f9ee...4c06","salt":"ed95...dc8eb","difficulty":144000,"expire_at":1787692750574}
High difficulty (e.g. 144000): single-shot now solves fully via WASM (never a blind 503). Chunk mode (start/count) remains useful for incremental/parallel client implementations.

Batch PoW Bulk

POST /api/pow/batch

Solve multiple PoW challenges at once (max 10).

{"challenges": [
  {"challenge":"...","salt":"...","difficulty":144000,"expire_at":...},
  {"challenge":"...","salt":"...","difficulty":100000,"expire_at":...}
]}

Login Auth

POST /api/login

Authenticate with DeepSeek and get a token.

{"email": "you@email.com", "password": "your_pass"}

Response: {"success": true, "token": "..."}

File Upload Utility

POST /api/upload

Upload a file (text/image/PDF/audio) to DeepSeek. Images are forked to the vision model automatically.

Params: filename (string, optional), file_data (data URL or base64), file_url (public https URL, alternative)

{"filename": "report.txt", "file_data": "data:text/plain;base64,SGVsbG8="}

Response: {"ok":true, "file":{"file_id":"file-xxx"}, "vision_file_id":"file-yyy"}

Check status: POST /api/upload/status {"file_ids":["file-xxx"]}

OpenAI-Compatible v1 API

Full OpenAI/Anthropic-compatible endpoints. Every request carries your own DeepSeek token.

EndpointFormatDescription
POST /v1/chat/completionsOpenAIChat with tools, file parts, web search
POST /v1/messagesAnthropicClaude-shaped with tools + files
POST /anthropic/v1/messagesAnthropicAlias of /v1/messages
POST /v1/messages/count_tokensAnthropicToken estimation (~4 chars/tok)
POST /v1/responsesOpenAIResponses API with instruction + tools
GET /v1/modelsOpenAIList available models
GET /v1/models/refreshOpenAIDrop the cache and re-fetch models

Auth: token in body, Authorization: Bearer, or x-deepseek-token header — required on every request.

{"model":"deepseek-chat","messages":[{"role":"user","content":"Hi"}],"stream":false}

Quick Examples

cURL — Solve PoW:

curl -X POST https://deepseek-pow.contact-3mh.workers.dev/api/pow \
  -H "Content-Type: application/json" \
  -d '{"challenge":"...","salt":"...","difficulty":144000,"expire_at":1787692750574}'

cURL — Chat:

curl -X POST https://deepseek-pow.contact-3mh.workers.dev/api/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Hello!"}'
# The worker holds no account — a DeepSeek token is always required.

cURL — File upload:

curl -X POST https://deepseek-pow.contact-3mh.workers.dev/api/upload \
  -H "Content-Type: application/json" \
  -d '{"filename":"report.txt","file_data":"data:text/plain;base64,SGVsbG8="}'
# Then chat with it: {"prompt":"summarize the file","files":["<file_id>"]}"

Python:

import requests
r = requests.post("https://deepseek-pow.contact-3mh.workers.dev/api/chat", json={
    "prompt": "What is 2+2?",
    "token": "YOUR_TOKEN"
})
print(r.json()["response"])

Raw Documentation

Full system prompt and API documentation in plain text format (like GitHub raw files).

/raw — System Prompt & Full Docs

Also routed: legacy GET /get_pow?authorization=<token> (Telegram-bot PoW shape), GET /api/relay-debug (PoW-solver probe), GET /health (liveness).

Rate Limits

/api/pow, /api/pow/batch and /get_pow: 600 requests/min (chunked solving needs many parallel requests). All other endpoints: 60 requests/min per IP. Exceeding returns 429. Tune with worker vars POW_RPM (default 600) and RATE_LIMIT_RPM (default 60).