DeepSeek V4 Flash

Beta
View as Markdown

DeepSeek V4 Flash is a general-purpose open-weight model served on Sarvam infrastructure. It supports text input and output with a 1,048,576-token context window.

DeepSeek V4 Flash is available in beta. Access is granted per API key — contact us to request access.

At a glance

Model IDdeepseekv4-flash
Best forLong-document analysis and agentic workflows
Context window1,048,576 tokens
Input → outputText → text
Reasoninglow, high, or max (default when omitted) — see Reasoning
Tool callingSupported
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹19.8 input · ₹0.63 cached input · ₹59.4 output per 1M tokens; reasoning is billed as output (Pricing)

Key capabilities

Long context

Process up to 1,048,576 tokens across the prompt, reasoning, and generated output.

Reasoning

Receive reasoning in reasoning_content separately from the final answer in content.

Tool calling

Use OpenAI-compatible tools and tool_choice for agentic workflows.

Streaming

Receive reasoning and final-answer deltas as server-sent events.

Quickstart

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="deepseekv4-flash",
messages=[
{
"role": "user",
"content": "Explain the difference between a B-tree and a B+ tree index.",
}
],
temperature=1,
top_p=0.95,
max_tokens=2000,
)
print(response.choices[0].message.content)

API reference

Call POST /v2/chat/completions or POST /v2/responses with model: "deepseekv4-flash". Request fields are defined in those API references — not duplicated on this model page.

Reasoning

DeepSeek V4 Flash has three reasoning modes — low, high, and max — and accepts all three directly on both APIs:

RouteFieldAccepted values
Chat Completion V2reasoning_effort"low", "high", or "max"; omitting the field also gives max
Responsesreasoning.effort"low", "high", or "max"; omitting the field also gives max

This is different from GLM-5.3, where the Responses API rejects the literal string "max" — DeepSeek V4 Flash has no such restriction.

Read the reasoning trace from choices[].message.reasoning_content on chat, or from the reasoning item’s summary[0].text in output on Responses when one is returned. Reasoning tokens are billed as output tokens either way, and count against max_tokens on chat (defaults to 2048 when omitted) or max_output_tokens on Responses (no default — omitting it means unbounded generation).

To turn reasoning off on chat, set extra_body.chat_template_kwargs.enable_thinking to false.

Known limitations

  • Reasoning and the final answer share the max_tokens / max_output_tokens budget. Raise the cap or disable thinking via extra_body.chat_template_kwargs.enable_thinking: false when needed.
  • Structured output with reasoning enabled can return content: null — disable thinking or raise the token cap.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
ContextPrompt tokens plus max_tokens exceed 1,048,576422 unprocessable_entity_errorShorten the prompt or reduce max_tokens.
Outputmax_tokens exceeds 1,048,576400 invalid_request_errorSet max_tokens within the context window.
Request sizeRequest body exceeds 10 MB413 invalid_request_errorReduce the request body; the byte limit is independent of the token window.
ModalityRequest includes image input400 invalid_request_errorSend text input only.
ReasoningReasoning consumes the full max_tokens budget200 with content: null and finish_reason: "length"Raise max_tokens or disable reasoning with extra_body.
Structured outputresponse_format is used while reasoning is enabled200 with content: nullDisable reasoning with extra_body.
ToolsA named tool_choice is provided without tools422 unprocessable_entity_errorInclude the matching function in tools.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
AccessAPI key does not have beta access400 invalid_request_errorRequest beta access.
ModelModel ID is unknown or unavailable404 not_found_errorConfirm the ID with GET /v2/models.
QuotaNo credits remain402 insufficient_quota_errorAdd credits in the dashboard.
Rate limitRequest or concurrency limit is exceeded429 rate_limit_exceeded_errorBack off and retry.
AvailabilityModel remains overloaded after retries503 model_overloadedRetry later.