---
canonical_url: "https://docs.composio.dev/toolkits/mathpix"
markdown_url: "https://docs.composio.dev/toolkits/mathpix.md"
product: "platform"
version: null
last_updated: null
---

# Mathpix

Mathpix extracts text, mathematics, tables, and other structured content from images and documents and converts results into editable formats.

- **Category:** documents & ocr
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 29
- **Triggers:** 0
- **Slug:** `MATHPIX`
- **Version:** 20261014_01
- **Instant:** Supported on the latest version. Support varies by tool.

## Tools

### Convert Mathpix Markdown

**Slug:** `MATHPIX_CONVERT_MATHPIX_MARKDOWN`

Submit Mathpix Markdown, wait for one requested format to finish, then return the conversion ID and downloadable output file. The remote conversion remains if waiting fails or times out.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `metadata` | object | No | Optional JSON metadata stored with the conversion for correlation. |
| `output_format` | string ("md" | "docx" | "tex.zip" | "html" | "pdf" | "latex.pdf" | "pptx" | "xlsx" | "mmd.zip" | "md.zip" | "html.zip") | No | Single output format to request, wait for, and download. |
| `timeout_seconds` | number | No | Maximum total time to wait before failing with the conversion ID (10-900 seconds). |
| `mathpix_markdown` | string | Yes | Mathpix Markdown source to convert; the complete JSON request must remain under 10 MB. |
| `poll_interval_seconds` | number | No | Seconds between conversion status checks (1-30). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create App Token

**Slug:** `MATHPIX_CREATE_APP_TOKEN`

Mint a short-lived client OCR credential, optionally with a live ink strokes session. Requires explicit acknowledgement because the response exposes the new secret exactly once to the caller.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user_id` | string | No | Optional caller-owned user identifier associated with the token. |
| `expires_seconds` | integer | No | Token lifetime in seconds, from 30 seconds through 12 hours. |
| `include_strokes_session` | boolean | No | Also create a strokes session ID for client-side live ink recognition. This limits expires_seconds to at most 300 seconds. |
| `acknowledge_secret_output` | boolean | Yes | Must be true to acknowledge that the response contains a live credential that must not be logged, persisted insecurely, or shared with an untrusted client. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Conversion

**Slug:** `MATHPIX_DELETE_CONVERSION`

Permanently delete one Mathpix Markdown conversion's hosted output data after explicit confirmation. The response preserves the status immediately before deletion; Mathpix may continue to report that status after the output data has been deleted.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `conversion_id` | string | Yes | Conversion ID whose hosted outputs will be permanently deleted. |
| `confirm_delete` | boolean | Yes | Must be true to confirm permanent deletion of the conversion's hosted outputs. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Document

**Slug:** `MATHPIX_DELETE_DOCUMENT`

Permanently delete one Mathpix document source and its hosted outputs after explicit confirmation. The response reports the status immediately before deletion, not a deleted status marker, and cached downloads may remain reachable for up to 10 minutes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pdf_id` | string | Yes | Document job ID whose Mathpix-hosted source and outputs will be permanently deleted. |
| `confirm_delete` | boolean | Yes | Must be true to confirm permanent deletion of the document source and hosted outputs. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete File

**Slug:** `MATHPIX_DELETE_FILE`

