API Playground

Reference for the pipeline request shape below — pick a capability, fill in the request, and send it for real from the popup playground.

Endpoint

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

Path parameters

This API doesn't use path parameters. Every request goes to the same fixed endpoint — the specific capability and inputs are sent in the JSON body instead.

Headers

Authorization — string, required — your inference API key, sent as a raw value. No Bearer prefix.

Content-Type — string, required — always application/json; the request body is JSON for every capability.

Query parameters

Not used by this API either — every request is a POST with a JSON body, described per capability in the Playground popup.

Response

A successful response returns the output nested under the requested task type. The exact shape varies slightly by capability — text-based tasks return a text field, audio-based tasks return a reference to the generated audio. Illustrative shape:

{
  "pipelineResponse": [
    {
      "taskType": "translation",
      "output": [
        {
          "source": "Hello, how are you?",
          "target": "नमस्ते, आप कैसे हैं?"
        }
      ]
    }
  ]
}

HTTP Status Codes

Status CodeMeaningTroubleshooting
200 OKInference completed successfully.Response contains pipelineResponse array.
400 Bad RequestMalformed JSON or missing required fields.Verify language codes, base64 encoding, or service IDs.
401 UnauthorizedMissing or invalid Authorization header.Check that your API key is provided without the Bearer prefix.
403 ForbiddenAPI key lacks permission for the requested service.Verify service entitlement or regenerate key in the portal.
429 Too Many RequestsConcurrency or rate quota exceeded.Implement exponential backoff and request throttling.
500 Server ErrorUnderlying model inference timeout or GPU cluster error.Retry with a small backoff; report persistent failures to support.

Common 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.