DeepSeek offers a powerful API platform for accessing advanced AI models. Understanding the pricing structure is crucial for effectively utilizing these resources. This article provides a detailed overview of DeepSeek API's pricing model, helping you plan your usage and estimate costs.
DeepSeek API pricing is based on tokens. A token represents the smallest unit of text the model processes, which can be a word, number, or punctuation mark. You are billed for both input tokens (the text you send to the API) and output tokens (the text the model generates). Therefore, grasping token usage is key to managing costs. For more information on token usage, check out the DeepSeek API documentation.
The following table breaks down the pricing for different DeepSeek models. Note that the following considerations apply to it:
USD Pricing
Model | Context Length | Max CoT Tokens | Max Output Tokens | Input Price (Cache Hit) / 1M Tokens | Input Price (Cache Miss) / 1M Tokens | Output Price / 1M Tokens |
---|---|---|---|---|---|---|
deepseek-chat | 64K | - | 8K | $0.07 | $0.27 | $1.10 |
deepseek-reasoner | 64K | 32K | 8K | $0.14 | $0.55 | $2.19 |
CNY Pricing
Model | Context Length | Max CoT Tokens | Max Output Tokens | Input Price (Cache Hit) / 1M Tokens | Input Price (Cache Miss) / 1M Tokens | Output Price / 1M Tokens |
---|---|---|---|---|---|---|
deepseek-chat | 64K | - | 8K | ¥0.5 | ¥2 | ¥8 |
deepseek-reasoner | 64K | 32K | 8K | ¥1 | ¥4 | ¥16 |
The overall expense is calculated by simply multiplying the number of tokens by the corresponding price per token, as:
Expense = (Number of Tokens) * (Price per Token)
Fees are deducted from your topped-up or granted balance, with the granted balance being used first when both are available.
max_tokens
parameter to limit output length and prevent unexpected costs. The default maximum output length is 4K.Understanding DeepSeek API's pricing structure empowers you to effectively leverage its AI capabilities while managing your costs. By paying attention to token usage, context length, and available optimization techniques like context caching, you can maximize the value you receive from the platform. For futher details, you can take a look at the official DeepSeek API documentation.