DeepSeek API: Complete Developer Guide to Models, Pricing, Keys, and First Requests

Last verified: October 7, 2026

The DeepSeek API is DeepSeek’s developer platform for calling DeepSeek models from your own apps, scripts, agents, coding tools, and backend services. It is different from simply using the DeepSeek app or web chat. To use it, you need a DeepSeek API key, you authenticate with Bearer Auth, and you choose a current DeepSeek model ID such as deepseek-flash or deepseek-v4-pro.

DeepSeek currently supports two main API formats: an OpenAI-compatible format at https://api.deepseek.com and an Anthropic-compatible format at https://api.deepseek.com/anthropic. That means many OpenAI- or Anthropic-compatible SDKs and tools can be configured to use DeepSeek by changing the API key, base URL, and model name. DeepSeek Models & Pricing

The current API model names matter. DeepSeek’s model table lists deepseek-flash as DeepSeek-V4.1-Flash and deepseek-v4-pro as DeepSeek-V4-Pro-0813. DeepSeek also says the legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted, but the old models are retired and those requests are served by DeepSeek-V4.1-Flash and billed at Flash price. DeepSeek Models & Pricing

This guide covers API keys, base URLs, current models, pricing, first requests in cURL, Python, and Node.js, the main API surfaces, core features, rate limits, error codes, key security, privacy considerations, and the old model-name mistakes that can break new projects.

What is the DeepSeek API?

The DeepSeek API is the developer interface for using DeepSeek models programmatically. Instead of typing into the DeepSeek app, you send HTTP requests from your application and receive model responses that your software can display, store, validate, or use in a workflow.

Use the DeepSeek API when you want to build:

  • AI chat features inside an app.
  • Backend summarization, classification, or extraction workflows.
  • RAG systems over documents or knowledge bases.
  • Coding assistants or agent workflows.
  • Image-and-text analysis using deepseek-flash.
  • Structured JSON output for databases and automations.
  • Tool-calling workflows where your app executes functions.
  • Anthropic-compatible or OpenAI-compatible agent integrations.

The API is not the same thing as the free consumer app. API usage is token-priced, requires an API key, and has its own model names, billing, limits, error codes, and production concerns.

DeepSeek API vs DeepSeek app

Before building, separate the consumer product from the developer product.

LayerWhat it isWho it is forWhat to verify
DeepSeek app / web chatA consumer-facing AI assistant experience.People who want to chat with DeepSeek directly.Availability, login, app limits, privacy settings, and whether it fits your personal use case.
DeepSeek APIA developer platform for calling DeepSeek models from software.Developers, startups, backend teams, AI product builders, and agent developers.API key, base URL, model ID, token pricing, rate limits, privacy, and production reliability.
DeepSeek open-weight modelsModel checkpoints available through model cards such as Hugging Face.Researchers, local inference users, self-hosting teams, and model evaluators.License, hardware, serving stack, security, and whether the model matches the hosted API behavior.
Agent integrationsConfiguration paths for tools such as Claude Code, Codex, OpenCode, and DeepSeek Harness.Developers using existing coding-agent tools.Mapping rules, billing model, model name, context settings, and extra costs from tool use.

If you are building software, start with the API docs and current Models & Pricing page, not screenshots from the app or old R1-era tutorials.

Quick start: API key, base URL, and model name

For a basic DeepSeek API integration, you need three things: an API key, a base URL, and a current model ID.

ItemCurrent value or rulePractical note
API keyCreate a DeepSeek API key from the DeepSeek Platform.Use this key as a Bearer token. Do not use an OpenAI key.
AuthenticationAuthorization: Bearer ${DEEPSEEK_API_KEY}DeepSeek’s API reference lists HTTP Bearer Auth.
OpenAI-format base URLhttps://api.deepseek.comUse this with OpenAI-compatible clients.
Anthropic-format base URLhttps://api.deepseek.com/anthropicUse this with Anthropic-compatible clients and tools.
Recommended current Flash modeldeepseek-flashDeepSeek identifies this as DeepSeek-V4.1-Flash.
Current Pro modeldeepseek-v4-proHigher-cost Pro route; verify current pricing and fit before production use.

