# Mathpix Process Strokes

> Mathpix Process Strokes is a paid API for AI agents from Mathpix at mathpix.mpp.paywithlocus.com, paid per call via MPP, $0.013/call, status unknown (last checked 2026-10-12).

Converts handwritten stroke coordinate data into LaTeX, text, HTML, or styled math expressions using Mathpix OCR

## Facts

- Endpoint: POST https://mathpix.mpp.paywithlocus.com/mathpix/process-strokes?utm_source=zero.xyz
- Price: $0.013/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Provider: Mathpix
- Docs: https://docs.mathpix.com
- Website: https://mathpix.com
- Tags: ocr, math, latex, equations, documents, ai
- Canonical page: https://www.zero.xyz/c/mathpix-process-strokes-8c2c6bb5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KT_It8DbyH28MlV_WtTF8

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-process-strokes-8c2c6bb5 -d '<json body>'
```

Example prompt: I have stroke coordinate data from a handwritten math equation — the x arrays are [[10,20,30],[50,60]] and y arrays are [[5,15,25],[40,50]] — can you run it through Mathpix and give me back the latex_styled output with display math delimiters?

## When to prefer this

Use this endpoint when you have raw digital ink or stylus stroke coordinate data (arrays of x/y points per stroke) and need to convert it to LaTeX or other math-friendly formats. It is specifically designed for pen/tablet input rather than image files — prefer the Process Image endpoint when you have a raster image of handwritten math instead.

## Known failure modes

- Invalid or malformed stroke data JSON returns a 400 error
- Empty stroke arrays may result in empty or low-confidence output
- Unsupported format string values may cause a 422 validation error
- Stroke data representing non-mathematical content may yield poor recognition quality
- Network timeout if stroke payload is extremely large

## How this service works

Recognize handwritten math/text from stroke coordinate data (digital ink). Returns LaTeX and Mathpix Markdown.

## Output

Returns a structured object containing the recognized mathematical content in the requested output formats (text, data, HTML, latex_styled), optionally with custom math delimiters applied and whitespace normalized according to rm_spaces and rm_fonts settings.

## Example request

```json
{
 "formats": [
  "latex_styled"
 ],
 "strokes": "{\"x\": [[10, 20, 30], [50, 60]], \"y\": [[15, 25, 35], [55, 65]]}",
 "rm_spaces": true,
 "math_display_delimiters": "$$"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "strokes"
 ],
 "properties": {
  "formats": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Output formats: \"text\", \"data\", \"html\", \"latex_styled\"."
  },
  "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
    }
   },
   "description": "Stroke data: { x: [[x1, x2, ...], ...], y: [[y1, y2, ...], ...] } — arrays of coordinate arrays per stroke.",
   "additionalProperties": true
  },
  "metadata": {
   "type": "object",
   "description": "Custom key-value metadata, e.g. { improve_mathpix: true }.",
   "additionalProperties": true
  },
  "rm_fonts": {
   "type": "boolean",
   "description": "Strip font commands. Default: false."
  },
  "rm_spaces": {
   "type": "boolean",
   "description": "Remove extra whitespace from equations. Default: true."
  },
  "math_inline_delimiters": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Custom inline math delimiters."
  },
  "math_display_delimiters": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Custom display math delimiters."
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mathpix-process-strokes-8c2c6bb5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mathpix.mpp.paywithlocus.com](https://www.zero.xyz/host/mathpix.mpp.paywithlocus.com/llms.txt)
