Quick Reference
- Base URL:
https://api.deepseek.com/v1 - Authentication: Bearer token
- API Format: OpenAI-compatible (standard
messagesarray) - Usage Tracking:
data.usage(prompt_tokens, completion_tokens) - BYOK Support: ✓ Supported
Current Models (October 2025)
Available Models
- deepseek-chat - General conversational AI model
- deepseek-coder - Code-specialized model for programming tasks
- deepseek-v3 - Latest third-generation model
- deepseek-v3.2 - Enhanced v3 with improved reasoning
Specialization
DeepSeek models are optimized for coding tasks including:- Code generation and completion
- Code explanation and documentation
- Debugging and error analysis
- Algorithm design and optimization
Integration Example
Prerequisites
-
Get your Lava forward token:
- Navigate to Build > Secret Keys
- Find “Self Forward Token” section
- Click copy icon
- Set up environment variables:
.env.local
- Run from backend server (CORS blocks frontend requests for security)
Complete Example
Request/Response Formats
Request Format
DeepSeek uses the standard OpenAI format with no modifications required:Response Format
Standard OpenAI-compatible response:Key Features
Code Specialization
DeepSeek models excel at:- Code generation: Writing functions, classes, and complete programs
- Code explanation: Breaking down complex algorithms
- Debugging: Identifying and fixing code errors
- Refactoring: Improving code structure and efficiency
- Documentation: Generating docstrings and comments
OpenAI Compatibility
DeepSeek is fully OpenAI-compatible, which means:- ✓ Standard
messagesarray format - ✓ Standard
usageobject in responses - ✓ Support for
stream: truewith usage tracking - ✓ Compatible with OpenAI client libraries
Streaming Support
Enable streaming for real-time responses:Usage Tracking
Usage data is available in the response body atdata.usage: