Sarvam AI
Overview
Section titled “Overview”The Sarvam AI provider combines its OpenAI-compatible chat API with native
speech endpoints. Use the sarvam/ model prefix. DeepIntShield sends the
configured provider credential using both authentication forms expected by
Sarvam, while callers authenticate only with a DeepIntShield Virtual Key.
Supported operations
Section titled “Supported operations”| Operation | Non-streaming | Streaming | DeepIntShield route |
|---|---|---|---|
| List models | ✅ | — | GET /v1/models |
| Chat Completions | ✅ | ✅ SSE | POST /v1/chat/completions |
| Text-to-speech | ✅ | ✅ audio chunks | POST /v1/audio/speech |
| Speech-to-text | ✅ | ❌ | POST /v1/audio/transcriptions |
Responses, embeddings, files, batches, image operations, and Realtime are rejected locally as unsupported.
Configure Sarvam AI
Section titled “Configure Sarvam AI”- Create an API subscription key in the Sarvam dashboard.
- Open Workspace → AI Providers, select Sarvam AI, and add the key.
- Optionally restrict the key to approved chat and speech models.
- Use
network_config.base_urlonly for an approved private endpoint or proxy; otherwise the adapter useshttps://api.sarvam.ai.
Chat Completions
Section titled “Chat Completions”curl https://app.deepintshield.com/v1/chat/completions \ -H "Authorization: Bearer $DEEPINTSHIELD_VIRTUAL_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "sarvam/sarvam-105b", "messages": [{"role": "user", "content": "Answer in Hindi and English."}], "reasoning_effort": "medium", "stream": true }'The chat adapter supports the parameters advertised by the live model catalog, including temperature, top-p, reasoning effort, token limits, stop sequences, tools, tool choice, and structured response formats. Streaming uses SSE and does not perform model discovery before the request.
Speech
Section titled “Speech”Text-to-speech uses the unified speech route and supports streaming when the selected Sarvam speech model supports it. Transcription is multipart form data:
curl https://app.deepintshield.com/v1/audio/transcriptions \ -H "Authorization: Bearer $DEEPINTSHIELD_VIRTUAL_KEY" \ -F "model=sarvam/saaras:v3" \ -F "file=@meeting.wav" \ -F "language_code=hi-IN"Discovery, pricing, and errors
Section titled “Discovery, pricing, and errors”GET /v1/models?provider=sarvam fetches Sarvam’s live model catalog and applies
the configured key’s allow-list. Provider prices and availability can change;
record contracted rates through DeepIntShield pricing overrides.
Sarvam error envelopes are normalized into DeepIntShield errors with provider, model, request type, and safe upstream headers. Retry only normalized transient errors such as throttling or service unavailability.
See Sarvam’s official Chat Completions reference and model catalog.