Permanently delete one terminal Files API file and its Mathpix-hosted results. This does not remove customer-owned destination objects, reverse billing, or delete a file that is still processing.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_id` | string | Yes | Terminal Files API file ID to permanently delete. |
| `confirm_delete` | boolean | Yes | Must be true to confirm permanent deletion of Mathpix-hosted file data. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Finalize File Job

**Slug:** `MATHPIX_FINALIZE_FILE_JOB`

Permanently close one Files API job to new file additions and arm its completion webhook. Already accepted files may continue processing. Requires explicit confirmation; repeating the same finalization is provider-idempotent.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | Files API job to close permanently to new file additions. |
| `confirm_finalize` | boolean | Yes | Must be true to confirm that no more files can be added to this job. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get App Token

**Slug:** `MATHPIX_GET_APP_TOKEN`

Get expiry and ownership metadata for a specific short-lived Mathpix app token. The secret token is used only in the request path and is omitted from the returned object and provider-error diagnostics.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `app_token` | string | Yes | Secret app token whose expiry and ownership metadata to inspect. Use only a token obtained from a trusted source. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Conversion Result

**Slug:** `MATHPIX_GET_CONVERSION_RESULT`

Wait for an existing Mathpix Markdown conversion and requested format to finish, then return its status and downloadable output file without creating a conversion.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `conversion_id` | string | Yes | Conversion ID returned by Convert Mathpix Markdown or Mathpix. |
| `output_format` | string ("md" | "docx" | "tex.zip" | "html" | "pdf" | "latex.pdf" | "pptx" | "xlsx" | "mmd.zip" | "md.zip" | "html.zip") | No | Previously requested output format to wait for and download. |
| `timeout_seconds` | number | No | Maximum total time to wait before failing without deleting the conversion. |
| `poll_interval_seconds` | number | No | Seconds between conversion status checks. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document Result

**Slug:** `MATHPIX_GET_DOCUMENT_RESULT`

Wait for an existing Mathpix document job and requested format to finish, then return its status and downloadable output file without creating a new job.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pdf_id` | string | Yes | Document job ID returned by OCR Document or Mathpix. |
| `output_format` | string ("mmd" | "md" | "docx" | "tex.zip" | "html" | "pdf" | "latex.pdf" | "pptx" | "xlsx" | "mmd.zip" | "md.zip" | "html.zip" | "lines.json" | "lines.mmd.json") | No | Previously requested output format to wait for and download. |
| `timeout_seconds` | number | No | Maximum total time to wait before failing without deleting the job. |
| `poll_interval_seconds` | number | No | Seconds between status checks while waiting for the output. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get File Job

**Slug:** `MATHPIX_GET_FILE_JOB`

Get aggregate status, file and page counters, and timestamps for one Files API job. A completed job can still contain errored files; inspect files_errored and has_file_errors.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | Files API job ID to inspect. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get File Result

**Slug:** `MATHPIX_GET_FILE_RESULT`

Wait for an existing Files API file and selected format to finish, then return its status and downloadable output without creating a file.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_id` | string | Yes | Files API file ID to retrieve. |
| `output_format` | string ("mmd" | "md" | "docx" | "tex.zip" | "html" | "pdf" | "latex.pdf" | "pptx" | "xlsx" | "mmd.zip" | "md.zip" | "html.zip" | "lines.json" | "lines.mmd.json") | No | Previously requested output format to wait for and download. |
| `timeout_seconds` | number | No | Maximum wait before failing without deleting the file. |
| `poll_interval_seconds` | number | No | Seconds between file status checks. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Job File by Custom ID

**Slug:** `MATHPIX_GET_JOB_FILE_BY_CUSTOM_ID`

Get the complete Files API processing status for one job member using the exact caller-defined custom ID assigned at submission.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | Files API job containing the member file. |
| `custom_id` | string | Yes | Exact case-sensitive caller-defined ID assigned when this job member was submitted. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get OCR Usage

**Slug:** `MATHPIX_GET_OCR_USAGE`

Return one page of aggregated Mathpix OCR usage for a date range, optionally grouped by usage type, request configuration, or application.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `to_date` | string | No | Exclusive end date/time for the usage query in Mathpix's accepted format. |
| `group_by` | array | No | Dimensions used to aggregate usage rows. Multiple values are sent as repeated group_by query parameters. |
| `timespan` | string | No | Mathpix-supported time bucket for aggregating usage, such as month. |
| `from_date` | string | No | Inclusive start date/time for the usage query in Mathpix's accepted format. |
| `page_size` | integer | No | Maximum usage rows to request in this page; Mathpix does not document a maximum. |
| `usage_type` | string | No | Filter to a Mathpix usage category such as image or document processing. |
| `next_cursor` | string | No | Continuation cursor returned by a previous call; omit for the first page. |
| `request_args_hash` | string | No | Filter to the hash of one OCR request configuration. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Storage Onboarding Identities

**Slug:** `MATHPIX_GET_STORAGE_ONBOARDING_IDENTITIES`

Get the Mathpix AWS, Azure, and GCP identities needed to grant cloud-storage access. Requires explicit acknowledgement because the first call may lazily create the account's immutable external ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `confirm_create_external_id` | boolean | Yes | Must be true to acknowledge that the first call may permanently create the Mathpix account's immutable external ID. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Conversions

**Slug:** `MATHPIX_LIST_CONVERSIONS`

List one page of retained Mathpix Markdown conversion records, optionally filtered by date, and return IDs usable by conversion result or deletion tools.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `to_date` | string | No | Exclusive end date/time filter in the format accepted by Mathpix. |
| `from_date` | string | No | Inclusive start date/time filter in the format accepted by Mathpix. |
| `page_size` | integer | No | Maximum retained conversion records to request in this page. Mathpix does not publish a verified maximum. |
| `next_cursor` | string | No | Continuation cursor returned by a previous call; omit for the first page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Data Sources

**Slug:** `MATHPIX_LIST_DATA_SOURCES`

List cloud-storage data sources registered with Mathpix, returning only allowlisted non-secret metadata.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Documents

**Slug:** `MATHPIX_LIST_DOCUMENTS`

List retained document OCR jobs for the connected account, optionally filtered by date or document ID, and return one page.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pdf_id` | string | No | Filter to one document job ID. |
| `to_date` | string | No | Exclusive end date/time filter in the format accepted by Mathpix. |
| `from_date` | string | No | Inclusive start date/time filter in the format accepted by Mathpix. |
| `page_size` | integer | No | Maximum document records to request in this page. Mathpix does not publish a maximum. |
| `next_cursor` | string | No | Continuation cursor returned by a previous call; omit for the first page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List File Job Files