DeepSeek’s API reference says you must create an API key first, and the authentication scheme is HTTP Bearer Auth. DeepSeek API reference

Current DeepSeek API models

DeepSeek’s current public model table centers on deepseek-flash and deepseek-v4-pro. Use those names in new examples unless DeepSeek’s current docs say otherwise.

Model IDModel versionBest starting use caseImportant notes
deepseek-flashDeepSeek-V4.1-FlashDefault starting point for most new API projects, cost-sensitive workloads, high-throughput apps, multimodal/image input, and long-context workflows.Supports Thinking Mode, JSON Output, Tool Calls, Responses API, Anthropic API, Chat Prefix Completion, FIM in non-thinking mode, and Vision.
deepseek-v4-proDeepSeek-V4-Pro-0813Harder reasoning, coding, or agent tasks where your own tests show Pro is worth the higher cost.Supports Thinking Mode, JSON Output, Tool Calls, Responses API, Anthropic API, Chat Prefix Completion, and FIM in non-thinking mode. Vision is not supported in the current model table.
deepseek-v4-flashLegacy V4 Flash nameCompatibility only.DeepSeek says the old model is retired; requests are served by DeepSeek-V4.1-Flash and billed at Flash price.
deepseek-v4-flash-vision-expLegacy V4 Flash Vision experimental nameCompatibility only.Do not use as the default in new code; use deepseek-flash.
deepseek-chatOld general chat alias in older tutorialsDo not use as a new default unless current docs explicitly support your case.Many old tutorials are outdated.
deepseek-reasonerOld R1-era reasoning alias in older tutorialsDo not use as a new default unless current docs explicitly support your case.Current API work should start from the current model table.

This is one of the most important production details. Old articles may tell you to use deepseek-chat, deepseek-reasoner, or deepseek-v4-flash. For new code, check the current DeepSeek Models & Pricing page and keep model IDs in configuration so you can update them without editing application logic.

DeepSeek API pricing and billing

DeepSeek API pricing is token-based and separate from the consumer app. The pricing page lists prices per 1M tokens and separates cache-hit input, cache-miss input, and output tokens. DeepSeek also uses peak and off-peak rates. DeepSeek Models & Pricing

ModelInput cache hitInput cache missOutputConcurrency limitPractical note
deepseek-flash off-peak$0.003 / 1M tokens$0.15 / 1M tokens$0.60 / 1M tokens2500Lowest-cost current hosted model in the table.
deepseek-flash peak$0.006 / 1M tokens$0.30 / 1M tokens$1.20 / 1M tokens2500Peak prices are double off-peak prices.
deepseek-v4-pro off-peak$0.022 / 1M tokens$0.66 / 1M tokens$1.98 / 1M tokens500Higher-cost Pro route for workloads where Pro improves results enough to justify cost.
deepseek-v4-pro peak$0.044 / 1M tokens$1.32 / 1M tokens$3.96 / 1M tokens500Peak prices are double off-peak prices.

DeepSeek says off-peak rates are half of peak rates. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday, excluding Chinese public holidays. All other hours are off-peak. The pricing page also says the expense equals number of tokens multiplied by price, and fees are deducted from topped-up or granted balance, with granted balance used first when both balances are available. DeepSeek Models & Pricing

Do not call the API free just because some token prices are low. Before production use, estimate input tokens, output tokens, cache-hit rate, peak/off-peak traffic, retries, and image tokens if using vision. For balance checks and cost tracking, see our DeepSeek API billing guide.

First DeepSeek API call with cURL

Use cURL first if you want to verify that your key, model, and base URL work before adding SDK complexity.

curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
  -d '{
    "model": "deepseek-flash",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello! Explain the DeepSeek API in one sentence."}
    ],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "high",
    "stream": false
  }'

This uses the OpenAI-compatible Chat Completions format. The key must be a DeepSeek API key, not an OpenAI API key.

DeepSeek API in Python

DeepSeek’s official quick-start examples use the OpenAI Python SDK configured with DeepSeek’s base URL. Install the package first:

pip3 install openai

Then keep your key in an environment variable:

export DEEPSEEK_API_KEY="your_deepseek_api_key_here"

Make a first request:

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": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Give me three practical DeepSeek API use cases."},
    ],
    stream=False,
    reasoning_effort="high",
    extra_body={"thinking": {"type": "enabled"}},
)

print(response.choices[0].message.content)

The three DeepSeek-specific settings are the API key, the base URL, and the model name. Using the OpenAI SDK here does not mean the request is billed by OpenAI or sent to OpenAI. It means the SDK is being used as a compatible HTTP client for DeepSeek’s OpenAI-format API.

DeepSeek API in Node.js

Install the OpenAI JavaScript SDK:

npm install openai

Then create a server-side request. Do not put your DeepSeek API key in browser code or a public client bundle.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.DEEPSEEK_API_KEY,
  baseURL: "https://api.deepseek.com",
});

async function main() {
  const completion = await client.chat.completions.create({
    model: "deepseek-flash",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Give me three practical DeepSeek API use cases." },
    ],
    thinking: { type: "enabled" },
    reasoning_effort: "high",
    stream: false,
  });

  console.log(completion.choices[0].message.content);
}

main();

In Python, the SDK option is base_url. In Node.js, it is baseURL. Mixing those names is a common copy-paste mistake.

Main DeepSeek API surfaces

DeepSeek exposes several API surfaces. Use the one that matches your integration rather than forcing every workflow through one endpoint.

API surfaceEndpoint or formatBest forImportant note
Chat Completions API/chat/completionsStandard chat-style requests, tool calls, JSON Output, image inputs, streaming, and most OpenAI-compatible workflows.Uses messages and current model IDs such as deepseek-flash.
Responses API/responsesOpenAI Responses API-style workflows, structured output with json_schema, and stateless response building.DeepSeek says responses and conversations are not stored server-side; send full conversation history in each request.
Anthropic API formathttps://api.deepseek.com/anthropicAnthropic-compatible tools, Claude Code-style integrations, and Anthropic SDK workflows.Unsupported Anthropic model names can be mapped to DeepSeek models according to DeepSeek’s mapping rules.
Files APIUpload, list, retrieve, delete filesUploading images once and referencing them later by file_id.Useful for repeated image use or images too large for inline request bodies.
FIM Completion APIBeta completion endpointFill-in-the-middle code completion workflows.DeepSeek’s model table lists FIM as non-thinking mode only.
Get User BalanceBalance endpointChecking API account balance in automation.Use it to avoid confusing 402 billing errors with rate-limit or server errors.

Chat Completions API

The Chat Completions API is the easiest starting point for most developers. DeepSeek’s reference defines /chat/completions as creating a model response for a chat conversation. The request includes messages, a model, optional thinking controls, optional response format, optional tools, and optional streaming. DeepSeek Chat Completions API

Use it for:

  • Basic chat responses.
  • Streaming text output.
  • JSON Output with response_format={"type":"json_object"}.
  • Tool calls and function arguments.
  • Vision requests using image blocks with deepseek-flash.
  • OpenAI-compatible app and agent frameworks.

Responses API

The Responses API creates responses in the OpenAI Responses API format. DeepSeek’s reference says the API is stateless: responses and conversations are not stored on the server, so multi-turn clients need to send the full conversation history in input on each request. DeepSeek Responses API

The Responses API is useful when you want:

  • OpenAI Responses API-style integration.
  • json_object output format.
  • json_schema structured output with required name and schema fields.
  • Function-call and custom-tool workflows.
  • Image input through input_image with deepseek-flash.

