> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Mathpix

The Mathpix connector lets your AI agent act in each user's Mathpix account. Each user connects their own Mathpix API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 15 tools.

**Authentication:** API Key
**Categories:** Files & Documents, AI, Developer Tools
**Tools:** 15: 11 read, 2 write, 2 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=MATHPIX)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Mathpix connection

   In **AgentKit > Connections**, create a Mathpix connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'mathpix'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Mathpix:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'mathpix_list_ocr_results',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "mathpix"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Mathpix:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="mathpix_list_ocr_results",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Mathpix credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'mathpix_get_conversion_result',
  toolInput: {
    conversion_id: '<conversion_id>',
    format: 'md',
  },
  connector: 'mathpix',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="mathpix_get_conversion_result",
    tool_input={
        "conversion_id": "<conversion_id>",
        "format": "md",
    },
    connection_name="mathpix",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `mathpix_get_conversion_result`

Get Conversion Result · Read-only

Download the text output of a Mathpix Markdown conversion: Markdown, HTML or the source Mathpix Markdown.
Returns the converted content as text.
Use this after mathpix_get_conversion_status shows the format completed. Use mathpix_get_pdf_result for a processed document.
Requires a conversion_id from mathpix_convert_markdown.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `conversion_id` (`string`, required): The conversion_id returned by mathpix_convert_markdown. Example: 2024_01_15_abc123def456
- `format` (`string`, required): Output to download: md (plain Markdown) or html must have been requested in formats and show completed; mmd returns the submitted Mathpix Markdown. One of: `md`, `html`, `mmd`.

Example input: `{"conversion_id":"<conversion_id>","format":"md"}`

### `mathpix_get_conversion_status`

Get Conversion Status · Read-only

Check the progress of each output format of a Mathpix conversion.
Returns status and conversion_status, a map from format (docx, md, pdf and so on) to received, loaded, processing, completed or error, with error_info on failure.
Use this after mathpix_convert_markdown, or with a pdf_id to track the conversion_formats of mathpix_submit_pdf. Use mathpix_get_pdf_status for a document's OCR progress.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `conversion_id` (`string`, required): The conversion_id returned by mathpix_convert_markdown, or a pdf_id from mathpix_submit_pdf to check that document's conversion formats. Example: 2024_01_15_abc123def456

Example input: `{"conversion_id":"<conversion_id>"}`

### `mathpix_get_ocr_usage`

Get OCR Usage · Read-only

Get Mathpix API usage counts over a date range, grouped by usage type, request settings or app.
Returns ocr_usage, one record per period and group with from_date, app_id, usage_type, request_args_hash and count.
Use this to track consumption or reconcile billing. Use mathpix_list_ocr_results to see the individual results.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `group_by` (`string`, required): How to aggregate the counts: usage_type (image, image-async, pdf pages and so on), request_args_hash (identical request settings) or app_id. One of: `usage_type`, `request_args_hash`, `app_id`.
- `timespan` (`string`, required): Length of each aggregation period. Mathpix's documentation shows month; it does not list other values. Example: month
- `from_date` (`string`, optional): Only include results at or after this ISO 8601 date-time (inclusive). Example: 2026-07-01T00:00:00.000Z
- `to_date` (`string`, optional): Only include results before this ISO 8601 date-time (exclusive). Example: 2026-08-01T00:00:00.000Z

Example input: `{"group_by":"usage_type","timespan":"<timespan>"}`

### `mathpix_get_pdf_lines`

Get PDF Lines · Read-only

Download line-by-line data for a processed document.
Returns pages, each with page number, size and lines carrying type, text, Mathpix Markdown (text_display), bounding region, contour and confidence.
Use this to locate content on the page or filter by confidence. Use mathpix_get_pdf_result for the document as one Markdown or HTML text.
Requires a pdf_id whose status is completed.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `pdf_id` (`string`, required): The pdf_id returned by mathpix_submit_pdf, or the id field from mathpix_list_pdf_results. Example: 2024_01_15_abc123def456

