Redeem voucher

DeepSeek

DeepSeek-V4-Flash

deepseek/deepseek-v4-flash
/v1/chat/completions/v1/completions/v1/messages

DeepSeek-V4-Flash是深度求索公司于2026年4月24日发布的高效经济版大语言模型。它采用混合专家(MoE)架构,总参数量约2840亿,每次推理仅激活约130亿参数,并原生支持高达100万Token的超长上下文。该版本在推理能力和简单Agent任务上接近性能强大的Pro版本,但凭借更小的参数和激活规模,能提供更快捷、低成本的API服务。适合需要快速响应和追求极致性价比的各类轻量级应用场景。

Input / output modalities
文本 to 文本
Reference input / output price
Input¥1Output¥2per 1M tokens
Context window
1M
Added to catalog
Apr 24, 2026

Providers and pricing

ProviderTime-based pricing (Beijing Time)Input /MOutput /MCached /MContextMax outputDetails
Other-A—¥1¥2¥0.21M384K
DeepSeek
09:00-12:0014:00-18:00Input ¥3Output ¥9Cached ¥0.1
¥1.5¥4.5¥0.051M384K
Ali—¥1¥2¥0.21M384K
Ali-three-party—¥1¥2¥0.021M384K

Other-A

Latency
0.88s
Throughput
63 tokens/s
Context
1M

Pricing

Input
¥1/M tokens
Output
¥2/M tokens
Cached
¥0.2/M tokens

Specifications

Context
1M
Max output
384K
Supported APIs
/v1/chat/completions/v1/completions/v1/messages

DeepSeek

Latency
6.16s
Throughput
98 tokens/s
Context
1M

Pricing

Input
¥1.5/M tokens
Output
¥4.5/M tokens
Cached
¥0.05/M tokens

Time-based pricing (Beijing Time)

The prices below apply during the listed Beijing Time periods; base pricing applies at other times.

Applicable period

09:00-12:0014:00-18:00

peak

Input
¥3/M tokens
Output
¥9/M tokens
Cached
¥0.1/M tokens

Specifications

Context
1M
Max output
384K
Supported APIs
/v1/chat/completions/v1/messages/v1/responses/v1beta/models/*/v1/models/*

Ali

Latency
2.14s
Throughput
95 tokens/s
Context
1M

Pricing

Input
¥1/M tokens
Output
¥2/M tokens
Cached
¥0.2/M tokens

Specifications

Context
1M
Max output
384K
Supported APIs
/v1/completions/v1/chat/completions/v1/messages/v1/responses/v1beta/models/*/v1/models/*

Ali-three-party

Latency
1.55s
Throughput
84 tokens/s
Context
1M

Pricing

Input
¥1/M tokens
Output
¥2/M tokens
Cached
¥0.02/M tokens

Specifications

Context
1M
Max output
384K
Supported APIs
/v1/chat/completions/v1/messages/v1/responses/v1beta/models/*/v1/models/*

DeepSeek-V4-Flash code examples and API guide

Modelmesh normalizes requests and responses across service providers behind one consistent API.

Modelmesh provides an OpenAI-compatible Completion API for more than 300 models and service providers. Call it directly, through the OpenAI SDK, or with supported third-party SDKs.

Modelmesh-specific request headers in these examples are optional. When supplied, your application can appear on the Modelmesh rankings.

Supported endpointsSelect an endpoint to switch the example below.
View endpoint guideGetting startedLearn what each endpoint does and choose one for your coding tool

Endpoints are the entry points for calling a model, and each uses a different request format. Choose a protocol for your coding tool, then enter the Base URL, API Key, and current model ID.

Endpoint guide for the current model
EndpointWhat it isMain usesCoding agents / tools and requirements
/v1/chat/completionsThe OpenAI chat format: send messages with roles such as user and assistant.Multi-turn conversations and coding questions; tool calling when supported by both the model and gateway.Cline OpenAI Compatible mode and Continue OpenAI-compatible configuration. Set the Base URL, Key, and model ID. If Continue automatically selects Responses, set useResponsesApi: false.
/v1/completionsThe legacy OpenAI text completion format: send a prompt and receive a text continuation.Text continuation, simple code completion, and existing legacy projects.Continue legacy completion mode: set useLegacyCompletionsEndpoint: true. Primarily for completions; not the first choice for modern agent tool calling.
/v1/messagesThe Anthropic Messages format: inputs and outputs are organized as messages and content blocks.Claude-style conversations, coding tasks, and tool calling.Claude Code: connect to a compatible gateway using ANTHROPIC_BASE_URL. Messages, tools, and streaming event formats must be compatible. Official support covers Claude models; protocol conversion for other models requires platform adaptation and testing. This endpoint alone does not establish compatibility.

Usage tips

  • This table explains protocol and tool relationships. Availability depends on the current model, gateway adaptation, and tool version. Verify tool calling and streaming before using an agent.
  • * is a placeholder, not a request URL. Here, /v1/models/* means Gemini model operations, not the OpenAI model listing endpoint GET /v1/models.
  • The Base URL is a shared address prefix; an endpoint is a specific operation path. SDKs and tools combine them according to their own rules. Usually, do not enter a complete endpoint as the Base URL. For example, the OpenAI examples on this page use https://router.shengsuanyun.com/api/v1 as the Base URL, and the complete Chat Completions URL is https://router.shengsuanyun.com/api/v1/chat/completions. Do not duplicate /v1.
  • Use the address prefixes in the Anthropic and Gemini examples rather than copying the OpenAI Base URL. Configuration field names differ between tools.
from openai import OpenAI API_KEY = "$SSY_API_KEY" client = OpenAI( base_url="https://router.shengsuanyun.com/api/v1", api_key=API_KEY, ) try: completion = client.chat.completions.create( model="deepseek/deepseek-v4-flash", messages=[{"role": "user", "content": "Which number is larger, 9.11 or 9.8?"}], temperature=0.6, top_p=0.7, stream=True, ) response_text = "" for chunk in completion: if chunk.choices and chunk.choices[0].delta.content is not None: content = chunk.choices[0].delta.content print(content, end="", flush=True) response_text += content except Exception as error: print(f"Request failed: {error}")
                
              

Related Models