Anthropic-compatible API

DeepSeek also supports an Anthropic API format at https://api.deepseek.com/anthropic. DeepSeek’s Anthropic API guide says you can configure the Anthropic SDK with ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic and a DeepSeek API key. DeepSeek Anthropic API guide For a coding-agent setup using this API format, see our DeepSeek with Claude Code guide.

This is useful for Anthropic-compatible tools, but it does not mean you are using Anthropic billing or Claude models. DeepSeek maps Anthropic model-name families to DeepSeek models in documented ways; for example, Claude Opus names map to deepseek-v4-pro, while Claude Sonnet or Haiku names map to deepseek-flash. Confirm the mapping before production use because it affects billing and behavior. DeepSeek Anthropic API guide

Core DeepSeek API features

The DeepSeek API is not just a text-generation endpoint. Current docs list several production-relevant features.

FeatureWhat it doesWhen to use itWhat to verify
Thinking ModeLets the model use reasoning behavior with effort controls such as none, low, high, and max.Complex reasoning, coding, agents, analysis, and technical tasks.Latency, output length, cost, and whether you need reasoning traces.
JSON OutputReturns valid JSON strings through response_format={"type":"json_object"} in Chat Completions.Extraction, classification, normalization, and machine-readable app output.Prompt must explicitly ask for JSON; app still needs validation.
Responses API json_schemaProvides schema-constrained output through the Responses API format.Structured outputs where field names and types matter.Use Responses API syntax, not Chat Completions JSON Output syntax.
Tool CallsLets the model request that your app call functions with arguments.Search, lookup, database, workflow, or backend action integrations.Your app executes the tool; validate names and arguments.
Strict Tool CallsBeta mode for making tool-call arguments follow a function JSON schema more closely.Controlled function interfaces.Schema support has restrictions; verify current docs.
VisionAllows deepseek-flash to accept images alongside text.Screenshot reading, chart analysis, image description, visual extraction.Only deepseek-flash supports Vision in the current model table.
Files APIUploads images and references them later by file_id.Repeated image use or larger images.File limits, supported formats, and whether the endpoint format matches OpenAI or Anthropic usage.
Context CachingReduces input cost when repeated prompt prefixes are cache hits.Long prompts, agents, RAG, repeated system instructions, repeated documents.Cache-hit and cache-miss tokens in usage; do not assume savings without measuring.
FIM CompletionFill-in-the-middle completion for code-style workflows.Code completion and editor-like workflows.Beta and non-thinking mode only in the model table.
Agent integrationsUse DeepSeek as a backend for coding assistants and agent tools.Claude Code, Codex, OpenCode, DeepSeek Harness, and similar workflows.Model mapping, pricing, context settings, and any extra tool costs.

Thinking Mode

DeepSeek’s current model table says both deepseek-flash and deepseek-v4-pro support non-thinking and thinking modes, with thinking as the default. In Chat Completions, the API reference lists thinking with enabled or disabled, and reasoning_effort values of none, low, high, and max. DeepSeek Chat Completions API

Use Thinking Mode for hard reasoning, coding, planning, and agent tasks. Use non-thinking mode for fast, simple, deterministic, or formatting-sensitive tasks such as short extraction or JSON formatting.

JSON Output and structured output

DeepSeek JSON Output is enabled in Chat Completions with response_format={"type":"json_object"}. DeepSeek’s guide says you should also include the word “json” in the system or user prompt, provide an example of the desired format, and set max_tokens reasonably so the JSON is not truncated. DeepSeek JSON Output guide

For schema-constrained output, use the Responses API where DeepSeek documents {"type":"json_schema","name":...,"schema":...}. Do not confuse Chat Completions JSON Output with Responses API JSON Schema or Tool Calls.

Tool Calls

Tool Calls let the model request that your application call a function. The model does not execute your code. Your app receives the tool name and arguments, validates them, runs the function if allowed, and sends the result back to the model.

