Extract text from an image
vision_ocrExtracts exact text from images (OCR) for verbatim copying from screenshots, code images, terminal output, documents, and receipts. Supports plain, markdown, or JSON output.
Instructions
Extract exact text from an image (OCR). Use when the user wants literal text copied verbatim from a screenshot, code image, terminal output, document, or receipt. Not for explaining or understanding images (use vision_analyze).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional model override. | |
| detail | No | Optional detail level for providers that support it. | |
| imageUrl | No | Remote URL, data URL, or file URL. Mutually exclusive with imagePath and imageBase64. | |
| imagePath | No | Local absolute image path. Mutually exclusive with imageUrl and imageBase64. | |
| maxTokens | No | Optional max output tokens. | |
| imageBase64 | No | Base64-encoded image payload. Use this for uploaded attachments when the client can pass file contents. | |
| languageHint | No | Optional language hint such as zh-CN or en. | |
| outputFormat | No | Preferred OCR output format. Defaults to plain. | |
| imageMediaType | No | Required with imageBase64, for example image/png or image/jpeg. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text returned by the vision model. | |
| model | Yes | Model used for the request. | |
| mediaType | Yes | Resolved image media type. | |
| sourceLabel | Yes | Resolved image source label. |