DeepSeek API Tester

A free DeepSeek API key tester that runs in your browser. The request below is pre-filled to read your account balance — a call that generates nothing, costs nothing, and answers two questions at once: is this key valid, and is there any credit behind it? On this API those are separate failures with separate status codes, and the guide underneath explains how to tell them apart. Please read the credential note first.

Query parameters are appended to the URL when the request is sent.

Add Content-Type: application/json when you switch to a POST request.

Sent as Authorization: Bearer <token> — the scheme the DeepSeek API expects.

Base64-encoded and sent as Authorization: Basic.

Credentials are used only to sign this request. They are never logged or stored.

Body is ignored for GET and HEAD requests. Switch the method to POST to send a JSON payload.

No request sent yet.
Open the Auth tab, paste your key, and press Send.

See what an unauthenticated response looks like: — that one deliberately fails, so you can compare it with a successful call. Ctrl+Enter also sends.

Read this before you paste a live API key

  • Your request, key included, is relayed through api-tester.com's server. Browsers block a web page from reading another origin's response unless that origin opts in, and DeepSeek's API does not opt in for arbitrary sites. A browser-based tester therefore has to hand the request to a server and return the result. Ours is that server, so your key passes through our infrastructure on the way to DeepSeek.
  • Keys are not logged or stored by us. The credential signs the outbound request and is then gone; your request history stays in your own browser's local storage and is never uploaded. That is a commitment rather than something you can verify from outside, and you are entitled to treat it accordingly.
  • Use a key you created for testing, not the one your production service runs on. DeepSeek keys carry the whole account's access and balance, so treat any key as able to spend everything available.
  • If you are unsure about a key, rotate it. Deleting a key and creating a replacement takes a minute. Any key you have pasted into a third-party tool and feel uneasy about should simply be replaced.

If none of this sits right for a particular credential, build the request here with the key field empty, press Copy as cURL, and add the key on your own machine. You get the exact request and the secret never leaves your laptop.

How to test a DeepSeek API key

1. Create a key

Keys are issued from the DeepSeek platform once you have an account. A key is displayed in full only at the moment you create it, so copy it somewhere safe then.

2. Use the balance endpoint as your probe

The request pre-filled above is a GET to https://api.deepseek.com/user/balance. It requires authentication, produces no tokens and is not billed, which makes it the right smoke test. Unlike a models listing, it also reports whether the account is in a state to make paid calls at all.

3. Send the key as a bearer token

The Auth tab is already set to Bearer token; paste the key into the field. It is sent as Authorization: Bearer <key>. If that header is unfamiliar, the bearer token guide explains it and the usual ways it goes wrong: a missing Bearer prefix, a stray space, a truncated paste.

4. Send, and read the status code first

A 200 with a JSON body means the key is valid. Look at the body before moving on, because a valid key on an empty account is the commonest reason a first real request fails.

Valid key vs invalid key: what you'll see

Success returns an object with an is_available flag and a balance_infos array, one entry per currency, each splitting the total into granted and topped-up amounts.

GET https://api.deepseek.com/user/balance
Authorization: Bearer <your key>

200 OK → { "is_available": true,
           "balance_infos": [ { "currency": "…", "total_balance": "…",
                                "granted_balance": "…", "topped_up_balance": "…" } ] }

401    → { "error": { "message": "Authentication Fails, …",
                       "type": "authentication_error", "code": "invalid_request_error" } }

is_available: false on a 200 response is the case to notice: the key is recognised and the account cannot currently pay for a call. The amounts are returned as strings, not numbers, so compare them as decimals rather than with a string comparison.

Press the sample button under the console to see the unauthenticated case. With no Authorization header, DeepSeek answers 401 with a bare text line and no Content-Type; with a header carrying a wrong key, it answers 401 with the JSON error object above. A client that calls response.json() on every failure will therefore throw on the first kind. Check the status code before parsing.

Reading 401, 402 and 429 from the DeepSeek API

401 — authentication fails

The key was missing, malformed or not recognised. The error message echoes the last few characters of the key it received, which is a quick way to confirm you pasted the one you meant to. See 401 Unauthorized for the general case.

402 — insufficient balance

