---
title: "Recognize text in an image"
method: POST
path: "/v1/apple/ocr"
tags: ["Apple"]
---

# Recognize text in an image

`POST /v1/apple/ocr`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/apple/ocr`
- Auth: HTTP bearer

On-device text recognition using Apple's Vision framework. Always available —
no model downloads required. Supports 20+ languages, handwriting, and document layouts.

## Request body

- object
  - `image` string, required: Base64-encoded image data (PNG, JPEG, TIFF, HEIC)
  - `recognition_level` 'fast' | 'accurate': Recognition quality — "fast" for speed, "accurate" for quality
  - `language_correction` boolean: Whether to apply post-processing language correction
  - `languages` string[]: BCP 47 language hints (e.g. ["en-US", "fr-FR"])
  - `max_candidates` integer: Number of text candidates per observation

## Response `200`

Recognized text with per-line observations

- OCRResponse
  - `text` string, required: All recognized text joined by newlines
  - `observations` OCRObservation[], required
    - `text` string, required
    - `confidence` number, float, required
    - `bounding_box` object, required: Normalized coordinates (0–1), bottom-left origin (Vision framework convention)
      - `x` number, required
      - `y` number, required
      - `width` number, required
      - `height` number, required
  - `recognition_level` 'fast' | 'accurate', required
  - `language_correction` boolean, required

## Other responses

- `400`: Invalid request
- `413`: Payload too large (max 10MB)

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
