Start with the current DeepSeek API contract, then connect model selection to billing and account capacity. This guide brings the official reference, setup steps and operational checks together.
What DeepSeek offers through the API
DeepSeek provides hosted inference through interfaces compatible with OpenAI and Anthropic clients. The current Chat Completions entry point uses https://api.deepseek.com; its Anthropic-compatible interface has a separate base path. The current quickstart names deepseek-flash and deepseek-v4-pro. Official DeepSeek documentation.
Choose the interface that matches the application you are maintaining. For an existing Chat Completions integration, begin by configuring the DeepSeek base URL and credential explicitly. Keep the original provider configuration separate so changing an environment variable does not silently redirect unrelated jobs. For an Anthropic client, follow that interface’s request shape and feature mapping. Compatibility reduces integration work, but it does not establish identical behavior for every optional argument.
The service has changed across model generations. Current documentation distinguishes an accepted legacy alias from the model that actually serves its requests. That distinction matters when evaluating a migration: a successful response from an old identifier does not prove that the earlier model is still behind it. Keep the requested identifier alongside your test configuration and inspect the official migration notice before using a historical benchmark to justify a current choice. Official DeepSeek documentation.
Thinking mode is an explicit part of the current request contract. Its response handling and conversation rules deserve their own test, particularly when the application also calls tools. The official guide describes how reasoning-related fields accompany the final answer and when those fields must be preserved in subsequent requests. Start with the final answer your interface needs, then add the relevant state handling deliberately. Official DeepSeek documentation.
A useful evaluation includes a support question with an answer in supplied material, a coding task checked by your own tests, and a document task containing an intentionally missing fact. Those cases reveal different failure modes. Decide whether the application should decline, ask for clarification or return a partial result when the required evidence is absent. Save those expected behaviors before trying another model or changing the prompt.
Treat tools as application capabilities with their own permissions. A model-produced tool request is a proposal to your program; your program still decides which function exists and whether its arguments are acceptable. Record the tool result that was actually returned and make the next request from that state. The DeepSeek tool guide supplies the protocol details; your application must supply the business rules. Official DeepSeek documentation.
Build a small integration record as you proceed: selected interface, current model identifier, mode, output requirements, safe representative input and observed completion state. Add a link to the official feature documentation for each optional capability you use. That record makes later debugging and model replacement much easier than relying on a copied example whose assumptions were never written down.
Pricing at a glance
| Summary | Verified value |
|---|---|
| Lowest input price model | deepseek-flash |
| Input price | $0.3 per 1M tokens |
| Output price | $1.2 per 1M tokens |
| Free access | No universal ongoing free inference allowance was established in the last successful check. |
Last verified · Source ↗
Use the DeepSeek pricing guide to separate uncached input, cached input and output charges. The table preserves published conditional rates. Plan an ordinary run from the applicable standard condition, then evaluate any scheduling discount separately. Use the AI API cost calculator with your own request volume and output assumptions; the estimate is a planning calculation, not a statement of account balance.
Models available
| Model | Official identifier | Modalities | Context tokens | Input USD / 1M | Output USD / 1M | Status |
|---|---|---|---|---|---|---|
| deepseek-flash | deepseek-flash | text, image | 1,000,000 | $0.3 | $1.2 | Active |
| deepseek-v4-pro | deepseek-v4-pro | text | 1,000,000 | $1.32 | $3.96 | Active |
Last verified · Source ↗
Open DeepSeek model selection and naming for current identifiers and replacement considerations. Check the specific feature your application needs before comparing cost. If a record lacks verified metadata, treat that absence as a research task. A familiar family name is not sufficient evidence that a particular endpoint supports the same input types or optional controls.
Free tier and how to get a key
The official billing documentation was checked. No universal ongoing free inference allowance was established by that source. Promotional or account-specific credits require a check in your account. Read the official terms ↗
Last verified · Source ↗
The DeepSeek free-tier guide distinguishes an explicit account grant from a general promise of free inference. The public billing source alone does not establish a universal ongoing free allowance. Follow DeepSeek API key setup to create an account credential and verify the account’s billing condition before sending requests. Keep the first experiment small enough to inspect its usage afterward.
Rate limits and tiers
DeepSeek’s current admission control is described in terms of active concurrency at the account and model level. An additional key does not create an independent account allowance. Review DeepSeek concurrency and request handling before increasing worker counts. Official DeepSeek documentation.
For a queued application, measure how long requests remain active as well as how quickly new jobs arrive. A slow completion occupies capacity longer than a quick one. Separate the queue’s waiting time from provider response time so a capacity problem is not mistaken for model latency. Give expired work a clear cancellation or failure outcome instead of silently accumulating an unbounded backlog.
Service status
Use the official incident link when failures appear across several unrelated requests. A status declaration helps establish context, but your own account can still fail because of credentials, balance or request validation. Compare the safe error details with DeepSeek error causes and fixes before changing application behavior. Retain a request’s time and selected model when asking for support.
Start in 5 minutes
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["DEEPSEEK_API_KEY"],
base_url="https://api.deepseek.com")
response = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Explain a database index briefly."}],
extra_body={"thinking": {"type": "disabled"}},
)
print(response.choices[0].message.content)
This compact example uses the documented Chat Completions client configuration and explicitly selects non-thinking behavior. It prints the final answer; generated wording varies. Follow the complete DeepSeek Python tutorial for environment setup, usage inspection and a deliberate local configuration failure. Official DeepSeek documentation.
Run the example with a harmless prompt first. Confirm that the key belongs to the account you intended to use and inspect the result before putting the call inside a loop. Then replace the demonstration question with a representative task that has a checkable answer. Extend the working baseline one feature at a time, retaining a known passing example for comparison.
Recent changes
- DeepSeek · deepseek-v4-pro — MetadataRecord updated; consult the linked source for details. → Record updated; consult the linked source for details.Source ↗
- DeepSeek · deepseek-flash — MetadataModalities: ["text"] → Modalities: ["text","image"]Source ↗
- DeepSeek · deepseek-v4-pro — ValueNot previously recorded → Tier: account default · Metric: concurrency · Value: 500 · Notes: Account-wide active requests per model; not a requests-per-minute quota.Source ↗
- DeepSeek · deepseek-flash — ValueNot previously recorded → Tier: account default · Metric: concurrency · Value: 2500 · Notes: Account-wide active requests per model; not a requests-per-minute quota.Source ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: output · USD: 3.96 · Unit: per 1M tokens · Tier: peakSource ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: output · USD: 1.98 · Unit: per 1M tokens · Tier: off-peakSource ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: input · USD: 1.32 · Unit: per 1M tokens · Tier: peakSource ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: input · USD: 0.66 · Unit: per 1M tokens · Tier: off-peakSource ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: cached_input · USD: 0.044 · Unit: per 1M tokens · Tier: peakSource ↗
- DeepSeek · deepseek-v4-pro — Amount UsdNot previously recorded → Price category: cached_input · USD: 0.022 · Unit: per 1M tokens · Tier: off-peakSource ↗
Review changes in relation to your saved integration record. A new price, accepted alias or mode setting may require a different response than a model retirement. Rerun the affected evaluation cases and update the application’s configuration deliberately. A change log helps identify what moved; it does not substitute for the acceptance criteria of your own workload.
Frequently asked questions
Can I use the OpenAI SDK with DeepSeek?
Which DeepSeek model name should I start with?
Does an API key guarantee free requests?
Will adding keys increase throughput?
How should I compare thinking and non-thinking modes?
Where should I go when a valid call fails?
Sources
Last verified · Source ↗