Example input: `{"pdf_id":"<pdf_id>"}`

### `mathpix_get_pdf_result`

Get PDF Result · Read-only

Download the text output of a processed document: Mathpix Markdown, plain Markdown or HTML.
Returns the document content as text.
Use this to read a document after mathpix_get_pdf_status shows completed. Use mathpix_get_pdf_lines for per-line positions and confidence.
Requires a pdf_id from mathpix_submit_pdf.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `format` (`string`, required): Output to download: mmd is Mathpix Markdown (always available once processing completes), md is plain Markdown, html is HTML. md and html are converted on demand if they were not requested at submission; while that runs Mathpix answers 202 with a status object instead of the content. A 404 with a status object means the document is not finished yet. One of: `mmd`, `md`, `html`.
- `pdf_id` (`string`, required): The pdf_id returned by mathpix_submit_pdf, or the id field from mathpix_list_pdf_results. Example: 2024_01_15_abc123def456

Example input: `{"format":"mmd","pdf_id":"<pdf_id>"}`

### `mathpix_get_pdf_status`

Get PDF Status · Read-only

Check the processing status of a document submitted with mathpix_submit_pdf.
Returns status (received, loaded, split, completed or error), num_pages, num_pages_completed, percent_done and conversion_status for each requested format.
Poll this until status is completed before calling mathpix_get_pdf_result; percent_done reaches 100 before the output is ready. Use mathpix_get_conversion_status for conversion progress only.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `pdf_id` (`string`, required): The pdf_id returned by mathpix_submit_pdf, or the id field from mathpix_list_pdf_results. Example: 2024_01_15_abc123def456

Example input: `{"pdf_id":"<pdf_id>"}`

### `mathpix_list_ocr_results`

List OCR Results · Read-only

List past Mathpix image results (from image, equation, strokes and document requests), newest first, with filters for date, tags, text and content type.
Returns ocr_results, each with timestamp, endpoint, image_id, request_args, the full result and detections such as is_handwritten or contains_table.
Use this to find earlier image OCR results. Use mathpix_list_pdf_results for document jobs.
Results sent with improve_mathpix set to false are not listed.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `app_id` (`string`, optional): Only include results from this Mathpix app ID, for accounts with several apps. Example: mycompany_abc123
- `contains_chemistry` (`boolean`, optional): Set to true to include only results that contain a chemistry diagram.
- `contains_diagram` (`boolean`, optional): Set to true to include only results that contain a diagram.
- `contains_table` (`boolean`, optional): Set to true to include only results that contain a table.
- `from_date` (`string`, optional): Only include results at or after this ISO 8601 date-time (inclusive). Example: 2026-07-01T00:00:00.000Z
- `is_handwritten` (`boolean`, optional): Set to true to include only results that contain handwritten text or math.
- `is_printed` (`boolean`, optional): Set to true to include only results that contain printed text or math.
- `latex_styled` (`string`, optional): Only include results whose latex_styled output contains this string. Example: \frac
- `page` (`integer`, optional): Page of results to return, starting at 1 (maximum 10000). Mathpix default: 1.
- `per_page` (`integer`, optional): Number of results per page. Mathpix default: 100.
- `tags` (`array`, optional): Only include results that carry these tags (set with the tags input of the processing tools). Example: ["homework"]
- `text` (`string`, optional): Only include results whose text output contains this string. Example: x^{2}
- `to_date` (`string`, optional): Only include results before this ISO 8601 date-time (exclusive). Example: 2026-08-01T00:00:00.000Z

Example input: `{}`

### `mathpix_list_pdf_results`

List PDF Results · Read-only

