DeepSeek API Skills

What the DeepSeek API Can Do

What "skills" means on this page

DeepSeek Flash and V4 Pro both support chat, structured JSON and function calls. Flash accepts images and files and can use DeepSeek's web tools in a conversation. V4 Pro can search the web through the Responses API, using a different tool. The table below shows which interface to use.

DeepSeek Flash and V4 Pro support matrix

Capability Flash V4 Pro Limits or billing
Chat Completions, Responses and Anthropic Messages Supported Supported See base URLs and request paths.
Chat and thinking Both modes Both modes Up to 1M context and 384K output on each model. Reasoning is billed as output.
JSON output and function calls Supported Supported Model token rates apply. Your application runs functions you supply.
Chat prefix and fill-in-the-middle (beta) Supported Supported FIM requires non-thinking mode. Model token rates apply.
Images in chat Supported Unsupported Image input uses model input tokens.
DeepSeek web search and URL reading Set deepseek_web_search or deepseek_read_url in Messages, Responses or Chat Completions — Model token rates apply.
Responses API web_search Use deepseek_web_search Set web_search in tools Model token rates apply.
File input in chat Supported via uploaded file ID — Successful file parsing is billed by page. Chat is billed separately by token.
Concurrent requests 2,500 500 Limits apply at the account level. See rate limits and 429 errors.

Sources checked November 19, 2026. Models and pricing · Web tools · Responses API · File parsing.

In the same billing period, V4 Pro costs about 7.3× as much for cached input, 4.4× for uncached input and 3.3× for output. Try the DeepSeek API pricing calculator with the same token volumes, cache hit rate and schedule for each model.

Chat and thinking mode

  • How to call — POST /chat/completions. Thinking mode is on by default and there is no separate endpoint for it. model is either deepseek-flash or deepseek-v4-pro.
  • Limits — up to 1M tokens of context and 384K output tokens on both models. Your system prompt, message history, inputs and planned output must fit in the context. Compare concurrency and per-request limits before scaling a workload.
  • What it costs — use usage.completion_tokens for billed output. It already includes completion_tokens_details.reasoning_tokens. For straightforward extraction or classification, test non-thinking mode and compare quality and output usage. How to read usage and estimate your bill

JSON and structured output

  • How to call — response_format: {"type": "json_object"} with the word JSON in the prompt plus an example of the shape you want. Without both, the model is free to return prose that happens to look like JSON.
  • Limits — schema-free: you describe the shape in the prompt rather than registering a schema, so validation stays on your side.
  • What it costs — the same token rates as chat. The saving is indirect and real: valid JSON on the first call means no retry loop, and a retry loop is how a cheap model stops being cheap.

Tool calls

With function calling, the model supplies a function name and arguments. Your application validates them, runs the function and sends its result back with the matching tool_call_id. This is different from built-in web search, which DeepSeek runs on the server.

Run a two-request function call in Python

Install the OpenAI Python SDK and set DEEPSEEK_API_KEY. This example looks up shipping fees from a fixed local table. It uses non-thinking mode so the two requests are easy to follow and caps the output on both calls. Running it sends two billable model requests.

import json
import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEEPSEEK_API_KEY"],
    base_url="https://api.deepseek.com",
    max_retries=0,
    timeout=30,
)
shipping_fees = {"standard": 5, "express": 12}
tools = [{
    "type": "function",
    "function": {
        "name": "shipping_fee",
        "description": "Look up a shipping fee in USD.",
        "parameters": {
            "type": "object",
            "properties": {"speed": {"type": "string", "enum": list(shipping_fees)}},
            "required": ["speed"],
            "additionalProperties": False,
        },
    },
}]
messages = [{"role": "user", "content": "What does express shipping cost?"}]
options = {
    "model": "deepseek-flash",
    "max_tokens": 128,
    "extra_body": {"thinking": {"type": "disabled"}},
}

first = client.chat.completions.create(
    messages=messages,
    tools=tools,
    tool_choice={"type": "function", "function": {"name": "shipping_fee"}},
    **options,
)
assistant = first.choices[0].message
calls = assistant.tool_calls or []
if len(calls) != 1 or calls[0].type != "function":
    raise ValueError("Expected one shipping_fee function call")