DeepSeek’s Tool Calls guide also documents strict mode as a Beta feature for making tool-call output comply with a function JSON schema. Use strict mode when function-call arguments need tighter schema control, but verify the supported schema features before relying on it. DeepSeek Tool Calls guide

Vision and image input

DeepSeek’s Vision guide says deepseek-flash accepts images alongside text. Supported image formats are JPEG, PNG, GIF, and WebP. You can provide images by base64 data URL, external URL, or by uploading an image through the Files API and referencing its file_id. DeepSeek Vision guide

In the current model table, Vision is supported for deepseek-flash and not supported for deepseek-v4-pro. Do not imply that “DeepSeek API supports images” for every model; attach Vision support to the correct model.

Context Caching

DeepSeek pricing separates cache-hit input tokens from cache-miss input tokens. This matters for long prompts, repeated system instructions, agents, RAG pipelines, document workflows, and coding tasks with repeated repository context.

Context caching is different from your own application response cache. It affects how repeated input prefixes are billed by the model provider. Measure cache-hit and cache-miss usage rather than assuming savings. Always include output cost in estimates, because output tokens are billed separately.

Rate limits, concurrency, and user_id

DeepSeek documents current API limits mainly as model-specific account-level concurrency limits. The Rate Limit & Isolation page lists a concurrency limit of 2500 for deepseek-flash and 500 for deepseek-v4-pro. A request counts as one concurrent connection from send time until the model response is complete. DeepSeek Rate Limit & Isolation

Concurrency limits are calculated at the account level, regardless of which API key is used. Multiple keys under the same account do not create separate concurrency pools. When the concurrency limit is exceeded, DeepSeek returns HTTP 429. DeepSeek Rate Limit & Isolation

DeepSeek also documents a user_id parameter for content-safety isolation, KVCache isolation, and scheduling isolation. For regular API users, all user_id values are combined for concurrency-limit calculation. The docs say user_id must match [a-zA-Z0-9\-_]+, has a maximum length of 512, and should not include user privacy information.

Request keep-alive behavior

DeepSeek may keep a request connected while waiting for inference. During that time, non-streaming requests may return empty lines, and streaming requests may return Server-Sent Events keep-alive comments such as : keep-alive. DeepSeek says these contents do not affect the JSON body, but custom HTTP parsers should handle them correctly. If a request has not started inference after 10 minutes, the server will close the connection. DeepSeek Rate Limit & Isolation

Error codes and troubleshooting

Do not retry every DeepSeek API error. The right fix depends on the status code.

CodeMeaningLikely causeBest first action
400Invalid FormatInvalid request body format.Fix JSON shape, endpoint, SDK serialization, or request format.
401Authentication FailsWrong, missing, deleted, or incorrectly sent API key.Check the DeepSeek API key and Bearer Auth header.
402Insufficient BalanceThe account has run out of balance.Check topped-up or granted balance; do not retry aggressively.
422Invalid ParametersUnsupported field, wrong model name, invalid parameter, or malformed request option.Fix parameters according to current API docs.
429Rate Limit ReachedRequests are too fast or account-level concurrency is exceeded.Throttle, queue, reduce in-flight requests, and retry with backoff.
500Server ErrorDeepSeek server-side issue.Retry after a brief wait and monitor recurrence.
503Server OverloadedServer overloaded due to high traffic.Retry after a brief wait; do not confuse it with your account’s 429 limit.

DeepSeek’s official Error Codes page lists the causes and recommended actions for these status codes. DeepSeek Error Codes

Security and API key best practices