This is the status that surprises people arriving from other providers. DeepSeek uses 402 Payment Required when the account has run out of credit, where several OpenAI-compatible APIs fold the same condition into a 429. It is not a traffic problem and retrying will not help. Retry logic copied from an OpenAI client usually treats only 429 and 5xx as retryable, which happens to be correct here; just make sure a 402 is surfaced to a person, not swallowed.

429 and 503 — slow down, or wait

429 Too Many Requests means you are sending faster than the API will accept, and 503 means the service itself is overloaded. Both call for exponential backoff with jitter. The rate limiting guide covers the retry pattern.

400 and 422 — the request, not the key

A 400 means the body could not be read as the API expects, typically invalid JSON; run it through the JSON validator. A 422 means the JSON parsed and a parameter is wrong, most often a model name that does not exist. Compare it with your own /models listing.

Sending a chat request

Once the key checks out, the generation endpoint takes the request shape used by OpenAI's chat completions API: a model and a messages array.

POST https://api.deepseek.com/chat/completions
Authorization: Bearer <your key>
Content-Type: application/json

{
  "model": "<MODEL-ID-FROM-YOUR-LIST>",
  "messages": [
    { "role": "user", "content": "Say hello." }
  ]
}

Take the model identifier from your own GET /models response. We are not printing one here on purpose: names on this platform change, and a stale value on a page like this would mislead someone. To run the call in the console, pick /chat/completions from the endpoint list, add Content-Type: application/json in the Headers tab and paste the body into the Body tab. Unlike the balance check, this one is billed.

Using an OpenAI SDK

Because the request and response shapes match, the official OpenAI client libraries work against DeepSeek if you change two settings: the API key, and the base URL, to https://api.deepseek.com. If an SDK call fails and the same request succeeds here, the base URL is the first thing to check; a request that still goes to OpenAI with a DeepSeek key comes back 401 from the wrong company.

Long responses and this console

This tester gives up on a request after 30 seconds and shows one completed response, so it suits key checks and short prompts. A long generation, particularly from a reasoning model, can exceed that; a timeout here does not mean the API failed. Leave streaming off for tests in this console, then enable it in your own client.

Provider APIs change — check the official docs

api-tester.com is an independent tool with no affiliation to, partnership with or endorsement from DeepSeek. Nothing here is official documentation. Endpoints, model names, error wording and limits are the provider's to change, and this page can fall behind. For current and authoritative detail, consult the official DeepSeek API documentation.

We have deliberately not quoted prices, rate limits or model identifiers. Those change fastest, and a stale figure stated confidently is worse than none. What this page describes is the durable shape of the API: how it authenticates, how its errors are structured, and how to read them.

Test other providers and related tools

Frequently asked questions

How do I test whether my DeepSeek API key is valid?

Send a GET request to https://api.deepseek.com/user/balance with the key in an Authorization header using the Bearer scheme. A valid key returns 200 and a JSON object describing the account balance. An invalid one returns 401. The console at the top of this page is pre-filled for that request.

Does checking my balance cost anything?

No. The balance and models endpoints generate no tokens and are not billed. Only generation requests such as chat completions spend balance.

What does a 402 error from the DeepSeek API mean?

Insufficient balance. The key is valid, but the account has no credit left to pay for the request. Retrying will not help; the account needs topping up.

Is the DeepSeek API compatible with the OpenAI API?

The chat completions request and response use the same format, so OpenAI client libraries work when you set the base URL to https://api.deepseek.com and supply a DeepSeek key. Error codes and available features are DeepSeek's own, so do not assume every OpenAI parameter is supported.

Does my API key pass through your server?

Yes. Browsers block cross-origin reads, so the request is forwarded through api-tester.com's server, which means your key transits our infrastructure on the way to DeepSeek. We do not log or store keys, but you should use a key made for testing and delete it afterwards. To keep the secret local, build the request here without a key, copy it as cURL and add the key on your own machine.

Is this tool affiliated with DeepSeek?

No. api-tester.com is an independent HTTP request console with no affiliation to, partnership with or endorsement from DeepSeek. Check the official DeepSeek documentation for current endpoints and behaviour.