List documents previously submitted to Mathpix, with an optional date range.
Returns pdfs, each with id, input_file, status, created_at, modified_at, num_pages, num_pages_completed and request_args.
Use this to find a pdf_id you no longer have. Use mathpix_get_pdf_status for one document's current status, and mathpix_list_ocr_results for image results.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `app_id` (`string`, optional): Only include results from this Mathpix app ID, for accounts with several apps. Example: mycompany_abc123
- `from_date` (`string`, optional): Only include results at or after this ISO 8601 date-time (inclusive). Example: 2026-07-01T00:00:00.000Z
- `page` (`integer`, optional): Page of results to return, starting at 1 (maximum 10000). Mathpix default: 1.
- `per_page` (`integer`, optional): Number of results per page. Mathpix default: 100.
- `to_date` (`string`, optional): Only include results before this ISO 8601 date-time (exclusive). Example: 2026-08-01T00:00:00.000Z

Example input: `{}`

### `mathpix_process_equation`

Process Equation · Read-only

Read one equation image with Mathpix's legacy equation endpoint and return it in the LaTeX and math notations you choose.
Returns the requested formats (for example latex_styled, latex_simplified, mathml, asciimath, wolfram), latex_confidence and, with n_best, alternative candidates.
Use this when you need MathML, AsciiMath, Wolfram or simplified LaTeX for a single equation. Use mathpix_process_image for everything else; Mathpix recommends it for new work.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `formats` (`array`, required): LaTeX and math formats to return. text and text_display give text with math in delimiters; latex_normal, latex_styled and latex_simplified are LaTeX variants (styled adds \left/\right for appearance, simplified shortens operators for symbolic processing); latex_list splits several equations into a list; mathml, asciimath and wolfram give those notations (wolfram is ready for Wolfram Alpha). Example: ["latex_styled", "asciimath"]
- `src` (`string`, required): The equation image to read, as a public image URL (http or https) or a base64 data URL such as data:image/png;base64,iVBORw0KGgo... Supported image types include JPEG, PNG, WebP, BMP and TIFF. Mathpix downloads URLs itself (up to 10 MB, 15 second timeout); a base64 image must be 2 MB or less. Example: https://mathpix-ocr-examples.s3.amazonaws.com/cases_hw.jpg
- `beam_size` (`integer`, optional): Number of candidate results (1 to 10) Mathpix considers during recognition. Needed when n_best is set. Example: 5
- `confidence_threshold` (`number`, optional): Minimum confidence between 0 and 1. When the result's confidence is below this value, Mathpix returns a math_confidence error instead of a result. Example: 0.5
- `displaymath_delims` (`array`, optional): Begin and end delimiters for display math in the text formats (sent as format_options.displaymath_delims), as a two-item list. Example: ["$$", "$$"]
- `improve_mathpix` (`boolean`, optional): Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.
- `include_detected_alphabets` (`boolean`, optional): Return detected_alphabets, which flags each alphabet (en, ru, zh and so on) found in the image.
- `math_delims` (`array`, optional): Begin and end delimiters for inline math in the text formats (sent as format_options.math_delims), as a two-item list. Example: ["$", "$"]
- `n_best` (`integer`, optional): Number of highest-confidence alternatives to return in candidates, from 1 up to beam_size. Requires beam_size. Example: 3
- `ocr` (`array`, optional): What to read: ["math"] (the default) reads math only; ["math", "text"] also reads the text around it.
- `region` (`object`, optional): Restrict recognition to one rectangle of the image, in pixels. Give all four keys: top_left_x, top_left_y, width and height. Example: {"top_left_x": 0, "top_left_y": 0, "width": 400, "height": 120}
- `skip_recrop` (`boolean`, optional): Read the whole image instead of letting Mathpix crop to the area it thinks holds the equation.
- `tags` (`array`, optional): Labels stored with this result so it can be found later with mathpix_list_ocr_results. Example: ["homework", "batch-42"]
- `transforms` (`array`, optional): Clean-up steps applied to the LaTeX formats (sent as format_options.transforms): rm_spaces removes superfluous spaces, rm_newlines joins text lines with spaces, rm_fonts drops mathbb/mathbf/mathcal/mathrm, rm_style_syms replaces styled symbols with plain ones, rm_text drops text left or right of the math, long_frac turns long division into a fraction. Example: ["rm_spaces", "rm_fonts"]

