DeepSeek API Key: How to Get One and Keep It Safe

You create a DeepSeek API key on the API keys page of the DeepSeek platform after signing up. Calls are paid from your account balance, so top it up before you use the key.

The API works with the OpenAI (ChatGPT) SDK: set the base URL to https://api.deepseek.com and pass your DeepSeek key.

Steps checked against DeepSeek's own docs in Nov 2026. Menus change, so if a screen looks different, follow the linked docs.

How to get a DeepSeek API key

  1. Sign up or sign in at platform.deepseek.com.
  2. Open the API keys page and create a new key.
  3. Copy it straight away and keep it somewhere safe, such as a password manager or your secret store.
  4. Save it as an environment variable called DEEPSEEK_API_KEY, as DeepSeek's quick start does.
  5. Add funds. DeepSeek deducts fees from your topped-up balance or any granted balance, and uses the granted balance first (pricing).

The API accepts OpenAI-format requests at https://api.deepseek.com and Anthropic-format requests at https://api.deepseek.com/anthropic, so most existing code only needs a new base URL and key.

Know where the data goes. DeepSeek's privacy policy says it collects, processes and stores personal data in the People's Republic of China, and that apps developers build on its open platform aren't covered by that policy. Check with your security lead before you send company or client data.

Check a key you already have

Not sure which service a key in your config belongs to, or whether you just pasted one somewhere? Paste it below to see what it is and how to revoke it.

Runs only in your browser. The check happens on this page. What you paste isn't sent anywhere, saved or logged, and the checker never contacts the provider. Want proof? Open your browser's network tab, or turn off Wi-Fi, and paste.

What a DeepSeek API key looks like

DeepSeek keys are sk- followed by 32 lowercase letters and digits, which is the shape the trufflehog DeepSeek detector looks for.

Other services also use sk- keys, so the checker on this page says "likely DeepSeek" unless the word deepseek appears next to the key.

How to store your DeepSeek API key safely

  • Keep the key in DEEPSEEK_API_KEY or a secret manager, never in your code.
  • If you use the OpenAI (ChatGPT) SDK, make sure your DeepSeek key and your OpenAI key live in different variables. Mixed-up keys are a common way one ends up in the wrong log or chat.
  • Never commit it to Git, and never ship it in website or app code where users can read it.
  • Keep only the balance you need, so a stolen key can't run up much spend.

Never paste your DeepSeek API key into an AI chat

It usually happens while debugging. The error sits next to a config file, you paste the whole thing into ChatGPT or Claude, and the key goes in with everything else.

Once it's sent, the key is stored on someone else's servers, in the chat history, and possibly in training data, depending on your account settings. Deleting the chat doesn't take it back, so treat any key you pasted as exposed and rotate it.

We wrote a step-by-step guide for that moment: what to do in the first hour after pasting an API key into ChatGPT. And if a tool you installed might have read your keys, see how to check whether your AI keys were exposed.

What to do if your DeepSeek API key leaks

Rotate first and investigate second. A key that no longer works can't be misused.

  1. Open the API keys page on the DeepSeek platform and delete the exposed key.
  2. Create a new key and update every app and script that used the old one.
  3. Check your usage and balance for calls you didn't make.

DeepSeek's API docs don't describe a key expiry or rotation feature, so rotating means deleting the old key and creating a new one.

How Sequirly catches keys at the paste

We build Sequirly, a browser extension that checks what you're about to send to ChatGPT, Claude, Gemini and other AI tools. When a prompt contains an API key, a password or other sensitive data, Sequirly warns you before it leaves your browser, so you can remove it and send the rest.

Sequirly holds an API key before it reaches ChatGPT, then flags customer data in the next prompt.

The check runs inside your browser, and Sequirly says it never sees, stores or sends the values it finds.

There's plenty it doesn't do, so you know where the gaps are:

  • It doesn't scan your code, repos or servers. Use a secret scanner such as gitleaks for that.
  • It doesn't revoke keys or check whether a key is live. Rotation is still on you.
  • It only knows keys by their shape, so a key with no prefix (like Mistral's) can slip past it, just as it slips past the checker above.
  • It warns before it blocks, so a person can still choose to send.

Curious how to test that claim yourself? Our post on whether Sequirly is safe to install walks through a network test you can run.

Common Questions

Is the DeepSeek API free?

No. DeepSeek API calls are paid from your account balance. DeepSeek may add a granted balance, which it uses before your topped-up funds.

Where do I get a DeepSeek API key?

You get a DeepSeek API key on the API keys page of the DeepSeek platform, platform.deepseek.com/api_keys, after creating an account.

Can I use the OpenAI (ChatGPT) SDK with a DeepSeek API key?

Yes. DeepSeek's API is OpenAI-compatible: set the base URL to https://api.deepseek.com and use your DeepSeek key.

What does a DeepSeek API key look like?

A DeepSeek API key is sk- followed by 32 lowercase letters and digits. Other providers use similar keys, so the format alone doesn't prove it's from DeepSeek.

Where does DeepSeek store data?

DeepSeek's privacy policy says it collects, processes and stores personal data in the People's Republic of China. It also says apps built on its open platform aren't covered by that policy.

Sources

Guides for other API keys

Catch the key before it leaves

If you'd like a warning the next time a key ends up in a prompt, try Sequirly now. Or if you'd rather talk it through with us first, book a quick demo.