NeuroLate

Detect text blocks: masks and/or text

POST
/ext/v1/ocr

Finds text blocks and returns their masks and/or text, in reading order.

  • PAGE — we find the blocks. TEXT on a page runs as MASK_AND_TEXT (see modeApplied).
  • BLOCK — the whole image is one block; we find the text shape inside it.
  • With masks — one block per mask, nothing outside them; images without masks are skipped.

Pages and BLOCK images: blocks without text are dropped and free (MASK mode reads no text and returns every mask). Your mask always comes back and is charged, even with no text (textStatus EMPTY).

Billing per returned block: mask — api_ocr_mask (not in TEXT mode), text — api_ocr_text (not in MASK mode). Before the work a hold is charged, after it the actual cost (see Billing).

Authorization

apiKey
headerAuthorizationBearer <nlk_… (team API key)>

Header Parameters

Idempotency-Key?string

Up to 255 characters, e.g. a UUID. A repeat with the same key is not done: 409 DUPLICATE_REQUEST.

Lengthlength <= 255

Request Body

multipart/form-data
  1. body
images*array<>
mode?string
Default"MASK_AND_TEXT"
Value in"MASK_AND_TEXT""MASK""TEXT"
language*Language

Source language, not UND.

Value in"AR""AZ""BE""BG""BN""BS""CS""DA""DE""EL""EN""ES""ET""FA""FI""FR""HE""HI""HR""HU""HY""ID""IT""JA""KA""KK""KO""KY""LT""LV""MK""MN""MR""MS""NE""NL""NO""PL""PT""RO""RU""SK""SL""SQ""SR""SV""SW""TA""TE""TG""TH""TL""TR""UK""UND""UR""UZ""VI""ZH"
type*string

Sets the reading order of blocks.

Value in"MANGA""WEBTOON"
readingDirection?string

Default — RTL for language=JA with type=MANGA, LTR otherwise.

Value in"LTR""RTL"
masks?string

Masks to read, JSON text (see the overview).

kind?string

Applies to every image; default — by size (see the overview).

Value in"BLOCK""PAGE"

Response Body

Blocks of every image.

application/json
  1. response
requestId?string

Request id — the same as the X-Request-Id header.

Formatuuid
images?array<>
usage?

What the request cost. A line = price item × quantity; cost = sum of lines.

Example Request
curl -X POST 'https://api.neurolate.com/ext/v1/ocr' \  -F 'images=[  "string"]' \  -F 'language=AR' \  -F 'type=MANGA'
Example Response
{  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",  "images": [    {      "index": 0,      "width": 0,      "height": 0,      "modeApplied": "MASK_AND_TEXT",      "blocks": [        {          "number": 0,          "maskIndex": 0,          "text": "string",          "furigana": [            {              "start": 0,              "end": 0,              "reading": "string"            }          ],          "mask": [            {              "outer": [                [                  0                ]              ],              "exclude": [                [                  [                    0                  ]                ]              ]            }          ],          "bbox": {            "x": 0,            "y": 0,            "width": 0,            "height": 0          },          "textStatus": "OK",          "error": {            "code": "string",            "message": "string"          }        }      ],      "error": {        "code": "string",        "message": "string"      }    }  ],  "usage": {    "cost": 0,    "items": [      {        "item": "string",        "name": "string",        "unit": "BLOCK",        "quantity": 0,        "amount": 0      }    ]  }}