Example input: `{"formats":["latex_styled","asciimath"],"src":"<src>"}`

### `mathpix_process_image`

Process Image · Read-only

Read the math, text, tables and chemistry diagrams in one image (printed or handwritten) with Mathpix OCR.
Returns Mathpix Markdown in text, with optional html, latex_styled, data, line_data or word_data, plus confidence and is_handwritten / is_printed flags.
Use this for photos, screenshots and scans of a single image. Use mathpix_submit_pdf for PDFs and other multi-page documents, and mathpix_process_strokes for pen-stroke coordinates.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `src` (`string`, required): The image to read, as a public image URL (http or https) or a base64 data URL such as data:image/png;base64,iVBORw0KGgo... Supported image types include JPEG, PNG, WebP, BMP and TIFF. Mathpix downloads URLs itself (up to 10 MB, 15 second timeout); a base64 image must be 2 MB or less. Example: https://mathpix-ocr-examples.s3.amazonaws.com/cases_hw.jpg
- `alphabets_allowed` (`object`, optional): Alphabets to suppress in the output, as a map from alphabet code to false. Codes: en, hi, zh, ja, ko, ru, th, ta, te, gu, bn, vi. All alphabets are allowed by default; suppressing unused ones avoids look-alike characters such as Latin B and Cyrillic В. Example: {"ru": false, "hi": false}
- `confidence_threshold` (`number`, optional): Minimum confidence between 0 and 1. When the result's confidence is below this value, Mathpix returns a math_confidence error instead of a result. Example: 0.5
- `data_options` (`object`, optional): Extra representations to include in the data and html outputs. Each key is a boolean flag: include_asciimath, include_latex, include_mathml and include_svg add math in that notation; include_table_html and include_tsv add tables as HTML or tab-separated values; include_sub_math splits math into sub-expressions. Only these keys are accepted. Example: {"include_asciimath": true, "include_tsv": true}
- `enable_document_layout` (`boolean`, optional): Treat the image as a full document page: improves multi-line page parsing and produces structured output such as nested lists and pseudocode blocks. Leave off (the default) for snippets such as a single equation or paragraph.
- `formats` (`array`, optional): Output formats to return. text is Mathpix Markdown with math inside \( \) and \[ \] delimiters; html is HTML rendered from it; data returns math, tables and other elements in the formats chosen with data_options; latex_styled returns one LaTeX string when the whole image is a single equation. Omit to return text only. Example: ["text", "latex_styled"]
- `idiomatic_braces` (`boolean`, optional): Remove unnecessary braces from LaTeX output, so x^2 is returned instead of x^{2}. Mathpix default: false.
- `idiomatic_eqn_arrays` (`boolean`, optional): Use aligned, gathered or cases environments instead of array for a list of equations. Mathpix default: false.
- `improve_mathpix` (`boolean`, optional): Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.
- `include_detected_alphabets` (`boolean`, optional): Return detected_alphabets, which flags each alphabet (en, ru, zh and so on) found in the image.
- `include_equation_tags` (`boolean`, optional): Keep equation numbers inside the LaTeX as \tag{1.12}. Setting this to true also turns on idiomatic equation arrays.
- `include_inchi` (`boolean`, optional): Add InChI and InChI key attributes to each <smiles> element. Only applies when include_smiles is true.
- `include_line_data` (`boolean`, optional): Return line_data: one entry per detected line with its type (text, math, table, diagram and so on), contour coordinates, confidence and whether it is part of the main output.
- `include_smiles` (`boolean`, optional): Recognize chemistry structure diagrams and return them as SMILES inside <smiles>...</smiles> in the text output (experimental). Mathpix default: false.
- `include_word_data` (`boolean`, optional): Return word_data: one entry per detected word with its text, contour coordinates and confidence. Cannot be combined with enable_document_layout.
- `math_display_delimiters` (`array`, optional): Begin and end delimiters for display (block) math in the text output, as a two-item list. Default is ["\\[", "\\]"]. Example: ["$$", "$$"]
- `math_inline_delimiters` (`array`, optional): Begin and end delimiters for inline math in the text output, as a two-item list. Default is ["\\(", "\\)"]. Example: ["$", "$"]
- `numbers_default_to_math` (`boolean`, optional): Always treat numbers as math, so "Answer: 17" becomes "Answer: \( 17 \)". Mathpix default: false.
- `region` (`object`, optional): Restrict recognition to one rectangle of the image, in pixels. Give all four keys: top_left_x, top_left_y, width and height. Example: {"top_left_x": 0, "top_left_y": 0, "width": 400, "height": 120}
- `rm_fonts` (`boolean`, optional): Remove font commands such as \mathbf and \mathrm from equations in the latex_styled and text outputs. Mathpix default: false.
- `rm_spaces` (`boolean`, optional): Remove extra white space from equations in the latex_styled and text outputs. Mathpix default: true.
- `tags` (`array`, optional): Labels stored with this result so it can be found later with mathpix_list_ocr_results. Example: ["homework", "batch-42"]

