DeepSeek - Complete API Reference
- Call DeepSeek models using OpenAI SDK format
- Synchronous processing mode, real-time response
- Supports
deepseek-chat(general conversation) anddeepseek-reasoner(deep reasoning) models - Text Chat: Single or multi-turn contextual conversation
- System Prompts: Customize AI role and behavior
- Streaming: SSE streaming output support
- Tool Calling: Function Calling support
https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Chat model name
deepseek-chat: General conversation modeldeepseek-reasoner: Deep reasoning model, excels at math, coding and complex logical reasoning
Note: deepseek-reasoner does not support temperature, top_p, tools, tool_choice, response_format parameters. Passing these will be rejected by upstream
deepseek-chat, deepseek-reasoner "deepseek-chat"
Conversation message list, supports multi-turn conversation
Different roles have different field structures, select the corresponding role to view
1- System Message
- User Message
- Assistant Message
- Tool Message
Thinking mode control (Beta)
Details:
- Controls the deep thinking feature of
deepseek-reasonermodel - When enabled, the model will perform deep reasoning before responding
Frequency penalty parameter to reduce repetitive content
Details:
- Positive values penalize tokens based on their frequency in the generated text
- Higher values make it less likely to repeat existing content
- Default: 0 (no penalty)
-2 <= x <= 20
Maximum number of tokens to generate
Details:
- The model will stop generating when this limit is reached
- If not set, the model decides the generation length
x >= 14096
Presence penalty parameter to encourage new topics
Details:
- Positive values penalize tokens based on whether they have appeared in the text
- Higher values encourage discussing new topics
- Default: 0 (no penalty)
-2 <= x <= 20
Specify response format
Details:
- Set to
{"type": "json_object"}to enable JSON mode - In JSON mode, the model will output valid JSON content
Stop sequences. The model will stop generating when encountering these strings
Details:
- Can be a single string or an array of strings
- Maximum 16 stop sequences
Whether to stream the response
true: Stream via SSE (Server-Sent Events), returning content in real-time chunksfalse: Wait for the complete response before returning
false
Streaming response options
Only effective when stream=true
Sampling temperature, controls output randomness
Details:
- Lower values (e.g. 0.2): More deterministic, focused output
- Higher values (e.g. 1.5): More random, creative output
- Default: 1
0 <= x <= 21
Nucleus Sampling parameter
Details:
- Controls sampling from tokens whose cumulative probability reaches the threshold
- For example, 0.9 means sampling from tokens reaching 90% cumulative probability
- Default: 1.0 (consider all tokens)
Tip: Avoid adjusting both temperature and top_p simultaneously
0 <= x <= 11
Tool definition list for Function Calling
Details:
- Maximum 128 tool definitions
- Each tool requires a name, description and parameter schema
128Controls tool calling behavior
Options:
none: Do not call any toolsauto: Model decides whether to call toolsrequired: Force the model to call one or more tools
Default: none when no tools provided, auto when tools are provided
none, auto, required Whether to return token log probabilities
Details:
- When set to
true, the response will include log probability information for each token
Return log probabilities of the top N most likely tokens
Details:
- Requires
logprobsto be set totrue - Range:
[0, 20]
0 <= x <= 20Response
Chat completion generated successfully
Unique identifier for the chat completion
"930c60df-bf64-41c9-a88e-3ec75f81e00e"
Actual model name used
"deepseek-chat"
Response type
chat.completion "chat.completion"
Creation timestamp
1770617860
List of chat completion choices
Token usage statistics
System fingerprint identifier
"fp_eaab8d114b_prod0820_fp8_kvcache"