Overview
Overview of the Bhashini API ecosystem, covering base endpoints, authentication standards, request chaining patterns, and error handling.
Core API Endpoints
Bhashini operates across four primary gateway endpoints:
| Operation | Method | Endpoint | Authentication |
|---|---|---|---|
| 1. Pipeline SearchDiscover pipeline IDs supporting specific tasks and language pairs | POST | https://meity-auth.ulcacontrib.org/ulca/apis/v0/model/getModelsPipeline | ulcaApiKey + userId |
| 2. Pipeline ConfigRetrieve service IDs, callback endpoints, and inference keys | POST | https://meity-auth.ulcacontrib.org/ulca/apis/v0/model/getModelsPipeline | ulcaApiKey + userId |
| 3. Pipeline ComputeExecute REST inference for translation, speech, and OCR | POST | https://dhruva-api.bhashini.gov.in/services/inference/pipeline | Authorization: <INFERENCE_KEY> |
| 4. WebSocket StreamingReal-time bidirectional speech recognition streaming | WSS | wss://dhruva-api.bhashini.gov.in/services/inference/pipeline | Authorization: <INFERENCE_KEY> |
Inference Base URL
https://dhruva-api.bhashini.gov.in/services/inference/pipelineAll REST inference requests are POST calls executed against the Dhruva gateway.
Authentication
For inference compute calls, provide your inference API key in the Authorization header as a raw value (without Bearer):
Authorization: YOUR_INFERENCE_API_KEYInteractive Translation Example
A complete, ready-to-execute translation request assembling endpoint, headers, and payload together:
const res = await fetch('https://dhruva-api.bhashini.gov.in/services/inference/pipeline', {method: 'POST',headers: {'Authorization': 'YOUR_INFERENCE_API_KEY','Content-Type': 'application/json',},body: JSON.stringify({pipelineTasks: [{ taskType: 'translation' }],inputData: {input: [{ source: 'Hello, how are you?' }],sourceLanguage: 'en',targetLanguage: 'hi',},}),});const { pipelineResponse } = await res.json();console.log(pipelineResponse[0].output[0].target);
Chaining Capabilities
Most real-world conversational systems chain multiple models together — e.g. transcribing speech (ASR), translating the transcript (NMT), and synthesizing speech in the target language (TTS).
Atomic Single-Request Chaining: You can pass multiple tasks together in the pipelineTasks array (e.g. [ASR, Translation, TTS]) in a single HTTP request to the Dhruva endpoint. The orchestrator automatically routes intermediate text between models and returns the full composite output.
Backend-Orchestrated Sequencing: Alternatively, you can execute each stage as an independent pipeline compute call on your backend when you need intermediate validation, business logic, or caching.
Standard Pipeline Errors
Actionable resolutions for common HTTP status and payload error codes:
| HTTP Status | Error Code | Resolution |
|---|---|---|
| 401 | ERR_INVALID_KEY | Confirm the inference API key is copied exactly from the console and sent as a raw value in Authorization — not prefixed with Bearer. |
| 400 | ERR_LANG_UNSUPPORTED | Check the model catalog to confirm the language/task combination is actually supported before retrying. |
| 429 | ERR_RATE_LIMIT | Back off with increasing delay between retries, and check current usage against your plan's rate limit. |
| 500 | ERR_PIPELINE_TIMEOUT | Retry once after a short delay. If it persists across multiple attempts, treat it as a service-side issue, not a request error. |
| 503 | — | The service is temporarily unavailable or at capacity. Retry with exponential backoff. |
| 504 | — | Gateway timeout: the model did not respond in time. Retry with exponential backoff; for long audio or large inputs, send shorter segments. |