Agent Integrations

Open a metered Sarvam streaming session (live transcription, live speech or a Voice Agent)

Mints a single-use relay ticket valid for 60 seconds. Connect a WebSocket to the returned wsUrl and speak Sarvam's streaming protocol; the session configuration is fixed here and client config / config.update messages are dropped. transcribe relays streaming speech-to-text: send {"event":"audio_input","audio":"<base64 raw PCM in the chosen encoding>"}, plus flush, speech_start, speech_end, ping and end events; receive session.begin, vad.*, transcript.partial, transcript.final and session.end. Billed per second of audio sent (₹30/hour). speech relays streaming text-to-speech: send {"type":"text","data":{"text":"..."}}, {"type":"flush"} and {"type":"ping"}; receive audio chunks and a final event per flush. Billed per character (₹30 per 10,000) as Sarvam returns audio for it; text is at most 2,500 characters per message. agent relays a Sarvam Voice Agents (Samvaad) conversation with an agent authored in Sarvam's dashboard and allow-listed in SARVAM_AGENTS_APP_IDS. The backend mints Sarvam's signed session URL and sends client.action.interaction_start itself; send client.media.audio_chunk (audio_base64: 16-bit mono PCM at input_sample_rate), client.media.text / client.media.text_chunk, and answer server.system.ping with client.system.pong; receive Sarvam's server.* messages verbatim. Billed per second connected (from server.action.interaction_connected) at SARVAM_AGENTS_INR_PER_MINUTE; 503 until that rate is configured. All bill at Sarvam's list price (converted at SARVAM_INR_PER_USD) plus AGENT_INTEGRATION_SARVAM_MARGIN. Each open session reserves a minimum balance; the relay closes with 4402 when the balance no longer covers it, 4401 for a bad ticket and 4408 on idle or max-duration timeout.

post/agent-integrations/sarvam/live/sessions

Request

  • Base URL: https://api.tinyhumans.ai
  • URL: https://api.tinyhumans.ai/agent-integrations/sarvam/live/sessions
  • Auth: HTTP bearer

Request body

mode'transcribe' | 'speech' | 'agent' required
maxMinutesinteger
modelstring

transcribe: saaras:v4 (default) or saaras:v3-realtime; speech: bulbul:v3 (default) or bulbul:v2

language_codestring

Required for speech mode. Transcribe defaults to auto (auto-detect) and takes Sarvam's realtime codes, which spell Odia or-IN (REST and speech use od-IN)

stt_mode'transcribe' | 'translate' | 'verbatim' | 'translit' | 'codemix'

Transcribe mode only

encoding'linear16' | 'linear32' | 'mulaw' | 'alaw'

Transcribe mode only

sample_rate16000 | 8000

Transcribe mode only

endpointing'vad' | 'manual'

Transcribe mode only

return_timestampsboolean

Transcribe mode only

speakerstring

Speech mode only

pacenumber

Speech mode only

temperaturenumber

Speech mode only

speech_sample_rate8000 | 16000 | 22050 | 24000

Speech mode only

output_audio_codec'mp3' | 'linear16' | 'mulaw' | 'alaw' | 'opus' | 'flac' | 'aac' | 'wav'

Speech mode only

min_buffer_sizeinteger

Speech mode only

max_chunk_lengthinteger

Speech mode only

app_idstring

Agent mode only (required); one of the allow-listed agents

versioninteger

Agent mode only; committed agent version (default latest)

input_sample_rate8000 | 16000

Agent mode only

output_sample_rate16000 | 22050

Agent mode only

agent_variablesobject

Agent mode only; at most 50 string, number or boolean values

initial_language_namestring

Agent mode only

initial_bot_messagestring

Agent mode only

initial_state_namestring

Agent mode only

Response

Relay ticket (sessionId, ticket, wsUrl, ticketExpiresAt, model, mode, maxMinutes, reserveUsd)

Changes

No recorded changes to this operation across all 1 revision of this API.