**Slug:** `MATHPIX_LIST_FILE_JOB_FILES`

List one cursor-paginated page of files in a Mathpix Files API job, optionally filtered by terminal status.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | Files API job whose member files to list. |
| `status` | string ("pending" | "split" | "completed" | "error") | No | Optional member status filter: pending, split, completed, or error. |
| `page_size` | integer | No | Maximum job files to return in this page (1-1000). |
| `next_cursor` | string | No | Opaque continuation cursor from a previous page; omit for the first page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List File Jobs

**Slug:** `MATHPIX_LIST_FILE_JOBS`

List one cursor-paginated page of Files API jobs newest first, optionally bounded by inclusive UTC dates.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end_date` | string | No | Inclusive UTC end date in yyyy-MM-dd format. |
| `page_size` | integer | No | Maximum jobs to return in this page (1-1000). |
| `start_date` | string | No | Inclusive UTC start date in yyyy-MM-dd format. |
| `next_cursor` | string | No | Opaque continuation cursor returned by a previous call; omit for the first page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### OCR Document

**Slug:** `MATHPIX_OCR_DOCUMENT`

Submit a PDF, office document, or ebook URL, wait for OCR and the requested conversion to finish, then return its Mathpix job ID and downloadable output file. Mathpix retains the remote job after success; call Delete Document when the hosted source and outputs are no longer needed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `metadata` | object | No | Optional JSON metadata stored with the document job for correlation. |
| `source_url` | string | Yes | Public URL of the PDF, office document, or ebook to process. |
| `output_format` | string ("mmd" | "md" | "docx" | "tex.zip" | "html" | "pdf" | "latex.pdf" | "pptx" | "xlsx" | "mmd.zip" | "md.zip" | "html.zip" | "lines.json" | "lines.mmd.json") | No | Single output format to request, wait for, and download. |
| `timeout_seconds` | number | No | Maximum total time to wait for OCR and conversion before failing. |
| `poll_interval_seconds` | number | No | Seconds between status checks while waiting for the output. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### OCR Image

**Slug:** `MATHPIX_OCR_IMAGE`

Extract text, math, tables, diagrams, or chemistry from one image URL or base64 data URI and return the requested OCR representations. Mathpix may retain the submitted image and result, and provides no image deletion endpoint.

**Instant:** Supported on the latest version.

**Instant pricing:** $0.002 per image OCR request

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tags` | array | No | Optional labels stored with the OCR request for later history searches. |
| `formats` | array | No | OCR representations to return; choose one or more of text, structured data, HTML, or styled LaTeX. |
| `metadata` | object | No | Optional JSON metadata stored with the OCR request for correlation. |
| `image_source` | string | Yes | Image to recognize: a base64 data URI (the whole request must stay under 5 MB), or a URL Mathpix can download without login (not expired, under 10 MB, served within 15 seconds). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Process Equation (Deprecated)

**Slug:** `MATHPIX_PROCESS_EQUATION_DEPRECATED`

