TTodAPI

DeepSeek

DeepSeek API key

One key calls DeepSeek — and every other model on the gateway. It is a bearer token: create it once, keep it server-side, and put it in an Authorization header.

Create it

  1. Register at todapi.work/register.
  2. Open the console → API keys → Create key.
  3. Copy the value immediately — it is shown once.
  4. Store it as an environment variable, never in a repository.
export TODAPI_KEY="sk-..."

Use it

curl https://todapi.work/v1/chat/completions \
  -H "Authorization: Bearer $TODAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "ping"}]}'

The same key works with any OpenAI SDK — set base_url to https://todapi.work/v1. See the model page for Python and Node samples.

The three 401s people actually hit

CauseFix
Trailing newline copied with the keyecho -n "$TODAPI_KEY" | wc -c and compare with the key length
Missing or lowercase schemeAuthorization: Bearer … — capital B, one space
Key revoked or rotatedCreate a new key; old ones stop working immediately

Full error reference: 429, 402, and the table in the model pages.

How keys relate to balance

Keys are per account, balance is shared. Two keys on one account spend from the same prepaid USD pool, which is convenient for splitting staging and production — and dangerous if one of them runs a batch job overnight. Watch GET /v1/usage per key.

Is there a free DeepSeek key?

DeepSeek has run promotional free tiers; this gateway does not. What you get instead is the rate: $0.0252 / 1M input and $0.1008 / 1M output, which is 83% below DeepSeek's own list price. A few dollars of balance lasts a long time — see the pricing breakdown.

Rotating a key safely

  1. Create the new key first; keep both valid for a short overlap.
  2. Deploy the new value to your secret store.
  3. Confirm traffic succeeds on the new key.
  4. Revoke the old one. If it leaked, revoke first and accept the brief outage.

FAQ

How do I get a key?

Register, then create one in the console. No approval step, no sales call.

Why does my key work in curl but not in my app?

Usually the environment variable includes quotes or a newline. Print its length, not its value.

Can I restrict a key to one model?

Model access follows the key's group. List what it can reach with GET /v1/models.

DeepSeek pricing

$0.0252 / $0.1008 per 1M — 83% below list.

Model page

Code samples and limits.

Rate limits

What 429 means and how to back off.