Request Payload
Tip
See the complete Optical Character Recognition Call for endpoints, headers, and full modality details.
Specification for the Optical Character Recognition (OCR) inference request payload, covering base64 image encoding, modality selection, and supported languages.
Optical Character Recognition Request Payload
{
"pipelineTasks": [
{
"taskType": "ocr",
"config": {
"language": {
"sourceLanguage": "hi"
},
"serviceId": "bhashini/ocr-v2",
"modality": "printed"
}
}
],
"inputData": {
"image": [
{
"imageContent": "<BASE64_ENCODED_IMAGE_STRING>"
// OR "imageUri": "https://example.com/document.jpg"
}
]
}
}Request Body Parameters
| Field | Type | Status | Description |
|---|---|---|---|
pipelineTasks | array<object> | Required | Array containing the OCR task configuration. |
pipelineTasks[].taskType | string | Required | Must be set exactly to ocr. |
config.language.sourceLanguage | string | Required | ISO-639 code of the script/language present in the image (e.g. hi, ta). |
config.serviceId | string | Required | Target OCR model service ID based on image modality. |
config.modality | string | Optional | Specific OCR mode: printed, scenic, or handwritten. |
inputData.image[].imageContent | string (base64) | Optional* | Base64 data of the image (JPEG/PNG). Required if imageUri is omitted. |
inputData.image[].imageUri | string (url) | Optional* | Direct public URL to the image file. Required if imageContent is omitted. |
Info
Pass either imageContent (inline base64 string) or imageUri (direct image link). If both are passed, imageContent takes precedence.
OCR Service IDs & Supported Languages
Select the appropriate service identifier based on your input modality:
Optimized for books, documents, reports, and clear printed typography.
AssameseBengaliEnglishGujaratiHindiKannadaMalayalamManipuriMarathiOdiaPunjabiTamilTelugu