DeepSeek API: endpoints, authentication, models and limits
Connection details
| Base URL | https://api.deepseek.com |
| Auth | Bearer token via DEEPSEEK_API_KEY |
| OpenAI SDK compatible | Yes |
| SDKs | OpenAI SDK (Python, Node), raw HTTP |
Models and token pricing
| Model | Model ID | Context | In / 1M | Out / 1M |
|---|---|---|---|---|
| DeepSeek V4 Pro | deepseek-v4-pro-0813 | 1000K | $0.660 | $1.98 |
| DeepSeek R1 | deepseek-reasoner | 128K | $0.550 | $2.19 |
| DeepSeek V4.1 Flash | deepseek-flash | 1000K | $0.300 | $1.20 |
| DeepSeek V3 | deepseek-chat | 128K | $0.270 | $1.10 |
| DeepSeek V4 Flash | deepseek-v4-flash | 1000K | $0.140 | $0.280 |
Full pricing breakdown, including cached-input rates and tier comparisons: DeepSeek API pricing.
Call DeepSeek V3 through Swfte Connect
Swfte Connect is an OpenAI-compatible gateway. One Connect key reaches this model and the other providers Connect is credentialed for, with failover and cost tracking on the same endpoint. Prices below are the provider list prices from our model directory; see the AI model price index to compare them with every other model.
Connect also accepts your own provider keys and can be self-deployed (designed for, on request). See Connect providers and BYOK and self-deploying Connect.
DeepSeek V3
| Model ID on Connect | deepseek:deepseek-chat |
| Context window | 128K tokens |
| Input / 1M tokens | $0.270 |
| Output / 1M tokens | $1.10 |
curl https://api.swfte.com/agents/v2/gateway/chat/completions \
-H "Authorization: Bearer $SWFTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek:deepseek-chat",
"messages": [{"role": "user", "content": "Hello"}]
}'Swfte Connect · Connect pricing · AI FinOps. Other DeepSeek models in the table above are listed for reference and are not offered through Connect here.
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.
- Can I call DeepSeek V3 through Swfte Connect?
- Yes. Swfte Connect exposes DeepSeek V3 as deepseek:deepseek-chat behind one OpenAI-style chat completions endpoint (api.swfte.com/agents/v2/gateway). Create a Connect key and send the model ID in the request body. Other DeepSeek models in the table are listed for reference and are not offered through Connect on this page.
- Which models does the DeepSeek API expose?
- DeepSeek V4 Pro, DeepSeek R1, DeepSeek V4.1 Flash, 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.