Chat Completions Overview
Sarvam AI provides powerful chat completion APIs designed to build intelligent conversational AI experiences, with native support for Indian languages and deep contextual reasoning.
Our Chat Completion APIs support the following chat models:
30B parameter model with strong reasoning and Indic language support. Balanced performance-to-cost ratio for production workloads.
105B parameter flagship model. Highest quality outputs for complex reasoning, coding, and generation tasks.
Model Variants
Both Sarvam-30B (64K context) and Sarvam-105B (128K context) also have shorter-context variants that are more cost-efficient for workloads that don’t need the full context window:
Simply pass the variant name as the model parameter (e.g., model="sarvam-105b-32k") to use the extended context version.
Sarvam-M (24B) is now a legacy model. It remains available via model="sarvam-m" but we recommend migrating to Sarvam-30B or Sarvam-105B for improved performance.
Features
- Supports both “think” and “non-think” modes
- Think mode for complex logical reasoning
- Non-think mode for efficient conversations
- Ideal for mathematical and coding tasks
- Post-trained on Indian languages
- Native English proficiency
- Authentic Indian cultural values
- Rich understanding of local context
- Outperforms similar-sized models
- Strong performance on coding tasks
- Excellent mathematical reasoning
- Advanced problem-solving abilities
- Full Indic script support
- Romanized language support
- Multilingual conversation handling
- Natural language understanding
Code Examples
Basic Chat Completion
Multi-turn Conversation
Hindi (Indic Script)
Reasoning effort options: low, medium, high
- Setting any value enables thinking mode
- Higher values increase reasoning depth
API Response Format
Success Response Structure
Response Fields
Error Responses
All errors return a JSON object with an error field containing details about what went wrong.
Error Response Structure
Error Codes Reference
Example Error Response
Error Handling Code Example
Check out our detailed API Reference to explore Chat Completion and all available options.