Recognize handwritten math strokes and convert them to LaTeX, MathML, or Mathpix Markdown via MPP.
What it does
The Mathpix Process Strokes endpoint accepts digitized pen/stylus stroke data (arrays of x/y coordinate sequences) and returns recognized mathematical expressions in multiple output formats including plain text, LaTeX (styled), HTML, and structured data. It is served through the Locus MPP (Micropayment Protocol) gateway, settling per-call charges on the Tempo L2 network in pathUSD.
The endpoint is a POST-only route at `/mathpix/process-strokes`. The required input field is `strokes`, a JSON object containing arrays of coordinate arrays representing each pen stroke. Optional parameters let you choose output formats, set custom math delimiters, strip font commands, remove extra whitespace, and attach arbitrary metadata. The OpenAPI spec lists the price as 13,000 base units of pathUSD (6 decimals), which works out to $0.013 per request.
Note that the probe only tested HEAD and GET methods, both of which returned 404. Because the OpenAPI specification explicitly defines this as a POST endpoint, the 404s on HEAD/GET do not indicate the endpoint is down — they simply reflect that only POST is routed. The companion endpoint `/mathpix/process-image` on the same host handles image-based OCR at $0.005 per call. Full Mathpix API documentation is available at docs.mathpix.com, and Locus-specific integration docs are referenced at beta.paywithlocus.com/mpp/mathpix.md.
Capabilities
Use cases
- —Converting tablet or stylus handwriting into LaTeX for academic papers
- —Building real-time math tutoring apps that interpret student handwriting
- —Digitizing whiteboard math notes into structured, searchable formats
- —Integrating handwritten equation recognition into note-taking applications
- —Automating grading workflows by parsing handwritten math solutions
Fit
Best for
- —Apps that capture pen/stylus stroke coordinates and need LaTeX output
- —Agent workflows requiring pay-per-call math handwriting recognition without API keys
- —Developers who want micropayment-gated access to Mathpix without a subscription
Not for
- —Recognizing math from raster images (use the sibling /mathpix/process-image endpoint instead)
- —Full-document PDF conversion or batch processing of multi-page files
- —Free or high-volume bulk usage — each call costs $0.013
Quick start
curl -X POST https://mathpix.mpp.paywithlocus.com/mathpix/process-strokes \
-H "Content-Type: application/json" \
-H "X-Payment: <tempo-payment-token>" \
-d '{
"strokes": {"x": [[10, 20, 30], [50, 60]], "y": [[100, 110, 120], [200, 210]]},
"formats": "text"
}'Example
Request
{
"formats": "latex_styled",
"strokes": {
"x": [
[
10,
20,
30,
40
],
[
60,
70,
80
]
],
"y": [
[
100,
110,
105,
100
],
[
200,
210,
205
]
]
},
"rm_fonts": false,
"rm_spaces": true
}Response
{
"confidence": 0.97,
"request_id": "abc123",
"latex_styled": "x^{2} + y^{2} = r^{2}",
"confidence_rate": 0.97
}Endpoint
Quality
The OpenAPI spec provides a clear schema, pricing, and endpoint definition. However, the probe returned 404 because only POST is supported and HEAD/GET were tested, so liveness is not directly confirmed. No crawl pages returned useful documentation; response schema is inferred from Mathpix's known API behavior rather than directly captured.
Warnings
- —Endpoint liveness not directly confirmed — probe only tested HEAD/GET, both returned 404; POST was not probed
- —Response schema is inferred from general Mathpix API knowledge, not captured from this endpoint
- —Currency address 0x20c000000000000000000000b9537d11c60e8b50 assumed to be pathUSD with 6 decimals; if different, price calculation would change
- —No crawled documentation was available from the MPP gateway itself
Citations
- —OpenAPI spec defines /mathpix/process-strokes as a POST endpoint with stroke input and charge of 13000 base unitshttps://mathpix.mpp.paywithlocus.com
- —Mathpix API reference documentation is at docs.mathpix.comhttps://docs.mathpix.com
- —Locus MPP integration docs for Mathpix referenced at beta.paywithlocus.com/mpp/mathpix.mdhttps://beta.paywithlocus.com/mpp/mathpix.md
- —OCR for math, science, and documents — extract LaTeX, MathML, and Mathpix Markdown from images and handwritinghttps://mathpix.com