Shared Types
Type definitions used across multiple API endpoints.
Region object
Pixel coordinates defining a rectangular area within an image or page.
top_left_x X coordinate of the top-left corner (pixels)
top_left_y Y coordinate of the top-left corner (pixels)
width Width of the region (pixels)
height Height of the region (pixels)
Callback object
post URL to post results to. Must be a string
reply Object merged into the callback response body. Must be an object, cannot contain batch_id
body Additional data included when posting results
headers HTTP headers to include when posting results
Invalid callback configuration returns error opts_bad_callback.
DetectedAlphabet object
Each field is a boolean that is true if any characters from that alphabet are recognized in the image, regardless of whether the result fields contain those characters.
en— Englishhi— Hindi Devanagarizh— Chineseja— Kana Hiragana or Katakanako— Hangul Jamoru— Russianth— Thaita— Tamilte— Telugugu— Gujaratibn— Bengalivi— Vietnamese
AlphabetsAllowed object
A map from alphabet key to boolean that controls which alphabets are allowed in the output. This is useful when different alphabets contain look-alike characters (e.g. Latin B vs Cyrillic В) that can cause incorrect Unicode encodings in the result.
- Keys correspond to the alphabet codes listed in DetectedAlphabet (e.g.
hi,ru) - By default all alphabets are allowed
- Set a key to
falseto suppress that alphabet in the output - Setting a key to
truehas the same effect as omitting it
AlphabetsAllowed example
{"alphabets_allowed": {"ru": false, "hi": false}}
ConversionStatus object
A map from format name to its conversion state. Each key is a format name (e.g. docx, pdf) and the value is an object with the following fields:
status One of processing, completed, or error.
error_info Present when status is error. Contains id (error identifier) and error (human-readable message).
ConversionStatus example
{
"docx": {"status": "completed"},
"pdf": {"status": "error", "error_info": {"id": "conversion_error", "error": "..."}}
}
Conversion Formats
This parameter is called formats for v3/converter and conversion_formats for v3/pdf.
| Format | Description |
|---|---|
| md | Plain Markdown |
| docx | Microsoft Word document |
| tex.zip | LaTeX zip with images |
| html | HTML file |
| PDF with HTML rendering | |
| latex.pdf | PDF with LaTeX rendering |
| pptx | PowerPoint presentation |
| mmd.zip | Mathpix Markdown zip with images |
| md.zip | Markdown zip with images |
| html.zip | HTML zip with images |
Conversion Options
Specifies options for specific output formats. Each key corresponds to a format enabled in formats, and the associated object contains format-specific settings.
Conversion options for docx
font Specifies the name of the font that will be used in the document.
fontSize Specifies the font size in half-points (e.g. 22 = 11pt).
language Specifies the document language for spelling and grammar checking. When auto, the language is detected automatically. See supported values below.
orientation Specifies the page orientation portrait or landscape.
margins Specifies page margins. All values are in twips (1 twip = 1/20 of a point).
| Field | Type | Default | Description |
|---|---|---|---|
| top | integer | 1440 | Top margin |
| right | integer | 1800 | Right margin |
| bottom | integer | 1440 | Bottom margin |
| left | integer | 1800 | Left margin |
| gutter | integer (optional) | 0 | Extra space for binding |
htmlTags Enables or disables support for HTML tags in the source content.
Supported language values:
auto, Afrikaans, Arabic, Basque (Basque), Bosnian, Bulgarian, Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish, Dutch, English (AUS), English (CAN), English (UK), English (US), Estonian, Finnish, French, French (Canada), French (Switzerland), Galician, Georgian,German, German (Austria), German (Switzerland), Greek, Gujarati, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, isiXhosa, isiZulu, Italian, Japanese, Kannada, Kazakh, Kiswahili, Korean, Latvian, Lithuanian, Macedonian, Malaysian, Marathi, Norwegian Borkmal, Norwegian Nynorsk, Persian, Polish, Portuguese, Portuguese (Brazil), Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Sesotho Sa Leboa, Setswana, Slovak, Slovenian, Spanish, Spanish (Traditional Sort), Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Welsh.
Conversion options for tex.zip
fontSize Specifies the font size as a LaTeX size string. Numeric values are treated as pt.
Values
10pt, 11pt, 12pt
font imagesFolder Specifies the folder name for images.
load_external_fonts Specifies that all used fonts should be included in the tex.zip. Used only for XeLaTeX1.
htmlTags Enables or disables support for HTML tags in the source content.
Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.
Conversion options for html
htmlTags Enables or disables support for HTML tags in the source content.
Conversion options for md
math_inline_delimiters Specifies begin inline math and end inline math delimiters.
math_display_delimiters Specifies begin display math and end display math delimiters.
escape_ampersand Specifies whether to escape the & character in the source content.
escape_dollar Specifies whether to escape the $ character in the source content.
escape_hash Specifies whether to escape the # character in the source content.
escape_percent Specifies whether to escape the % character in the source content.
htmlTags Enables or disables support for HTML tags in the source content.
Conversion options for latex.pdf
fontSize Specifies the font size as a LaTeX size string. Numeric values are treated as pt.
Values
10pt, 11pt, 12pt
font htmlTags Enables or disables support for HTML tags in the source content.
Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.
Conversion options for pdf
fontSize Specifies the font size in px. Clamped to the range 8–128.
text_color Specifies the text color, can be name, hex, or rgb.
background_color Specifies the background color, can be name, hex, or rgb.
disable_footer Enable or disable footer such as page numbers.
margin Specifies the margin size. Minimum value is 40, maximum is 200.
custom_css Specifies custom CSS styles to be applied to the document.
footnote_compact_refs Specifies the option to hide repeat indexes for Markdown footnotes.
resource_load_timeout_sec Specifies the timeout in seconds (can be fractional) for loading external resources (such as images or fonts). If a resource does not load within this time, it will be excluded from the output. Must be greater than zero.
htmlTags Enables or disables support for HTML tags in the source content.
Conversion options for pptx
fontSize Specifies the font size in px.
text_color Specifies the text color, can be name, hex, or rgb.
background_color Specifies the background color, can be name, hex, or rgb.
margin Specifies the margin size in px.
custom_css Specifies custom CSS styles to be applied to the document.
footnote_compact_refs Specifies the option to hide repeat indexes for Markdown footnotes.
htmlTags Enables or disables support for HTML tags in the source content.
Conversion options for md.zip
math_inline_delimiters Specifies begin inline math and end inline math delimiters.
math_display_delimiters Specifies begin display math and end display math delimiters.
escape_ampersand Specifies whether to escape the & character in the source content.
escape_dollar Specifies whether to escape the $ character in the source content.
escape_hash Specifies whether to escape the # character in the source content.
escape_percent Specifies whether to escape the % character in the source content.
htmlTags Enables or disables support for HTML tags in the source content.
Conversion options for html.zip
htmlTags Enables or disables support for HTML tags in the source content.