⌘K

DeepSeek V4 Flash

deepseek-v4-flash

High-performance reasoning model with both non-thinking and thinking modes (thinking mode enabled by default). Supports 1M context length and up to 384K max output tokens. Features JSON output, tool calls, conversation prefix continuation, and FIM completion (non-thinking mode only).

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key.

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request.

Value: deepseek-v4-flash


messages array required

Array of message objects representing the conversation history.

role string required

Message role.

Options: user, assistant, system, developer

content string | array required

Text string or multimodal array.


max_tokens integer

Maximum tokens to generate in the completion.

Range: 1 - 384000


temperature number

Sampling temperature. Higher values make output more random, lower values make it more focused and deterministic.

Default: 1.0

Range: 0.0 - 2.0


top_p number

Nucleus sampling parameter. Alternative to temperature sampling.

Default: 1.0

Range: 0.0 - 1.0


stream boolean

Whether to stream response incrementally.

Default: false


frequency_penalty number

Penalty for token frequency to reduce repetition.

Default: 0.0

Range: -2.0 - 2.0


presence_penalty number

Penalty for token presence to encourage new topics.

Default: 0.0

Range: -2.0 - 2.0


stop string | array

Sequence(s) where the model will stop generating further tokens.


response_format object

Format specification for the model output.

type string required

Output format type.

Options: text, json_object


tools array

List of tools the model may call.

type string required

Tool type.

Value: function

function object required

Function definition.


tool_choice string | object

Controls which tool is called by the model.

Options: none, auto, required, or specific tool object

Default: auto


Response Format

error object

Error information, only present when status is failed

code string

Error code

message string

Detailed error message


output array

Generation results, only present when status is completed

content array

List of generated resource content

type string

Resource type

Value: image|video

url string

Processed resource URL

jobId string

Remote task ID


usage object

Usage statistics, only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information