<!-- Generated from public website sources; do not edit this file. -->

# API keys
Create, protect, and replace the key used to authenticate requests.

## Create a key
Sign in and open [Account → API keys](https://deepseeksub.com/account/keys). Choose a name, billing mode (Auto, Plan only or API credit only), and expiry (30, 90 or 365 days). Copy the key immediately; the complete value is shown only once. Up to 20 active keys are allowed per account. Keys access `deepseek-flash` and require an active plan or API credit.

## Store it securely
Treat the key like a password. Use an environment variable or a secret manager. Do not place it in source code, share it in screenshots, or commit it to a public repository.

On macOS or Linux, set a key in the current terminal session:

```sh
export CODING_PLAN_API_KEY="your-api-key"
```

On Windows PowerShell:

```powershell
$env:CODING_PLAN_API_KEY = "your-api-key"
```

These commands affect the current terminal session; opening a new terminal requires setting the variable again.

## Replace an exposed key
If a key has been exposed, revoke it in Account → API keys in your signed-in account. Create a replacement and update each application that uses the old key. Never post the key when asking for help.

## Troubleshooting
A 401 response usually means the key is missing, invalid, or revoked. Check that the correct key is being sent to the intended service endpoint. A key from the official DeepSeek platform and a key from this independent service may not be interchangeable.

---

HTML source: [API keys — DeepSeek Subscription Tutorials](https://deepseeksub.com/docs/api-keys/)
