DeepSeek API: endpoints, authentication, models and limits

Connection details

Base URLhttps://api.deepseek.com
AuthBearer token via DEEPSEEK_API_KEY
OpenAI SDK compatibleYes
SDKsOpenAI SDK (Python, Node), raw HTTP

Models and token pricing

ModelModel IDContextIn / 1MOut / 1M
DeepSeek R1deepseek-reasoner128K$0.550$2.19
DeepSeek V4 Prodeepseek-v4-pro1000K$0.435$0.870
DeepSeek V3deepseek-chat128K$0.270$1.10
DeepSeek V4 Flashdeepseek-v4-flash1000K$0.140$0.280

Full pricing breakdown, including cached-input rates and tier comparisons: DeepSeek API pricing.

What is distinctive about this API

  • Wire-compatible with the OpenAI chat completions API, so the official OpenAI SDKs work by changing base_url and the key — no client library swap.
  • Context caching is applied automatically on repeated prefixes rather than requiring an explicit cache-control block, and cache hits are billed at a steep discount.
  • Reasoning models return their chain of thought in a separate reasoning_content field, distinct from content, so you can log or discard it independently of the answer.
  • Weights for the open models are published under a permissive licence, so the same model can be self-hosted with vLLM or SGLang if data residency requires it.

Constraints worth knowing first

  • Reasoning-model output includes reasoning tokens in the billed output count; budget for materially more output tokens than the visible answer suggests.
  • Rate limits are applied per account rather than per key, so splitting keys across services does not raise the ceiling.
  • Capacity has historically been tighter during Asia-Pacific business hours; if you serve global traffic, plan a fallback route.

Frequently asked

What is the DeepSeek API base URL?
https://api.deepseek.com. Authenticate with a bearer token, conventionally read from the DEEPSEEK_API_KEY environment variable.
Is the DeepSeek API compatible with the OpenAI SDK?
Yes. The chat completions surface is wire-compatible, so the official OpenAI client libraries work by pointing base_url at https://api.deepseek.com and supplying a DEEPSEEK_API_KEY. No client library change is needed.
How do I get a DeepSeek API key?
Create an account with the provider and generate a key from the developer console, then expose it to your application as DEEPSEEK_API_KEY. Keys are secrets: keep them server-side, never in client bundles or committed config.
Which models does the DeepSeek API expose?
DeepSeek R1, DeepSeek V4 Pro, DeepSeek V3, DeepSeek V4 Flash. Context windows run to 1000K tokens.

Other provider APIs

DeepSeek publishes official documentation at https://api-docs.deepseek.com. Pricing and limits change; verify against the provider before committing to a budget.

Deploy a model with Swfte Connect

One gateway, every provider, per-token cost visibility. Swap models without touching your code.