canonical: https://jentic.com/apis/hirak.site/hirak-ocr

# Hirak Site Hirak OCR API

Jentic publishes the only available OpenAPI specification for Hirak OCR API, keeping it validated and agent-ready. Hirak OCR extracts text from images using optical character recognition with support for more than 100 languages. The two-endpoint surface - POST /ocr to extract text and GET /languages to list supported languages - is authenticated with an X-API-Key header and is suitable for receipt parsing, document digitisation prototypes, and lightweight in-app text extraction. The API is intentionally small, so integration is fast and most engineering effort goes into pre-processing the input image.

## For AI agents

Extract text from images in 100+ languages with POST /ocr and discover supported languages via GET /languages. Authenticated with an X-API-Key header.

## Scope

Does not handle structured document field extraction, signature detection, or PDF parsing - use for raw text OCR from images only.

## Capabilities

- Extract text from an image with POST /ocr supporting more than 100 languages
- Enumerate supported OCR languages with GET /languages before submitting
- Read printed text from receipts, signs, and document scans
- Pre-process images upstream to improve OCR accuracy on low-contrast inputs
- Feed extracted text into downstream classifiers or search indexes
- Run lightweight document digitisation pipelines without a heavyweight OCR vendor

## Use cases

### Receipt Capture for Expense Tools

Expense apps let users photograph a receipt and capture line items without typing. POST /ocr returns the extracted text in the chosen language so a downstream parser can pick out date, total, and merchant. The 100+ language support covers most travel scenarios without switching providers.

Example prompt: When the user uploads a receipt photo, call POST /ocr with language=en and pass the returned text to a line-item parser to populate the expense form.

### Multilingual Document Digitisation

Teams digitising legacy documents in mixed languages need an OCR engine that supports the right scripts. /languages returns the list of supported languages so an agent can confirm coverage, and /ocr accepts a language parameter so the engine can be tuned per page.

Example prompt: First call GET /languages to confirm support for ja, then run POST /ocr with language=ja against each scanned page of a Japanese contract.

### In-App Text Lift from Screenshots

Productivity apps offer 'copy text from this screenshot' features. Hirak OCR's POST /ocr returns the text quickly enough to feel interactive in a desktop app, and the small API surface keeps the integration light.

Example prompt: When the user clicks 'extract text' on a screenshot, send the image to POST /ocr with language=auto and return the recognised text to the clipboard.

### AI Agent Document Reader

An AI assistant reads a user-supplied image and answers questions about its content. Through Jentic, the agent searches for the OCR operation, loads the schema, and executes POST /ocr with the user's vault-stored X-API-Key. The extracted text is then summarised by the agent's LLM.

Example prompt: When the user uploads a photo of a flyer, search Jentic for 'extract text from image', execute POST /ocr, and summarise the result for the user.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/ocr` | Extract text from an image |
| GET | `/languages` | List supported OCR languages |

## Key resources

- **OCR** — Extract text from an image in a supported language.
- **Languages** — List of OCR languages supported by the engine.

## Why Jentic

- **Setup:** Wiring the Hirak OCR API by hand means sending an X-API-Key header and posting image data with a language selection to the OCR endpoint. Through Jentic you install once, import the Hirak OCR API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** The Hirak OCR API takes the image in the request body rather than exposing scopable resource ids, so scoping stays at the operation level: limit the agent to the operations it needs, such as running OCR on an image or listing supported languages. You choose that set, so the read-only languages lookup can stand alone if you leave out the OCR operation.
- **Credential handling:** Your Hirak OCR X-API-Key is stored once, encrypted, by your own Jentic One instance and injected into the X-API-Key header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'extract text from an image', and Jentic returns the POST /ocr operation with its body schema so the agent submits the image and language without reading the reference docs.

## Related APIs

- **Mindee API** — Document understanding API that goes beyond raw OCR to structured field extraction.
- **OpenAI API** — GPT-4 vision can interpret OCR output or directly read images for downstream reasoning.
- **Abstract API** — Bundle of utility APIs that pair with Hirak OCR for downstream validation of extracted text.

## FAQ

### Why is there no official OpenAPI spec for Hirak OCR API?

Hirak does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Hirak OCR API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Hirak OCR API use?

The Hirak OCR API uses an X-API-Key header on every request to /ocr and /languages. Through Jentic, the X-API-Key value is stored in your Jentic One instance and injected at execution time so the raw key never enters the agent context.

### Can I OCR images in any language?

The engine supports more than 100 languages. Call GET /languages to confirm a specific language code is available, then pass it to POST /ocr in the language parameter for best accuracy on that script.

### What are the rate limits for the Hirak OCR API?

The OpenAPI specification does not declare specific rate limits. Hirak applies per-key quotas, so check your plan and add retry-with-backoff when running batch OCR over a large document set.

### How do I extract text from a receipt through Jentic?

Run pip install jentic, then await client.search('extract text from image'), load the POST /ocr schema, and execute with the receipt image and language=en. The returned text can be passed to a line-item parser.

### Does the API accept PDFs directly?

POST /ocr expects an image input. For PDFs, render each page to a PNG or JPG upstream and call /ocr per page, then concatenate the extracted text in page order.

### Can I limit what my agent is allowed to do with the Hirak OCR API?

Yes. Because the Hirak OCR API takes the image in the request body and exposes no scopable resource ids, you scope at the operation level in your own self-hosted Jentic One instance, where your rules decide which operations and credentials the agent may use. You grant only the operations the agent needs, such as running OCR on an image with POST /ocr or listing supported languages with GET /languages. If you leave out the OCR operation, the read-only GET /languages lookup can stand alone, and the agent cannot extract text.
