- Published at
How to use DeepSeek API: π Getting Started with the DeepSeek API

The DeepSeek API provides access to Deepseek R1 and Zero, cutting-edge language models designed for reasoning, coding, and general chat tasks. Whether you're a developer, researcher, or business user, this guide walks you through how to generate an API key, authenticate requests, select the appropriate model, and make your first API call. With clear examples and links to resources, you'll be up and running with DeepSeek in minutes.
Table of Contents
- π₯ Model Downloads
- πΉ DeepSeek-R1 Models
- πΉ DeepSeek-R1-Distill Models
- Deepseek Open Platform
- π Step 1: Get an API Key
- π§ Step 2: Set Up Authentication
- π§ Step 3: Choose a Model
- π» Step 4: Make an API Call (Python Example)
- π§ͺ Step 5: Test with Tools like Apidog
- π Additional Resources
π₯ Model Downloads
DeepSeek models are freely available for download. You can host and run them on your own infrastructure. Below are the available versions and their resources:
πΉ DeepSeek-R1 Models
Model | Total Params | Activated Params | Context Length | Download |
---|---|---|---|---|
DeepSeek-R1-Zero | 671B | 37B | 128K | π€ HuggingFace |
DeepSeek-R1 | 671B | 37B | 128K | π€ HuggingFace |
Note: Both
DeepSeek-R1-Zero
andDeepSeek-R1
are trained on theDeepSeek-V3-Base
.
For detailed architecture information, please refer to the DeepSeek-V3 repository.
πΉ DeepSeek-R1-Distill Models
Model | Base Model | Download |
---|---|---|
DeepSeek-R1-Distill-Qwen-1.5B | Qwen2.5-Math-1.5B | π€ HuggingFace |
DeepSeek-R1-Distill-Qwen-7B | Qwen2.5-Math-7B | π€ HuggingFace |
DeepSeek-R1-Distill-Llama-8B | Llama-3.1-8B | π€ HuggingFace |
DeepSeek-R1-Distill-Qwen-14B | Qwen2.5-14B | π€ HuggingFace |
DeepSeek-R1-Distill-Qwen-32B | Qwen2.5-32B | π€ HuggingFace |
DeepSeek-R1-Distill-Llama-70B | Llama-3.3-70B-Instruct | π€ HuggingFace |
Note: The
DeepSeek-R1-Distill
models are fine-tuned versions of open-source models using output samples from DeepSeek-R1.
Some configurations and tokenizers have been modifiedβplease use DeepSeekβs provided settings for proper deployment.
Deepseek Open Platform
At same time you can access deepseek through Deepseek open platform.
π Step 1: Get an API Key
- Go to the DeepSeek Open Platform.
- Sign up or log in.
- Navigate to βAPI Keysβ from the sidebar.
- Click βCreate API Keyβ, name it if desired, and copy the key securely.
β οΈ Youβll only see the key once, so make sure to store it safely.
π§ Step 2: Set Up Authentication
Use Bearer Token authentication in your HTTP headers:
-
HTTP Header:
Authorization: Bearer YOUR_API_KEY
-
API Endpoint:
https://api.deepseek.com/v1/chat/completions
Ensure you include the Authorization header in all your API requests
π§ Step 3: Choose a Model
DeepSeek offers two primary models:β
-
deepseek-chat (V3): A general-purpose model trained on extensive text data, suitable for a wide range of tasks.
-
deepseek-reasoner (R1): Optimized for advanced reasoning, mathematics, and coding tasks. β Learn R, Python & Data Science Online
Specify your chosen model in the model parameter of your API request.β
π» Step 4: Make an API Call (Python Example)
Hereβs how to make a basic API call using Python:
url = "https://api.deepseek.com/v1/chat/completions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "Hello, DeepSeek!"}]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Replace YOUR_API_KEY
with your actual API key.
π§ͺ Step 5: Test with Tools like Apidog
For testing and debugging, you can use tools like Apidog:β
-
Install Apidog and create a new API request.
-
Set the HTTP method to POST.
-
Enter the API endpoint: https://api.deepseek.com/v1/chat/completions.
-
Configure headers:
-
Authorization: Bearer YOUR_API_KEY
-
Content-Type: application/json
-
-
Add the request body in JSON format:
{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "Hello, DeepSeek!"}]
}
- Send the request and observe the response.
π Additional Resources
Here are some useful links to learn more about DeepSeek and its ecosystem:
-
π DeepSeek GitHub Repository
Access source code, model weights, and documentation for DeepSeek models. -
π DeepSeek-R1 Evaluation
Detailed benchmarks comparing DeepSeek-R1 with other LLMs like GPT-4o. -
π DeepSeek V2 & V3 Models
Explore previous versions of DeepSeek, including improvements in architecture and capabilities. -
π DeepSeek Open Platform
Sign up to generate API keys, manage usage, and access model endpoints. -
π HuggingFace DeepSeek Models
Download models for offline or on-premise use. -
π DeepSeek on X (Twitter)
Follow for updates, community news, and release announcements.