DeepSeek AI

DeepSeek API

The DeepSeek API provides access to DeepSeek’s advanced language models, including DeepSeek-R1 and DeepSeek-Reasoner, through a developer-friendly interface that is largely compatible with the OpenAI API format.

Here’s how beginners can get started:

DeepSeek API Pricing

DeepSeek API Pricing

1. Create an Account and Get Your API Key

  • Sign up on the DeepSeek Open Platform or API portal.
  • Generate an API key from your account dashboard. Store this key securely; you won’t be able to view it again once you leave the page.

2. Understand the API Structure

  • The API uses endpoints similar to OpenAI’s, such as /v1/chat/completions for chat and /v1/reasoner/solve for step-by-step reasoning tasks.

Models:

  • Use deepseek-reasoner or deepseek/deepseek-r1 for advanced reasoning.
  • Use deepseek-chat for general chat tasks

3. Making Your First API Call

Basic cURL Example:

curl “https://api.deepinfra.com/v1/openai/chat/completions” \
-H “Content-Type: application/json” \
-H “Authorization: Bearer <YOUR_API_KEY>” \
-d ‘{
“model”: “deepseek-ai/DeepSeek-R1”,
“messages”: [
{“role”: “user”, “content”: “Hello!”}
]
}’

  • Replace <YOUR_API_KEY> with your actual key.
  • The response will be in JSON and include the model’s reply, token usage, and other metadata

How to Locally Host DeepSeek R1 for FREE?