Beginner ⏱ 15 min
DeepSeek-V4 Quick Start
Get started with V4 Pro and Flash in 5 minutes. Set up an API key, pick V4 Pro or Flash, and run your first chat completion.
This tutorial helps you complete your first DeepSeek V4 API call in about 5 minutes.
Prerequisites
- A DeepSeek API key from platform.deepseek.com
- Python 3.8+ or any HTTP-capable runtime
Step 1: Install the SDK
pip install openai
The DeepSeek API is fully OpenAI-compatible — you only need to change base_url.
Step 2: Send Your First Message
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.deepseek.com/v1"
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{"role": "user", "content": "Hello, DeepSeek V4!"}
]
)
print(response.choices[0].message.content)
Step 3: Choose the Right Model
- deepseek-v4-pro: Complex reasoning, long documents, code generation
- deepseek-v4-flash: Fast chat, simple tasks, high-concurrency workloads
Next Steps
Read API Integration for streaming, function calling, and error handling.