Compatibility-only access to Mathpix's deprecated equation-image OCR endpoint. Use MATHPIX_OCR_IMAGE for all new image OCR work. This paid operation may retain the submitted image and result in Mathpix history.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `formats` | array | Yes | One or more legacy equation output representations to return. |
| `options` | object | No | Optional documented legacy OCR settings, such as tags, async, ocr, format_options, skip_recrop, confidence_threshold, beam_size, n_best, region, callback, metadata, include_detected_alphabets, auto_rotate_confidence_threshold, or enable_blue_hsv_filter. The reserved src and formats fields must be supplied through image_source and formats. |
| `image_source` | string | Yes | Public equation-image URL or base64 data URI. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Process File URI

**Slug:** `MATHPIX_PROCESS_FILE_URI`

Submit one public or registered-cloud document URI to the paid Files API, wait for OCR and one requested output, and return the retained file ID and downloadable result. Supply an idempotency key for safely retryable standalone submissions. External storage writes or callback delivery require explicit authorization.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | No | Optional existing unfinalized Files job to receive this file. |
| `filename` | string | No | Optional source filename shown in file status and output names. |
| `custom_id` | string | No | Caller-defined per-job file ID. Requires job_id; reusing the same job_id and custom_id safely deduplicates a retry. |
| `source_uri` | string | Yes | Public HTTPS URL, s3 URI, gs URI, or Azure Blob HTTPS URL for a document. Cloud locations must have a registered Mathpix data source. |
| `output_format` | string ("mmd" | "md" | "md.zip" | "mmd.zip" | "docx" | "pptx" | "xlsx" | "html" | "html.zip" | "tex.zip" | "latex.pdf" | "pdf" | "lines.json" | "lines.mmd.json") | No | Single output format to request, wait for, and download. |
| `destination_uri` | string | No | Optional registered s3, gs, or Azure Blob destination. Mathpix writes the requested output outside Mathpix when this is set. |
| `idempotency_key` | string | No | Stable key for safely retrying the identical standalone submission. Use job_id plus custom_id instead for a job-associated file. |
| `timeout_seconds` | number | No | Maximum total time to wait for OCR and the selected output. |
| `processing_options` | object | No | Optional documented PDF OCR, conversion, callback, destination-basename, and image-output settings. Dedicated tool fields cannot be overridden. |
| `poll_interval_seconds` | number | No | Seconds between file-status checks while waiting for the output. |
| `confirm_external_effects` | boolean | No | Set true when destination_uri is supplied or processing_options includes callback_url, confirming authorization for external storage writes or callback delivery. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Process Image Batch

**Slug:** `MATHPIX_PROCESS_IMAGE_BATCH`

Submit a paid asynchronous batch of 1-100 named public image URLs, wait until every key has a semantically successful OCR result, and return the retained batch ID and results. Explicit confirmation is required because Mathpix provides no batch deletion route and may deliver an external callback.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `images` | object | Yes | Map of 1-100 stable caller-chosen keys to public image URLs or per-image option objects containing a url. This tool cap bounds paid OCR usage per call. |
| `metadata` | object | No | Optional correlation metadata retained with the batch. |
| `callback_url` | string | No | Optional public HTTPS callback for progressive results. Mathpix receives it in callback.post, and this tool still polls as the required fallback. |
| `ocr_behavior` | string ("latex" | "text") | No | OCR behavior applied across the batch: text or legacy equation LaTeX. |
| `timeout_seconds` | number | No | Maximum total time to wait for every submitted key (10-1800 seconds). |
| `poll_interval_seconds` | number | No | Seconds between batch reads (1-30). |
| `confirm_batch_submission` | boolean | Yes | Must be true to confirm paid processing of every image, permanent batch retention, and authorization for callback delivery when callback_url is set. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Recognize Strokes

**Slug:** `MATHPIX_RECOGNIZE_STROKES`

Recognize handwritten math or text from aligned x/y digital-ink stroke arrays and return OCR representations. This paid call may retain the result.

**Instant:** Supported on the latest version.

**Instant pricing:** $0.002 per non-session digital-ink request

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `formats` | array | No | OCR representations to return. |
| `metadata` | object | No | Optional correlation metadata stored with the OCR result. |
| `x_coordinates` | array | Yes | X coordinates grouped by stroke; outer and inner lengths must exactly match y_coordinates. |
| `y_coordinates` | array | Yes | Y coordinates grouped by stroke; outer and inner lengths must exactly match x_coordinates. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Revoke App Token

