Skip to content

Sarvam AI

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.

OperationNon-streamingStreamingDeepIntShield route
List modelsGET /v1/models
Chat Completions✅ SSEPOST /v1/chat/completions
Text-to-speech✅ audio chunksPOST /v1/audio/speech
Speech-to-textPOST /v1/audio/transcriptions

Responses, embeddings, files, batches, image operations, and Realtime are rejected locally as unsupported.

  1. Create an API subscription key in the Sarvam dashboard.
  2. Open Workspace → AI Providers, select Sarvam AI, and add the key.
  3. Optionally restrict the key to approved chat and speech models.
  4. Use network_config.base_url only for an approved private endpoint or proxy; otherwise the adapter uses https://api.sarvam.ai.
Terminal window
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.

Text-to-speech uses the unified speech route and supports streaming when the selected Sarvam speech model supports it. Transcription is multipart form data:

Terminal window
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"

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.