DeepSeek
DeepSeek integration allows your product to connect with DeepSeek's API (an OpenAI-compatible API) to perform tasks like chat completion, reasoning, code generation, and more using DeepSeek models such as deepseek-chat or deepseek-reasoner.
Credentials Needed
- DeepSeek API Key — this is the bearer token you use in your HTTP requests.
There's no separate client secret, tenant ID, or OAuth flow currently documented — the API is keyed by a single token.
Permissions / API Access
DeepSeek uses Bearer authentication; you must supply the API key in the Authorization: Bearer <API_KEY> header.
There are no scopes or granular permission sets documented; the API key gives access to whatever your DeepSeek account entitlements are.
Creating / Managing API Key
- Sign up / log in to the DeepSeek API platform at their portal.
- Navigate to the API Keys section in your account dashboard.
- Create a new secret / API key. Optionally give it a name for your own reference.
- Copy the key once — you may not be able to view it again later.
- Optionally, in some setups, you may manage or revoke existing keys via that interface.
Test Connectivity
Use curl or your preferred HTTP client to verify the key works:
curl https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer <YOUR_DEEPSEEK_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"messages": [
{ "role": "user", "content": "Hello, DeepSeek!" }
]
}'
If the request returns a valid JSON response with generated content, the connection is successful.
You can also adapt any OpenAI-compatible SDK by setting the base_url to https://api.deepseek.com and passing your DeepSeek API key in place of OpenAI's key.
Save the Results in the Platform and Create Connection
- In your product's integration module, securely store the
DEEPSEEK_API_KEY. - Also store optional info like
base_url(e.g.https://api.deepseek.com) and defaultmodelnames (e.g.deepseek-chat,deepseek-reasoner). - Create a connector entry (e.g., "DeepSeek Integration").
- As part of setup/validation, run a test call (like the above) to verify the key works and you can fetch a response.
- Capture any metadata you like (e.g., model names supported, version info) for your product's UI.
Best Practices
- Use the principle of least privilege: even though DeepSeek API keys don't appear to support scopes, limit usage of the key to the minimum models or endpoints you need.
- Store API keys securely — in your secret vault, encrypted storage, not in version control.
- Rotate API keys regularly and revoke keys that are no longer in use.
- Monitor usage and errors to detect misuse or rate limit issues.
- Use retries and backoff logic in the client when encountering transient errors (e.g., HTTP 5xx).
- Allow base_url override so you can point to alternate endpoints or test environments.
- Gracefully handle unauthorized (401) responses — e.g., notify user to check their key.
- Cache static metadata or model info to avoid repeated API calls.
- Log requests and responses (safely, without including sensitive content or full prompts) for debugging and auditing.