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:

OperationMethodEndpointAuthentication
1. Pipeline SearchDiscover pipeline IDs supporting specific tasks and language pairsPOST
https://meity-auth.ulcacontrib.org/ulca/apis/v0/model/getModelsPipeline
ulcaApiKey + userId
2. Pipeline ConfigRetrieve service IDs, callback endpoints, and inference keysPOST
https://meity-auth.ulcacontrib.org/ulca/apis/v0/model/getModelsPipeline
ulcaApiKey + userId
3. Pipeline ComputeExecute REST inference for translation, speech, and OCRPOST
https://dhruva-api.bhashini.gov.in/services/inference/pipeline
Authorization: <INFERENCE_KEY>
4. WebSocket StreamingReal-time bidirectional speech recognition streamingWSS
wss://dhruva-api.bhashini.gov.in/services/inference/pipeline
Authorization: <INFERENCE_KEY>

Inference Base URL

https://dhruva-api.bhashini.gov.in/services/inference/pipeline

All 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_KEY

Interactive 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).

Speech inputSpeech-to-textTranslationText-to-speechAudio output

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 StatusError CodeResolution
401ERR_INVALID_KEYConfirm the inference API key is copied exactly from the console and sent as a raw value in Authorization — not prefixed with Bearer.
400ERR_LANG_UNSUPPORTEDCheck the model catalog to confirm the language/task combination is actually supported before retrying.
429ERR_RATE_LIMITBack off with increasing delay between retries, and check current usage against your plan's rate limit.
500ERR_PIPELINE_TIMEOUTRetry 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.