{"uid":"cap_zUU5opfBRtjPfzTKWk4zs","slug":"mathpix-stroke-ocr-via-locus-x402-a9175e64","name":"Mathpix Stroke OCR via Locus x402","description":"OCR for math, science, and documents — extract LaTeX, MathML, and Mathpix Markdown from images and handwriting.","url":"https://mathpix.x402.paywithlocus.com/mathpix/process-strokes","method":"POST","headers":{},"bodySchema":{"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"}}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.013","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.013/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.013","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.013","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AZLJ2I5ZF9GviUA8zXwJc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.013","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts handwritten math stroke data into LaTeX, MathML, or Mathpix Markdown using Mathpix OCR, paid via x402 micropayment.","exampleAgentPrompt":"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]].","exampleUseCases":[{"title":"Digitize handwritten homework solutions","prompt":"A student submitted their calculus homework by drawing on a tablet — I have the raw stroke coordinates. Can you use Mathpix to convert those strokes into LaTeX so I can render the equations on the web? I need both 'text' and 'latex_styled' output formats."},{"title":"Real-time equation editor input","prompt":"My app lets users write math with a stylus and I need to convert their strokes to MathML in near real time. Here are the stroke arrays: x: [[0,5,10]], y: [[0,3,6]]. Please return the 'data' and 'html' formats and strip any extra whitespace from the equations."},{"title":"Math tutoring platform transcription","prompt":"I'm building a math tutoring tool where students write answers by hand on a drawing pad. Take these stroke coordinates and extract the LaTeX representation using Mathpix — I want 'latex_styled' output and I'd like font commands removed so the output is clean."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:32:12.288Z","isFirstParty":false}