DeepSeek API Integration: OpenAI & Anthropic Formats
Master DeepSeek API integration. OpenAI-compatible SDK configuration, Anthropic API format for Claude tooling, tool calls with thinking mode, strict JSON schema enforcement, and migration patterns from OpenAI and Anthropic.
DeepSeek's API is uniquely dual-format — it supports both OpenAI-compatible endpoints and Anthropic API format. This means you can use the OpenAI SDK with base_url=https://api.deepseek.com or the Anthropic SDK with base_url=https://api.deepseek.com/anthropic. Migration from either ecosystem is typically a single-line change.
But integration depth varies. The Anthropic format supports thinking mode, tool calls, and streaming — but ignores budget_tokens for thinking and cache_control. The OpenAI format supports JSON mode, FIM completion, and streaming. Tool calls in thinking mode have unique constraints around reasoning_content management. The pages in this section cover the full integration landscape.
Note:
LangChain compatible: DeepSeek works with LangChain out of the box. Just set the OpenAI-compatible base_url and api_key in your LangChain configuration.
What You'll Find Here
OpenAI-Compatible API
SDK configuration for OpenAI, LangChain, and other compatible tooling. Anthropic API format for Claude ecosystem tools. Migration patterns from both platforms. Streaming differences and keep-alive handling.
Tool Calls with Thinking
Combining tools and reasoning in DeepSeek. The mandatory reasoning_content passback rule for tool-call loops. strict mode (beta) for JSON schema enforcement in function calls. Error handling and 400 avoidance patterns.
Related Articles
Japanese Zen & Wabi-Sabi SREF Codes
Eastern minimalism SREF codes featuring imperfect beauty, meditative calm, and mindful simplicity.
Gemini 1M Token Strategies: Context Placement & Retrieval
Master Gemini's million-token context window. Learn information placement, the 'lost middle' phenomenon, chunked vs. monolithic prompting, and attention optimization.
Virtual Try-On Prompts: Nano Banana Guide
Master Nano Banana's complete virtual fashion studio. Generate outfit ideas, try them on your photos, and transform existing outfits into new styles.