Mathpix Images API

Process a single image for STEM OCR.

Operations 1

POST /v3/text Process An Image #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mathpix-images-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mathpix-images-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mathpix App Tokens Images API
  description: 'Mint short-lived client-side tokens so browsers, mobile apps, and digital-ink surfaces can call Mathpix without exposing your long-lived app_key. Tokens default to 5 minutes and can be issued from 30 seconds to 12 hours. Token issuance is free.

    '
  version: v3
  contact:
    name: Mathpix Support
    url: https://docs.mathpix.com
    email: support@mathpix.com
  license:
    name: Mathpix Terms of Service
    url: https://mathpix.com/terms-of-service
servers:
- url: https://api.mathpix.com
  description: Production Server
security:
- AppKeyAuth: []
tags:
- name: Images
  description: Process a single image for STEM OCR.
paths:
  /v3/text:
    post:
      summary: Process An Image
      description: 'Submit a single image (by URL or base64) and receive Mathpix Markdown (MMD) plus optional structured data, HTML, styled LaTeX, line data, and word data. Auto-detects whether the content is printed or handwritten.

        '
      operationId: processImage
      tags:
      - Images
      parameters:
      - $ref: '#/components/parameters/AppIdHeader'
      - $ref: '#/components/parameters/AppKeyHeader'
      - $ref: '#/components/parameters/ContentTypeHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextRequest'
      responses:
        '200':
          description: Successful OCR result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextResponse'
        '401':
          description: Missing or invalid credentials.
        '429':
          description: Rate limit exceeded.
components:
  parameters:
    AppKeyHeader:
      name: app_key
      in: header
      required: true
      schema:
        type: string
      description: Mathpix application secret issued at console.mathpix.com.
    ContentTypeHeader:
      name: Content-Type
      in: header
      required: true
      schema:
        type: string
        default: application/json
    AppIdHeader:
      name: app_id
      in: header
      required: true
      schema:
        type: string
      description: Mathpix application identifier issued at console.mathpix.com.
  schemas:
    TextRequest:
      type: object
      description: Single-image OCR request body.
      properties:
        src:
          type: string
          description: Image URL or base64-encoded image (e.g. data:image/png;base64,...).
        metadata:
          type: object
          description: Free-form key/value metadata stored with the request for privacy and audit.
          additionalProperties: true
        formats:
          type: array
          description: Output formats requested in addition to MMD. Supported values include text, data, html, latex_styled.
          items:
            type: string
            enum:
            - text
            - data
            - html
            - latex_styled
        math_inline_delimiters:
          type: array
          description: Custom delimiters for inline math, e.g. ["\\(", "\\)"].
          items:
            type: string
        math_display_delimiters:
          type: array
          description: Custom delimiters for display math, e.g. ["\\[", "\\]"].
          items:
            type: string
        include_line_data:
          type: boolean
          description: Include line-by-line segmentation in the response.
          default: false
        include_word_data:
          type: boolean
          description: Include word-level segmentation in the response.
          default: false
        rm_spaces:
          type: boolean
          description: Strip extra whitespace inside equations.
          default: true
        confidence_threshold:
          type: number
          format: float
          description: Minimum confidence threshold (0.0 - 1.0) below which results are rejected.
          minimum: 0.0
          maximum: 1.0
    TextResponse:
      type: object
      description: OCR response containing recognized content and confidence metrics.
      properties:
        request_id:
          type: string
          description: Unique identifier for debugging.
        text:
          type: string
          description: Recognized content in Mathpix Markdown.
        latex_styled:
          type: string
          description: Styled LaTeX equivalent when latex_styled is requested.
        html:
          type: string
          description: HTML rendering when html is requested.
        data:
          type: array
          description: Structured data extracted from the image.
          items:
            type: object
            additionalProperties: true
        confidence:
          type: number
          format: float
          description: Probability of 100% accuracy in the range 0.0 - 1.0.
        confidence_rate:
          type: number
          format: float
          description: Output quality confidence in the range 0.0 - 1.0.
        is_printed:
          type: boolean
          description: True when printed content was detected.
        is_handwritten:
          type: boolean
          description: True when handwritten content was detected.
        auto_rotate_confidence:
          type: number
          format: float
        auto_rotate_degrees:
          type: integer
          enum:
          - 0
          - 90
          - -90
          - 180
        image_height:
          type: integer
        image_width:
          type: integer
        line_data:
          type: array
          description: Per-line segmentation when include_line_data=true.
          items:
            type: object
            additionalProperties: true
        word_data:
          type: array
          description: Per-word segmentation when include_word_data=true.
          items:
            type: object
            additionalProperties: true
        version:
          type: string
        error:
          type: string
          description: Error message if processing failed.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: header
      name: app_key