DeepSeek API
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ Japanese
  • πŸ‡°πŸ‡· Korea
  • πŸ‡΅πŸ‡Ή Portuguese
  1. Start quickly
DeepSeek API
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ Japanese
  • πŸ‡°πŸ‡· Korea
  • πŸ‡΅πŸ‡Ή Portuguese
  • Start quickly
    • Your First API Call
    • Models & Pricing
    • The Temperature Parameter
    • Token & Token Usage
    • Rate Limit
    • Error Codes
  • API Reference
    • Introduction
    • Create Chat Completion
      POST
    • Create FIM Completion (Beta)
      POST
    • Lists Models
      GET
    • Get User Balance
      GET
  • API Guides
    • Reasoning Model (deepseek-reasoner)
    • Multiple rounds of conversations
    • Chat Prefix Completion (Beta)
    • FIM Completion (Beta)
    • JSON Output
    • Function Calling
    • Context Caching
  • FAQ
    • FAQ
  1. Start quickly

Your First API Call

The DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.
PARAMVALUE
base_url *https://api.deepseek.com
api_keyapply for an API key
* To be compatible with OpenAI, you can also use https://api.deepseek.com/v1 as the base_url. But note that the v1 here has NO relationship with the model's version.
* The deepseek-chat model has been upgraded to DeepSeek-V3. The API remains unchanged. You can invoke DeepSeek-V3 by specifying model='deepseek-chat'.
* deepseek-reasoner is the latest reasoning model, DeepSeek-R1, released by DeepSeek. You can invoke DeepSeek-R1 by specifying model='deepseek-reasoner'.

Invoke The Chat API#

Once you have obtained an API key, you can access the DeepSeek API using the following example scripts. This is a non-stream example, you can set the stream parameter to true to get stream response.

curl#


Next
Models & Pricing
Built with