-
Notifications
You must be signed in to change notification settings - Fork 0
DeepSeek API Official References
YarCraSy edited this page Jul 8, 2026
·
2 revisions
Previous page: Models and Configuration
Primary source: DeepSeek API Docs.
- Your First API Call: base URL, API key, initial models, and chat example.
- Models & Pricing: available models, context, maximum output, features, and deprecations.
- Token & Token Usage: token definition and API-reported usage.
-
Rate Limit & Isolation: limits, isolation, and
user_idusage. - Error Codes: expected HTTP errors and recommended handling.
-
Thinking Mode:
thinking,reasoning_effort,reasoning_content, and tool-call rules. - Multi-round Conversation: message concatenation across turns.
-
FIM Completion Beta: completion with
promptandsuffixusing the beta base URL. -
JSON Output:
response_format: { type: "json_object" }and prompt requirements. -
Tool Calls: tool format,
toolmessages, strict mode, and supported schemas. - Context Caching: context cache and cache hit/miss tokens.
- API Reference: Bearer authentication and endpoint map.
-
Create Chat Completion: full
/chat/completionscontract. - Create FIM Completion Beta: full completion/FIM contract.
- List Models: available models endpoint.
- The main chat endpoint is
POST /chat/completions. -
stream: truereturns SSE events and ends withdata: [DONE]. -
reasoning_contentappears separately fromcontentin thinking mode. - In thinking mode,
temperatureandtop_phave no effect according to the official guide. - Tool calls use
tools,tool_choice,toolmessages, andtool_call_id. - Tool arguments arrive as a JSON string and must be validated before execution.
- JSON output requires
response_formatand prompt instructions asking for JSON. - FIM beta uses
https://api.deepseek.com/betaand a 4K token maximum.