A DeepSeek API key is a credential. Treat it like a password. DeepSeek’s Open Platform Terms place responsibility on developers for their inputs, outputs, end-user handling, and technical measures when building applications on the platform. DeepSeek Open Platform Terms

  • Store API keys in environment variables or a secrets manager.
  • Never commit keys to Git.
  • Never expose keys in browser JavaScript, mobile app code, or client-side bundles.
  • Never paste keys into public GitHub issues, notebooks, screenshots, Slack, Discord, or forums.
  • Use backend routes or a controlled server-side proxy for client apps.
  • Rotate or delete a leaked key immediately.
  • Use separate keys for local, staging, and production if your workflow supports it.
  • Avoid logging full request headers.
  • Avoid logging sensitive prompts, outputs, documents, or reasoning traces unless you have a controlled reason.

Privacy and business-use considerations

DeepSeek’s Privacy Policy says the service may collect user inputs and other personal data, and it says DeepSeek uses personal data to provide, maintain, improve, develop, train, and improve its technology. The policy also says personal data may be directly collected, processed, and stored in the People’s Republic of China. DeepSeek Privacy Policy

Do not send passwords, API keys, private keys, client data, patient data, student records, employee records, confidential legal or financial documents, unreleased source code, trade secrets, or regulated data unless your organization has approved that use.

If you build a downstream app using DeepSeek services, review your own privacy disclosures, end-user consent requirements, logging, retention, security, and data-processing responsibilities. DeepSeek’s Open Platform Terms say developers using DeepSeek services to provide public services must disclose personal information processing rules to end users and have a legal basis such as consent where required. DeepSeek Open Platform Terms For cloud-provider access, see our guide to using DeepSeek through AWS or Azure.

What old R1-era tutorials get wrong

Many old DeepSeek API tutorials were written for earlier model names such as deepseek-chat, deepseek-reasoner, or deepseek-v4-flash. They may still appear in search results, but they should not be treated as current default guidance.

The safe rule is:

  • Start from the current Models & Pricing page.
  • Use deepseek-flash for current Flash examples unless you have a reason to use Pro.
  • Use deepseek-v4-pro only after checking current pricing and model status.
  • Do not use deepseek-reasoner as the default in new API tutorials unless current DeepSeek docs explicitly support your use case.
  • Do not use deepseek-v4-flash as a new default; it is a legacy compatibility name.
  • Keep model IDs in configuration so you can change them safely.

Production checklist

  • Create and store the API key securely.
  • Use https://api.deepseek.com for OpenAI-format requests.
  • Use https://api.deepseek.com/anthropic for Anthropic-format requests.
  • Use current model IDs such as deepseek-flash and deepseek-v4-pro.
  • Estimate input, cache-hit input, cache-miss input, and output cost.
  • Track usage, balance, 401, 402, 429, 500, and 503 separately.
  • Throttle requests before hitting account-level concurrency limits.
  • Queue requests for high-volume workloads.
  • Handle keep-alive empty lines and SSE comments if parsing HTTP manually.
  • Validate JSON Output and tool-call arguments before using them.
  • Do not execute arbitrary model-generated functions.
  • Use user_id carefully and never include private information in it.
  • Review privacy and legal terms before sending sensitive or business data.
  • Keep model names, prices, and feature assumptions out of hard-coded application logic.

Frequently asked questions

What is the DeepSeek API?

The DeepSeek API is DeepSeek’s developer platform for calling DeepSeek models from software. It lets developers build chat features, agents, extraction workflows, coding tools, multimodal analysis, and other AI-powered applications.

Is the DeepSeek API free?

No. The DeepSeek API is a token-priced developer product. DeepSeek’s pricing page lists costs per 1M tokens for cache-hit input, cache-miss input, and output tokens. The consumer app and API should not be treated as the same product.

How do I get a DeepSeek API key?

Create an API key in the DeepSeek Platform. DeepSeek’s API reference says you must create an API key before using the API. Use it as a Bearer token in the Authorization header.

What is the DeepSeek API base URL?

For OpenAI-format requests, use https://api.deepseek.com. For Anthropic-format requests, use https://api.deepseek.com/anthropic.

Can I use the OpenAI SDK with DeepSeek?