**Slug:** `MATHPIX_REVOKE_APP_TOKEN`

Irreversibly revoke one short-lived app token immediately. Existing clients using the credential will stop authenticating. Requires explicit confirmation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `app_token` | string | Yes | Secret app token to revoke permanently; never use a token from an untrusted source. |
| `confirm_revoke` | boolean | Yes | Must be true to confirm immediate, irreversible credential revocation. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Search OCR Results

**Slug:** `MATHPIX_SEARCH_OCR_RESULTS`

Search retained image and stroke OCR history by date, identifiers, content, tags, or detected content and return one page of results.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tags` | array | No | Filter to OCR requests carrying these tags. |
| `text` | string | No | Filter by recognized text content. |
| `latex` | string | No | Filter by recognized styled LaTeX content. |
| `pdf_id` | string | No | Filter OCR records associated with this document job ID. |
| `to_date` | string | No | Exclusive end date/time filter in the format accepted by Mathpix. |
| `from_date` | string | No | Inclusive start date/time filter in the format accepted by Mathpix. |
| `page_size` | integer | No | Maximum OCR records to request in this page; Mathpix does not document a maximum. |
| `request_id` | string | No | Return the OCR record with this request ID. |
| `next_cursor` | string | No | Continuation cursor returned by a previous call; omit for the first page. |
| `content_types` | array | No | Require selected detected content types. Each selection maps to its corresponding Mathpix detection filter. |
| `include_null_results` | boolean | No | Include retained requests that have no OCR result. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Submit File Job

**Slug:** `MATHPIX_SUBMIT_FILE_JOB`

Submit 1 to 200,000 remote documents as one paid asynchronous Mathpix Files job. This creates retained processing state and may read or write external storage or deliver callbacks. Acceptance defers per-file validation, so use job status and member listing tools to determine actual outcomes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `files` | array | Yes | One to 200,000 typed remote-file entries. Acceptance is asynchronous; invalid individual entries can become per-file errors after this call returns. |
| `job_id` | string | No | Optional caller-chosen job ID. Required when any file has custom_id and useful for deterministic follow-up and per-file idempotency. |
| `job_options` | object | No | Optional documented job-wide PDF OCR, callback, and image-output options. It cannot override files, job_id, conversion_formats, or idempotency controls. |
| `idempotency_key` | string | No | Stable whole-batch retry key used only when job_id is omitted. Reuse it only with the exact same files and options. |
| `conversion_formats` | object | No | Optional output formats applied to every file in the job. |
| `confirm_bulk_submission` | boolean | Yes | Must be true to confirm the submitted file count, paid processing, deferred item errors, retained state, possible external reads or writes, and authorization for any configured callback delivery. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Upload and Process File

**Slug:** `MATHPIX_UPLOAD_AND_PROCESS_FILE`

Upload one local document to the paid Mathpix Files API, wait until OCR and one requested output are ready, then return the retained Mathpix file ID and a downloadable result. The operation can consume page quota and does not delete the remote file; use Delete File when it is no longer needed. External storage writes or callback delivery require explicit authorization.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | Local document to upload to Mathpix for asynchronous processing. |
| `job_id` | string | No | Existing unfinalized Files job to which Mathpix should add this file. |
| `filename` | string | No | Optional display filename sent as a separate multipart form field. |
| `custom_id` | string | No | Caller-defined job member ID. Requires job_id. |
| `output_format` | string ("mmd" | "md" | "md.zip" | "mmd.zip" | "docx" | "pptx" | "xlsx" | "html" | "html.zip" | "tex.zip" | "latex.pdf" | "pdf" | "lines.json" | "lines.mmd.json") | No | Single output format to request, wait for, and download. |
| `idempotency_key` | string | No | Stable key for safely retrying a standalone upload. Do not combine it with job_id; job members use the job_id and custom_id pair instead. |
| `timeout_seconds` | number | No | Maximum total time to wait for OCR and the selected output. |
| `processing_options` | object | No | Optional documented Files/PDF OCR, conversion, destination, and callback options. Do not include file, job, filename, idempotency, source, or conversion_formats controls; use this tool's dedicated fields instead. |
| `poll_interval_seconds` | number | No | Seconds between status checks while waiting for processing. |
| `confirm_external_effects` | boolean | No | Set true when processing_options includes destination_uri or callback_url, confirming authorization for external storage writes or callback delivery. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