call = calls[0]
args = json.loads(call.function.arguments)
if (
    call.function.name != "shipping_fee"
    or not isinstance(args, dict)
    or set(args) != {"speed"}
    or not isinstance(args["speed"], str)
    or args["speed"] not in shipping_fees
):
    raise ValueError("Unrecognized function or shipping speed")

messages.append(assistant.model_dump(include={"role", "content", "tool_calls"}))
messages.append({
    "role": "tool",
    "tool_call_id": call.id,
    "content": json.dumps({"fee_usd": shipping_fees[args["speed"]]}),
})
final = client.chat.completions.create(
    messages=messages,
    tools=tools,
    tool_choice="none",
    **options,
)
print(final.choices[0].message.content)

The local lookup returns {"fee_usd": 12} for express shipping. If you enable thinking on a tool-call flow, carry the earlier reasoning_content back as required by DeepSeek's guide. To estimate cost, record usage for both requests. Long tool definitions and results can add input tokens, so measure the cache hit rate on your actual workload. Official tool calling guide.

Prefix and FIM completion (beta)

  • How to call — prefix completion sends the start of the assistant's reply and the model continues from it. FIM sends prompt plus suffix to the beta base URL, for code completion in an editor.
  • Limits — FIM runs in non-thinking mode only. Both are beta, so pin behaviour before you build a product on them.
  • What it costs — prefix tokens are ordinary input. FIM bills prompt, suffix and completion together, which is worth measuring before you wire it into a keystroke.

Image input on Flash

  • How to call — pass image content parts alongside text in the same message array. deepseek-flash only; deepseek-v4-pro rejects images.
  • Limits — the image consumes context like any other content, and the 1M window is shared with your text.
  • What it costs — token rates, same as text. The usual pattern: read the screenshot, scan or chart with Flash, then hand the extracted text to V4-Pro if the reasoning that follows is hard.

Standalone Search, Fetch, OCR and speech

Standalone requests use their own billing units. File parsing within a model workflow can also generate a separate per-page charge.

Service Price
Search API $0.75 per 1,000 successful requests
Fetch API (read a URL) $0.75 per 1,000 successful requests
File parsing and OCR $0.225 per 1,000 pages
Text to speech $0.225 per 10,000 characters at the current promotional rate
Speech to text $0.058 per hour of audio at the current promotional rate

Since 12:00 Beijing time on 18 November 2026, model-triggered Search and Fetch have no separate request fee. DeepSeek adds the returned results to the model context as billable input tokens. For document text extraction, see the DeepSeek OCR API guide. Official rates and billing rules.

Which one to reach for first

Start with deepseek-flash for extraction, formatting, ordinary chat, image reading and tool calls. Test deepseek-v4-pro on specific text requests where Flash struggles, such as reasoning-heavy code, multi-step planning or hard maths. Compare answer quality and estimated token cost before switching a workload.

Frequently asked questions

What can the DeepSeek API do besides chat?

JSON output, tool calls, chat prefix completion, fill-in-the-middle code completion, image input on deepseek-flash, and separate search, fetch, OCR, text-to-speech and speech-to-text endpoints.

Does deepseek-v4-pro accept images?

No. Image input is only on deepseek-flash. Read the image with Flash and pass the text on to V4-Pro if the reasoning is hard.

How large is the context window?

1M tokens on both models, with a maximum output of 384K tokens.

Does DeepSeek V4 Pro support web search?

Yes. Use the web_search tool on the Responses API with deepseek-v4-pro. Flash uses the separate deepseek_web_search tool. Standalone Search and Fetch are separate APIs that your application can call directly.

Are the search and fetch calls billed per request or per token?

The standalone Search and Fetch APIs are $0.75 per 1,000 successful requests. Since 12:00 Beijing time on 18 November 2026, server-side search and fetch calls made inside a model call are no longer billed separately; their results are billed as model tokens.