Example input: `{"src":"<src>"}`

### `mathpix_process_strokes`

Process Handwriting Strokes · Read-only

Recognize handwriting (math and text) from digital ink stroke coordinates, without rendering an image first.
Returns Mathpix Markdown in text, latex_styled when the input is one expression, optional html and data, plus confidence.
Use this when you have pen or touch coordinates from a canvas or stylus. Use mathpix_process_image when you have a picture of the handwriting.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `x` (`array`, required): X coordinates of the handwriting, one list per pen stroke, in the order the strokes were drawn. Must line up with y: the same number of strokes and the same number of points in each. Example: [[131, 133, 140], [231, 233, 235]]
- `y` (`array`, required): Y coordinates of the handwriting, one list per pen stroke, matching x point for point. Example: [[213, 212, 210], [231, 232, 235]]
- `confidence_threshold` (`number`, optional): Minimum confidence between 0 and 1. When the result's confidence is below this value, Mathpix returns a math_confidence error instead of a result. Example: 0.5
- `data_options` (`object`, optional): Extra representations to include in the data and html outputs. Each key is a boolean flag: include_asciimath, include_latex, include_mathml and include_svg add math in that notation; include_table_html and include_tsv add tables as HTML or tab-separated values; include_sub_math splits math into sub-expressions. Only these keys are accepted. Example: {"include_asciimath": true, "include_tsv": true}
- `formats` (`array`, optional): Output formats to return. text is Mathpix Markdown with math inside \( \) and \[ \] delimiters; html is HTML rendered from it; data returns math, tables and other elements in the formats chosen with data_options; latex_styled returns one LaTeX string when the whole image is a single equation. Omit to return text only. Example: ["text", "latex_styled"]
- `idiomatic_braces` (`boolean`, optional): Remove unnecessary braces from LaTeX output, so x^2 is returned instead of x^{2}. Mathpix default: false.
- `idiomatic_eqn_arrays` (`boolean`, optional): Use aligned, gathered or cases environments instead of array for a list of equations. Mathpix default: false.
- `improve_mathpix` (`boolean`, optional): Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.
- `include_equation_tags` (`boolean`, optional): Keep equation numbers inside the LaTeX as \tag{1.12}. Setting this to true also turns on idiomatic equation arrays.
- `math_display_delimiters` (`array`, optional): Begin and end delimiters for display (block) math in the text output, as a two-item list. Default is ["\\[", "\\]"]. Example: ["$$", "$$"]
- `math_inline_delimiters` (`array`, optional): Begin and end delimiters for inline math in the text output, as a two-item list. Default is ["\\(", "\\)"]. Example: ["$", "$"]
- `numbers_default_to_math` (`boolean`, optional): Always treat numbers as math, so "Answer: 17" becomes "Answer: \( 17 \)". Mathpix default: false.
- `rm_fonts` (`boolean`, optional): Remove font commands such as \mathbf and \mathrm from equations in the latex_styled and text outputs. Mathpix default: false.
- `rm_spaces` (`boolean`, optional): Remove extra white space from equations in the latex_styled and text outputs. Mathpix default: true.
- `tags` (`array`, optional): Labels stored with this result so it can be found later with mathpix_list_ocr_results. Example: ["homework", "batch-42"]

