Find text in an image
Returns every line of text with its position. Costs 1 OCR call (the same image file within 24 hours is counted
once). Every call returns a new image_id, which can be reused in POST /edits for 24 hours.
bearerAuthAuthorizationBearer <token>Send Authorization: Bearer rw_live_.... Create up to 5 keys at https://rewords.ai/developers/keys/ once your account has API balance.
- body
Provide exactly one of image_id, image_url or image_base64; none or more than one returns
400 invalid_request.
language?LanguageMain language of the text: en, zh, ja, ko, fr, de, es, pt, it or ru. Case and a region part
are ignored (pt-BR counts as pt). The language is not detected automatically: without it, or with any other
value, OCR reads Chinese and English (usually Japanese too), and other languages such as Korean or Russian come
out wrong. Send it whenever you know it. In an edit it is also used when we read the text: to find from
when a replacement has no box, and to fit the new text into result B.
image_url*stringPublic http(s) URL of a JPEG, PNG or WebP image up to 20 MB. We download it once, while handling the
request; we follow up to 3 redirects and give up after 15 seconds. A URL that cannot be downloaded, or
that points to a private network address (such as localhost, 10.x.x.x or 192.168.x.x), returns
400 invalid_image.
uriText found in the image.
application/json- response
image_id*stringwidth*integerPixel width after applying EXIF orientation.
height*integerPixel height after applying EXIF orientation.
texts*array<>charged_ocr?integerOCR calls charged (0 if this image was read in the last 24 hours).
curl -X POST 'https://api.rewords.ai/v1/ocr' \ -H 'Authorization: Bearer rw_live_your_key' \ -H 'Content-Type: application/json' \ -d '{ "image_url": "https://example.com/banner.png", "language": "en"}'{ "image_id": "img_118ba6012ee7", "width": 2560, "height": 1302, "texts": [ { "id": "t1", "text": "SALE", "box": [ 120, 80, 300, 60 ] }, { "id": "t2", "text": "50% OFF", "box": [ 140, 160, 260, 50 ] }, { "id": "t3", "text": "Summer Collection", "box": [ 100, 700, 800, 80 ] } ], "charged_ocr": 1}API reference
Every ReWords.AI API endpoint — OCR, edits, results, account — with parameters, responses and examples, plus the OpenAPI 3.1 file for generating a client.
Replace text in an image POST
Queues an edit and returns immediately. Pass `callback_url`, or poll `GET /edits/{id}`: every 5 seconds while the job is `processing` or `queued` with `queue_position` 0, and every 30 seconds while it is further back in the queue. One edit is reserved now and refunded automatically if neither A nor B succeeds. If a replacement has no `box`, we read the image before answering, so this call usually takes 5–20 seconds (allow 90) and can return `422 text_not_found`.