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
stringrequiredMessage role.
Options:
user,assistant,system,developer
content
string | arrayrequiredText 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
stringrequiredOutput format type.
Options:
text,json_object
tools array
List of tools the model may call.
type
stringrequiredTool type.
Value:
function
function
objectrequiredFunction 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
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
jobId
stringRemote task ID
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information