Example input: `{"x":[],"y":[]}`

### `mathpix_convert_markdown`

Convert Markdown · Write

Convert a Mathpix Markdown document into DOCX, Markdown, HTML, PDF, LaTeX, PowerPoint or Excel.
Returns conversion_id, the handle for status checks and downloads.
Use this for Markdown you already have. Use the conversion_formats input of mathpix_submit_pdf to convert a document while it is processed.
Poll mathpix_get_conversion_status until each format is completed, then read text formats with mathpix_get_conversion_result.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `formats` (`array`, required): Output formats to produce. md and html are text and can be read with mathpix_get_conversion_result; docx, xlsx (tables only), pptx, pdf, latex.pdf and the zip formats are binary files. Example: ["docx", "tex.zip"]
- `mmd` (`string`, required): The Mathpix Markdown (MMD) document to convert, as one string. MMD is Markdown with LaTeX math in \( \) and \[ \] delimiters, as returned by mathpix_process_image or mathpix_get_pdf_result. The request body can be up to 10 MB. Example: # Notes\n\nThe area is \( \pi r^2 \).
- `conversion_options` (`object`, optional): Settings for specific formats, keyed by format name. For example docx takes font, fontSize (half-points), orientation and margins; md takes math delimiters and escape flags; pdf takes fontSize, margin and custom_css; html takes math_output_format (svg, mathml or latex). Example: {"docx": {"font": "Arial", "fontSize": 24}}
- `improve_mathpix` (`boolean`, optional): Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.

Example input: `{"formats":["docx","tex.zip"],"mmd":"<mmd>"}`

### `mathpix_submit_pdf`

Submit PDF · Write

