{"uid":"cap_KT_It8DbyH28MlV_WtTF8","slug":"mathpix-process-strokes-8c2c6bb5","name":"Mathpix Process Strokes","description":"Recognize handwritten math/text from stroke coordinate data (digital ink). Returns LaTeX and Mathpix Markdown.","url":"https://mathpix.mpp.paywithlocus.com/mathpix/process-strokes?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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},"responseSchema":null,"example":{"request":{"formats":["latex_styled"],"strokes":"{\"x\": [[10, 20, 30], [50, 60]], \"y\": [[15, 25, 35], [55, 65]]}","rm_spaces":true,"math_display_delimiters":"$$"},"response":{"data":{"error":"Cannot get strokes from request","error_info":{"id":"strokes_syntax_error","message":"Cannot get strokes from request"}},"success":true}},"exampleRequest":{"formats":["latex_styled"],"strokes":"{\"x\": [[10, 20, 30], [50, 60]], \"y\": [[15, 25, 35], [55, 65]]}","rm_spaces":true,"math_display_delimiters":"$$"},"tags":["ocr","math","latex","equations","documents","ai"],"displayCostAmount":"0.013","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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":"mpp","network":"tempo","amountUsd":"0.013","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.013","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_woP8hnZ43GNGg4wnCCz3a","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.013","costPer":"request","priority":0,"asset":"0x20c000000000000000000000b9537d11c60e8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"Mathpix","brandSlug":"mathpix","brandBaseUrl":"https://mathpix.com","brandDocsUrl":"https://docs.mathpix.com","whatItDoes":"Converts handwritten stroke coordinate data into LaTeX, text, HTML, or styled math expressions using Mathpix OCR","exampleAgentPrompt":"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?","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:34:52.670Z","isFirstParty":false,"canonicalSlug":"mathpix-process-strokes-8c2c6bb5"}