Yes, for OpenAI-compatible DeepSeek endpoints. Configure the OpenAI SDK with your DeepSeek API key, DeepSeek’s base URL, and a current DeepSeek model ID. Using the OpenAI SDK does not mean you are using OpenAI billing or OpenAI models.

Can I use the Anthropic SDK with DeepSeek?

Yes, through DeepSeek’s Anthropic-compatible API format. Configure the Anthropic SDK with https://api.deepseek.com/anthropic and your DeepSeek API key. Check DeepSeek’s mapping rules before relying on Anthropic model-name aliases.

What model should I use with the DeepSeek API?

For most new API projects, start with deepseek-flash. Use deepseek-v4-pro only if your tests show Pro improves your workload enough to justify the higher cost.

What is deepseek-flash?

deepseek-flash is the current API model name for DeepSeek-V4.1-Flash. It supports thinking and non-thinking modes, JSON Output, Tool Calls, Responses API, Anthropic API, Chat Prefix Completion, FIM in non-thinking mode, and Vision.

Is deepseek-reasoner still the model to use?

Do not use deepseek-reasoner as the default in new API examples unless current DeepSeek documentation explicitly supports your use case. Current hosted API work should start from the current Models & Pricing page.

Does DeepSeek API support JSON output?

Yes. In Chat Completions, use response_format={"type":"json_object"} and clearly instruct the model to output JSON in the prompt. Use Responses API json_schema when you need schema-constrained output.

Does DeepSeek API support tool calls?

Yes. DeepSeek supports Tool Calls. The model requests a function call, but your application executes the function. Always validate tool names and arguments before running any backend action.

Does DeepSeek API support image input?

Yes, with deepseek-flash. DeepSeek’s model table lists Vision support for deepseek-flash and not for deepseek-v4-pro. The Vision guide supports JPEG, PNG, GIF, and WebP image inputs.

Does DeepSeek API support the Responses API?

Yes. DeepSeek supports an OpenAI Responses API-style endpoint at /responses. DeepSeek says the API is stateless, so clients must send the full conversation history for multi-turn conversations.

What are DeepSeek API rate limits?

DeepSeek currently documents model-specific account-level concurrency limits: 2500 for deepseek-flash and 500 for deepseek-v4-pro. Requests above the concurrency limit return HTTP 429.

What does DeepSeek API 429 mean?

429 means the rate or concurrency limit has been reached. Fix it with throttling, queueing, backoff, and concurrency control. Do not create more API keys to bypass account-level limits.

What does DeepSeek API 402 mean?

402 means insufficient balance. It is a billing issue, not a rate-limit issue. Check your topped-up balance, granted balance, and token usage.

Is DeepSeek API the same as the free DeepSeek app?

No. The app is a consumer assistant. The API is a developer platform with API keys, token pricing, model IDs, rate limits, and production responsibilities.

Is DeepSeek API safe for business data?

Do not send sensitive business or regulated data without organizational approval. Review DeepSeek’s Privacy Policy, Open Platform Terms, logging, retention, security controls, and your own legal/compliance requirements before production use.

Does DeepSeek API work with Claude Code or Codex?

DeepSeek publishes agent-integration guidance for tools such as Claude Code, Codex, and OpenCode. These integrations depend on specific environment variables, model mapping, and tool behavior. Review the current integration guide before using them in production.

Bottom line

The DeepSeek API is a developer platform for building with DeepSeek models through OpenAI-compatible and Anthropic-compatible formats. For new projects, start with a DeepSeek API key, https://api.deepseek.com, and deepseek-flash. Use deepseek-v4-pro only when your own evaluation shows Pro is worth the higher cost.

Before production, check pricing, balance, concurrency, error handling, key security, privacy, and current model names. The most common DeepSeek API mistakes are using an OpenAI key instead of a DeepSeek key, forgetting the base URL, copying old deepseek-reasoner examples, confusing app access with API access, and assuming every OpenAI or Anthropic feature automatically works without checking DeepSeek’s own docs.

Official sources checked