canonical: https://jentic.com/apis/mathpix.com/mathpix

# Mathpix OCR API

The Mathpix OCR API converts images, PDFs, and handwriting into structured text, including formats such as LaTeX, Markdown, DOCX, and HTML. It processes a single image, submits documents for asynchronous OCR with status checks and result downloads, recognizes handwriting from stroke coordinates, and processes batches of images. A converter turns Mathpix Markdown into other output formats.

## For AI agents

Convert images, PDFs, and handwriting to structured text such as LaTeX, Markdown, DOCX, and HTML, and convert Mathpix Markdown to other formats.

## Scope

Does not handle translation, long-term document storage, or spreadsheet parsing. Use for OCR of images, PDFs, and equations only.

## Capabilities

- Convert a single image of text or equations to structured text such as LaTeX or Markdown
- Submit a PDF document for OCR and check its processing status
- Stream or download processed document results in a chosen format
- Recognize handwriting from stroke coordinates
- Process multiple images in one batch request
- Convert Mathpix Markdown to other output formats

## Use cases

### AI Agent Document OCR

An AI agent connected through Jentic turns a scanned PDF into clean, structured text by submitting the document, polling its processing status, and downloading the result as Markdown or LaTeX. This lets the agent read documents that contain equations and tables rather than only plain text.

Example prompt: Submit a PDF for OCR, poll its status until ready, and download the Markdown result

### Equation Image to LaTeX

A math or science workflow sends an image of an equation and gets back LaTeX ready to paste into a document. The single-image operation handles typeset and photographed equations and returns the structured markup directly.

Example prompt: Convert an image of a math equation to LaTeX

### Handwriting Recognition

An app that captures stylus input sends stroke coordinates to the strokes operation and receives recognized text and math. This supports digital-ink workflows where there is no rendered image to OCR.

Example prompt: Send handwriting stroke coordinates and get the recognized text and math

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v3/text` | Process a single image |
| POST | `/v3/pdf` | Submit a document for OCR |
| GET | `/v3/pdf/{pdf_id}` | Check document processing status |
| DELETE | `/v3/pdf/{pdf_id}` | Delete document results |
| POST | `/v3/strokes` | Process handwriting strokes |
| POST | `/v3/batch` | Process multiple images in one request |
| POST | `/v3/converter` | Convert Mathpix Markdown to other formats |

## Key resources

- **Text** — Process a single image into structured text
- **PDF** — Submit documents for OCR and retrieve results
- **Strokes** — Recognize handwriting from stroke coordinates
- **Batch** — Process multiple images in one request
- **Converter** — Convert Mathpix Markdown to other formats

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 61 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 79 / 100
  - Developer Experience & Jentic Compatibility: 57 / 100
  - AI-Readiness & Agent Experience: 44 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 76 / 100
- **View full report:** https://jentic.com/apis/mathpix.com/mathpix/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Mathpix OCR API by hand means sending both the `app_id` and `app_key` headers on every request and polling for PDF results yourself. Through Jentic you install once, import Mathpix from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** Mathpix carries the image or document in the request body, so rules bound which operations your agent may call, not which files it processes. You choose the operations it may use, such as processing images and documents, so deleting document results is not included unless you add it.
- **Credential handling:** Your Mathpix app id and app key are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'convert an image to LaTeX' or 'OCR a PDF', and Jentic returns the matching Mathpix operation with its input schema so the agent calls the right endpoint without reading the reference docs.

## Related APIs

- **Google Cloud Vision** — Google Cloud Vision performs general OCR and image analysis.
- **Veryfi** — Veryfi extracts structured data from receipts and documents via OCR.
- **OpenAI** — Pair Mathpix output with an OpenAI model to reason over the extracted text.

## FAQ

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

It authenticates with an API key: you send your `app_id` and `app_key` as request headers, as declared in its OpenAPI spec. Through Jentic both are stored encrypted by your own Jentic One instance and injected at call time, so they never appear in the agent's prompt or logs.

### Can I convert a PDF to Markdown with the Mathpix OCR API?

Yes. The PDF operation submits a document for OCR, you poll the status operation until it is ready, and then download the result in a format such as Markdown, DOCX, LaTeX, or HTML.

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

The OpenAPI spec does not specify rate limits for the Mathpix OCR API. See the Mathpix documentation at https://docs.mathpix.com for the current limits that apply to your plan.

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

Yes. Write a rule that allows only the image and document processing operations, so the agent can run OCR and read results but cannot delete stored document results, and every call it makes is logged.

### How do I OCR a document with the Mathpix OCR API through Jentic?

Search Jentic for 'convert an image to text', add the Mathpix OCR API from the directory, and store your app id and app key once. Your agent submits the image or PDF and reads the structured result. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Is there a Mathpix OCR API MCP server?

You don't need an MCP server to give your agent the Mathpix OCR API. Jentic connects it directly from the API Directory: import it, store your credentials once, and your agent calls the text, PDF, strokes, and converter operations. That keeps extra tool definitions out of the agent's context.