Start asynchronous Mathpix OCR of a PDF, Word, PowerPoint or ebook file from a public URL.
Returns pdf_id, the handle for status checks and result downloads.
Use this for multi-page documents. Use mathpix_process_image for a single image.
Poll mathpix_get_pdf_status until status is completed, then read the output with mathpix_get_pdf_result or mathpix_get_pdf_lines.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public http(s) URL Mathpix downloads the document from. Accepts PDF, DOCX, DOC, PPTX, ODT, WPD, EPUB, MOBI, AZW/AZW3/KFX and DJVU, up to 1 GB. Example: https://cdn.mathpix.com/examples/cs229-notes1.pdf
- `alphabets_allowed` (`object`, optional): Alphabets to suppress in the output, as a map from alphabet code to false. Codes: en, hi, zh, ja, ko, ru, th, ta, te, gu, bn, vi. All alphabets are allowed by default; suppressing unused ones avoids look-alike characters such as Latin B and Cyrillic В. Example: {"ru": false, "hi": false}
- `conversion_formats` (`array`, optional): Extra output formats to produce once processing finishes, on top of Mathpix Markdown (mmd) and lines.json, which are always produced. md and html are text and can be read with mathpix_get_pdf_result; docx, xlsx, pptx, pdf, latex.pdf, mmd.overlay.pdf and the zip formats are binary files. Example: ["md", "docx"]
- `conversion_options` (`object`, optional): Settings for specific conversion formats, keyed by format name. For example docx takes font, fontSize (half-points), orientation and margins; md takes math delimiters and escape flags; pdf takes fontSize, margin and custom_css; html takes math_output_format (svg, mathml or latex). Example: {"docx": {"font": "Arial", "orientation": "landscape"}}
- `disable_itemize` (`boolean`, optional): Emit list items as plain lines with their markers (1., -, and so on) instead of \begin{itemize} environments. Mathpix default: false.
- `disable_lstlisting` (`boolean`, optional): Emit code and pseudocode as Markdown triple-backtick fences instead of \begin{lstlisting} blocks. Mathpix default: false.
- `idiomatic_eqn_arrays` (`boolean`, optional): Use aligned, gathered or cases environments instead of array for a list of equations. Mathpix default: false.
- `improve_mathpix` (`boolean`, optional): Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.
- `include_chemistry_as_image` (`boolean`, optional): Return each chemistry diagram as an image crop, with its SMILES in the image alt text. Mathpix default: false.
- `include_equation_tags` (`boolean`, optional): Keep equation numbers inside the LaTeX as \tag{1.12}. Setting this to true also turns on idiomatic equation arrays.
- `include_hyperlinks` (`boolean`, optional): Keep the http, https and mailto links stored in the PDF as Markdown links in the output. Mathpix default: false.
- `include_page_breaks` (`boolean`, optional): Append a \pagebreak marker after each page in the Mathpix Markdown output. Mathpix default: false.
- `include_smiles` (`boolean`, optional): Recognize chemistry structure diagrams as SMILES inside <smiles>...</smiles>. Mathpix default for documents: true.
- `math_display_delimiters` (`array`, optional): Begin and end delimiters for display (block) math in the text output, as a two-item list. Default is ["\\[", "\\]"]. Example: ["$$", "$$"]
- `math_inline_delimiters` (`array`, optional): Begin and end delimiters for inline math in the text output, as a two-item list. Default is ["\\(", "\\)"]. Example: ["$", "$"]
- `numbers_default_to_math` (`boolean`, optional): Always treat numbers as math, so "Answer: 17" becomes "Answer: \( 17 \)". Mathpix default: false.
- `page_ranges` (`string`, optional): Pages to process, as a comma-separated list of pages and ranges. Negative numbers count from the end. Example: 2,4-6 for pages 2, 4, 5 and 6; 2 - -2 for the second through the next-to-last page.
- `rm_fonts` (`boolean`, optional): Remove font commands such as \mathbf and \mathrm from equations in the latex_styled and text outputs. Mathpix default: false.
- `rm_spaces` (`boolean`, optional): Remove extra white space from equations in the latex_styled and text outputs. Mathpix default: true.
- `section_numbering` (`string`, optional): How to handle section and subsection numbers: preserve keeps existing numbering as is (the Mathpix default), auto numbers sections automatically, remove strips existing numbering. Sent as the matching auto_number_sections, remove_section_numbering or preserve_section_numbering flag. One of: `preserve`, `auto`, `remove`.

Example input: `{"url":"<url>"}`

### `mathpix_delete_conversion`

Delete Conversion · Destructive

Permanently delete all output files of a Mathpix Markdown conversion. This cannot be undone.
Returns the conversion's status object as it was at deletion.
Use this to remove converted files from Mathpix. Use mathpix_delete_pdf for a processed document.
Download any output you need with mathpix_get_conversion_result first.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `conversion_id` (`string`, required): The conversion_id of the conversion to delete, from mathpix_convert_markdown. Example: 2024_01_15_abc123def456

Example input: `{"conversion_id":"<conversion_id>"}`

### `mathpix_delete_pdf`

Delete PDF · Destructive

Permanently delete a processed document's outputs and its uploaded input file from Mathpix. This cannot be undone.
Returns the document's status object as it was at deletion.
Use this to remove a document's data before Mathpix's automatic retention period ends. Use mathpix_delete_conversion for a Markdown conversion.
Download any output you need with mathpix_get_pdf_result first.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `pdf_id` (`string`, required): The pdf_id of the document to delete, from mathpix_submit_pdf or mathpix_list_pdf_results. Example: 2024_01_15_abc123def456

Example input: `{"pdf_id":"<pdf_id>"}`

## Related

Other Files & Documents connectors ([all 45](/agentkit/connectors/?category=files-documents)):

- [Google Drive](/agentkit/connectors/googledrive/): Scalekit connector, OAuth, 47 tools
- [Google Forms](/agentkit/connectors/googleforms/): Scalekit connector, OAuth, 10 tools
- [Microsoft 365](/agentkit/connectors/microsoft365/): Scalekit connector, OAuth, 317 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
