Image-to-Text (OCR)
Image-to-text models translate images into written output. The most common uses are image captioning and OCR, which describe scenes and extract text, respectively.
post
Endpoint for requesting image2text (OCR) inference
Authorizations
Header parameters
Acceptstring · enumRequiredPossible values:
Body
imagestring · binaryRequired
Image file to extract text from
modelstringRequiredExample:
The OCR model to use for text extraction
tesseract-v5
languagestring | nullableOptionalExample:
Language code for OCR processing (optional)
en
formatstring · enum | nullableOptionalExample:
Output format for extracted text
text
Possible values: Responses
200
ID of the inference request.
application/json
401
Unauthorized user.
application/json
404
Unauthorized user.
application/json
post
POST /api/v1/client/img2txt HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer JWT
Accept: application/json
Content-Type: multipart/form-data
Content-Length: 73
{
"image": "binary",
"model": "tesseract-v5",
"language": "en",
"format": "text"
}
{
"data": {
"request_id": 1
}
}
post
Endpoint for calculating price for image2text (OCR) inference
Authorizations
Header parameters
Acceptstring · enumRequiredPossible values:
Body
image_urlstring · uriRequiredExample:
URL of image to extract text from
https://example.com/image.jpg
modelstringRequiredExample:
The OCR model to use for text extraction
tesseract-v5
languagestring | nullableOptionalExample:
Language code for OCR processing (optional)
en
formatstring · enum | nullableOptionalExample:
Output format for extracted text
text
Possible values: Responses
200
Calculated price for img2txt inference.
application/json
401
Unauthorized user.
application/json
404
Unauthorized user.
application/json
post
POST /api/v1/client/img2txt/price-calculation HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer JWT
Accept: application/json
Content-Type: application/json
Content-Length: 100
{
"image_url": "https://example.com/image.jpg",
"model": "tesseract-v5",
"language": "en",
"format": "text"
}
{
"data": {
"price": 0.15
}
}
Last updated