# Mathpix via Locus x402 — Math & Science OCR

> Mathpix via Locus x402 — Math & Science OCR is a paid API for AI agents from mathpix.x402.paywithlocus.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Extracts LaTeX, MathML, and structured text from images of mathematical equations, scientific notation, and handwritten content using Mathpix OCR, payable via x402 micropayment.

## Facts

- Endpoint: POST https://mathpix.x402.paywithlocus.com/mathpix/process-image?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mathpix-via-locus-x402-math-science-ocr-534ff37c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ifp22DQne3xK8iEOXfWRs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mathpix-via-locus-x402-math-science-ocr-534ff37c -d '<json body>'
```

Example prompt: Can you extract the LaTeX from this image of a handwritten calculus equation? Here's the URL: https://example.com/equation.jpg — return it in latex_styled format and also include any chemistry diagrams as SMILES if present.

## When to prefer this

Choose this endpoint when you need to extract structured mathematical notation (LaTeX, MathML) or scientific content from images or handwritten documents. It is specifically optimized for math and science OCR, outperforming general-purpose OCR tools on equations, matrices, integrals, and chemistry diagrams. Prefer it over generic OCR when the content contains symbolic math, and over manual transcription pipelines when you need LaTeX output directly. The x402 micropayment model makes it practical for per-call agent workflows without subscription overhead.

## Known failure modes

- Image URL is unreachable or returns a non-image response — OCR fails with an error
- Confidence score falls below the specified confidence_threshold — returns an error instead of low-quality output
- Image contains no recognizable math or text — returns empty or minimal output
- Invalid base64 encoding of image — request fails with a parsing error
- Unsupported output format string in 'formats' array — may be ignored or cause a validation error
- Payment authorization fails — request is rejected before processing begins

## How this service works

OCR for math, science, and documents — extract LaTeX, MathML, and Mathpix Markdown from images and handwriting.

## Output

Returns a JSON object containing the requested output formats (e.g. LaTeX, text, HTML, latex_styled), optional line/word segmentation data, SMILES for chemistry diagrams, and payment settlement details including the USDC amount charged. The 'data' field holds the OCR results keyed by requested format.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "src": {
   "type": "string"
  },
  "region": {
   "type": "object",
   "additionalProperties": true
  },
  "formats": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "rm_fonts": {
   "type": "boolean"
  },
  "rm_spaces": {
   "type": "boolean"
  },
  "include_smiles": {
   "type": "boolean"
  },
  "include_line_data": {
   "type": "boolean"
  },
  "include_word_data": {
   "type": "boolean"
  },
  "confidence_threshold": {
   "type": "number"
  },
  "idiomatic_eqn_arrays": {
   "type": "boolean"
  },
  "math_inline_delimiters": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "math_display_delimiters": {
   "type": "array",
   "items": {
    "type": "string"
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "payment": {
   "scheme": "exact",
   "settledUsdc": "0.001000",
   "authorizedMaxUsdc": "0.001000"
  },
  "request": {
   "id": "00000000-0000-4000-8000-000000000000",
   "statusUrl": "/requests/00000000-0000-4000-8000-000000000000"
  },
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mathpix-via-locus-x402-math-science-ocr-534ff37c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mathpix.x402.paywithlocus.com](https://www.zero.xyz/host/mathpix.x402.paywithlocus.com/llms.txt)
