DeepSeek v4
Source: Hacker News
The DeepSeek API uses a format compatible with OpenAI and Anthropic. By adjusting the configuration, you can use the OpenAI/Anthropic SDKs or any software that works with their APIs to access DeepSeek.
Configuration
- Base URL (OpenAI):
https://api.deepseek.com - Base URL (Anthropic):
https://api.deepseek.com/anthropic - API Key: Apply for an API key
Model options
deepseek-v4-flashdeepseek-v4-prodeepseek-chat(to be deprecated on 2026‑07‑24)deepseek-reasoner(to be deprecated on 2026‑07‑24)
The model names
deepseek-chatanddeepseek-reasonerwill be deprecated on 2026‑07‑24. For compatibility, they correspond to the non‑thinking mode and thinking mode ofdeepseek-v4-flash, respectively.
Invoke The Chat API
Once you have an API key, you can call the DeepSeek model using the OpenAI API format. The example below shows a non‑stream request; set "stream": true to receive a streaming response.
For Anthropic‑style requests, see the Anthropic API guide.
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"thinking": {"type": "enabled"},
"reasoning_effort": "high",
"stream": false
}'