# Mathpix Stroke OCR via Locus x402

> Mathpix Stroke OCR via Locus x402 is a paid API for AI agents from mathpix.x402.paywithlocus.com, paid per call via x402, $0.013/call, status unknown (last checked 2026-09-15).

Converts handwritten math stroke data into LaTeX, MathML, or Mathpix Markdown using Mathpix OCR, paid via x402 micropayment.

## Facts

- Endpoint: POST https://mathpix.x402.paywithlocus.com/mathpix/process-strokes
- Price: $0.013/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mathpix-stroke-ocr-via-locus-x402-a9175e64
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zUU5opfBRtjPfzTKWk4zs

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-stroke-ocr-via-locus-x402-a9175e64 -d '<json body>'
```

Example prompt: I have stroke coordinate data from a user drawing math equations on a tablet — can you run it through Mathpix to get back LaTeX and styled LaTeX? The strokes are x: [[10,20,30],[50,60]], y: [[5,15,25],[40,50]].

## When to prefer this

Use this endpoint when you have digital ink stroke data (arrays of x/y coordinates per stroke) from a stylus or drawing tablet and need to convert handwritten math into structured formats like LaTeX or MathML. Prefer this over image-based Mathpix endpoints when you have raw stroke data rather than a rasterized image. Prefer this over generic OCR services when the content is mathematical or scientific notation requiring LaTeX output.

## Known failure modes

- Malformed or empty stroke arrays return an error or empty recognition result
- Unsupported output format strings in the formats array may be silently ignored or cause a 400 error
- Payment failure or insufficient USDC balance blocks the request before OCR runs
- Very sparse or noisy stroke data may produce low-confidence or incorrect LaTeX output
- Network timeout if the Locus x402 payment gateway is unreachable

## 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 with a 'data' field containing the recognized math in requested formats (text, HTML, LaTeX, MathML), plus payment settlement details (USDC amount authorized and settled) and a request object with a UUID and a status URL for tracking.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "formats": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "strokes": {
   "type": "object",
   "required": [
    "strokes"
   ],
   "properties": {
    "strokes": {
     "type": "object",
     "required": [
      "x",
      "y"
     ],
     "properties": {
      "x": {
       "type": "array",
       "items": {
        "type": "array",
        "items": {
         "type": "number"
        }
       }
      },
      "y": {
       "type": "array",
       "items": {
        "type": "array",
        "items": {
         "type": "number"
        }
       }
      }
     },
     "additionalProperties": true
    }
   },
   "additionalProperties": true
  },
  "metadata": {
   "type": "object",
   "additionalProperties": true
  },
  "rm_fonts": {
   "type": "boolean"
  },
  "rm_spaces": {
   "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-stroke-ocr-via-locus-x402-a9175e64/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)
