{
  "openapi": "3.0.3",
  "info": {
    "title": "AnyToMarkdown - PDF to Markdown and Document Parser API",
    "version": "1.0.0",
    "description": "**PDF to Markdown, Word to Markdown, URL to Markdown:** turn **any document or web page into clean, LLM-ready Markdown** - plus RAG-ready chunks and exact token counts - with one API call.\n\n**Inputs:** PDF (with OCR for scans), Word (DOCX/DOC), PowerPoint (PPTX/PPT), Excel (XLSX/XLS/XLSB), CSV/TSV, HTML & any public URL, EPUB, e-mails (EML/MSG with attachments), RTF, OpenDocument (ODT/ODS/ODP), Jupyter notebooks, subtitles (SRT/VTT), JSON/XML/Markdown/code, ZIP archives and images.\n\n**What you get:** headings, nested lists, tables (including PDF tables), links, footnotes, code blocks and metadata - without headers, footers or page numbers. Optional per-page output, structure-aware chunks with heading breadcrumbs and page numbers, and OpenAI-compatible token counts (o200k_base / cl100k_base).\n\n**AI agents:** the same features are available as MCP tools at `/mcp` (Claude Code, Cursor, VS Code, n8n AI agents...).\n\n**Privacy:** files are processed in memory and never stored."
  },
  "servers": [
    {
      "url": "https://anymarkdownapi.gtgroup.dev"
    }
  ],
  "tags": [
    {
      "name": "Convert",
      "description": "Convert files and URLs to Markdown / text"
    },
    {
      "name": "RAG utilities",
      "description": "Chunking and token counting"
    },
    {
      "name": "AI agents (MCP)",
      "description": "Use the API as tools from Claude, Cursor and other MCP clients"
    },
    {
      "name": "Info",
      "description": "Supported formats and your plan limits"
    }
  ],
  "paths": {
    "/v1/convert": {
      "post": {
        "tags": [
          "Convert"
        ],
        "operationId": "convertDocument",
        "summary": "Convert PDF, Word, Excel or PowerPoint file to Markdown",
        "description": "Upload a file (multipart `file`), post raw bytes, or send JSON with `url` / `base64`. Returns Markdown plus metadata, and optionally per-page content and RAG chunks.",
        "parameters": [
          {
            "$ref": "#/components/parameters/FileName"
          },
          {
            "$ref": "#/components/parameters/OutputFormat"
          },
          {
            "$ref": "#/components/parameters/Pages"
          },
          {
            "$ref": "#/components/parameters/Ocr"
          },
          {
            "$ref": "#/components/parameters/OcrLanguages"
          },
          {
            "$ref": "#/components/parameters/MainContentOnly"
          },
          {
            "$ref": "#/components/parameters/IncludeImages"
          },
          {
            "$ref": "#/components/parameters/IncludeLinks"
          },
          {
            "$ref": "#/components/parameters/PageMarkers"
          },
          {
            "$ref": "#/components/parameters/IncludeHeadersFooters"
          },
          {
            "$ref": "#/components/parameters/IncludeSpeakerNotes"
          },
          {
            "$ref": "#/components/parameters/ConvertAttachments"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/IncludePages"
          },
          {
            "$ref": "#/components/parameters/IncludeChunks"
          },
          {
            "$ref": "#/components/parameters/IncludeContent"
          },
          {
            "$ref": "#/components/parameters/ChunkSize"
          },
          {
            "$ref": "#/components/parameters/ChunkOverlap"
          },
          {
            "$ref": "#/components/parameters/Tokenizer"
          },
          {
            "$ref": "#/components/parameters/MaxRowsPerSheet"
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Send the document in one of three ways: **multipart/form-data** with a `file` field, a **JSON** body with `url` or `base64`, or the **raw file bytes** as the body (any content type).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The document to convert (PDF, DOCX, DOC, PPTX, PPT, XLSX, XLS, CSV, HTML, EPUB, EML, MSG, RTF, ODT, ODS, ODP, IPYNB, SRT, VTT, TXT, MD, JSON, XML, ZIP, images)."
                  },
                  "fileName": {
                    "type": "string",
                    "description": "Override the file name used for format detection."
                  },
                  "outputFormat": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "text"
                    ],
                    "default": "markdown"
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-10"
                  },
                  "ocr": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "force",
                      "off"
                    ],
                    "default": "auto"
                  },
                  "ocrLanguages": {
                    "type": "string",
                    "default": "eng"
                  },
                  "mainContentOnly": {
                    "type": "boolean"
                  },
                  "includeImages": {
                    "type": "boolean",
                    "default": true
                  },
                  "includeLinks": {
                    "type": "boolean",
                    "default": true
                  },
                  "pageMarkers": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeHeadersFooters": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeSpeakerNotes": {
                    "type": "boolean",
                    "default": true
                  },
                  "convertAttachments": {
                    "type": "boolean",
                    "default": true
                  },
                  "password": {
                    "type": "string"
                  },
                  "includePages": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeChunks": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeContent": {
                    "type": "boolean",
                    "default": true
                  },
                  "chunkSize": {
                    "type": "integer",
                    "minimum": 64,
                    "maximum": 8192,
                    "default": 512
                  },
                  "chunkOverlap": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 64
                  },
                  "tokenizer": {
                    "type": "string",
                    "enum": [
                      "o200k_base",
                      "cl100k_base"
                    ],
                    "default": "o200k_base"
                  },
                  "maxRowsPerSheet": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Provide exactly one of `url` or `base64`. All conversion options can be given here or as query parameters.",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public URL of a page or document.",
                    "example": "https://arxiv.org/pdf/1706.03762"
                  },
                  "base64": {
                    "type": "string",
                    "description": "File content, base64 encoded (a `data:...;base64,` prefix is accepted)."
                  },
                  "fileName": {
                    "type": "string",
                    "description": "Original file name (hint for format detection).",
                    "example": "invoice.pdf"
                  },
                  "outputFormat": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "text"
                    ],
                    "default": "markdown"
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-10"
                  },
                  "ocr": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "force",
                      "off"
                    ],
                    "default": "auto"
                  },
                  "ocrLanguages": {
                    "type": "string",
                    "default": "eng"
                  },
                  "mainContentOnly": {
                    "type": "boolean"
                  },
                  "includeImages": {
                    "type": "boolean",
                    "default": true
                  },
                  "includeLinks": {
                    "type": "boolean",
                    "default": true
                  },
                  "pageMarkers": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeHeadersFooters": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeSpeakerNotes": {
                    "type": "boolean",
                    "default": true
                  },
                  "convertAttachments": {
                    "type": "boolean",
                    "default": true
                  },
                  "password": {
                    "type": "string"
                  },
                  "includePages": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeChunks": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeContent": {
                    "type": "boolean",
                    "default": true
                  },
                  "chunkSize": {
                    "type": "integer",
                    "minimum": 64,
                    "maximum": 8192,
                    "default": 512
                  },
                  "chunkOverlap": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 64
                  },
                  "tokenizer": {
                    "type": "string",
                    "enum": [
                      "o200k_base",
                      "cl100k_base"
                    ],
                    "default": "o200k_base"
                  },
                  "maxRowsPerSheet": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "example": {
                  "url": "https://arxiv.org/pdf/1706.03762",
                  "pages": "1-3",
                  "includeChunks": true,
                  "chunkSize": 512
                }
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Converted document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "File larger than your plan allows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "file_too_large",
                    "message": "Input exceeds the maximum size of 10 MB for your plan."
                  }
                }
              }
            }
          },
          "415": {
            "description": "Unsupported or unrecognized format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The document could not be converted (corrupt file, password required, URL fetch failed...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "password_required",
                    "message": "This PDF is password protected. Pass the password in the 'password' parameter."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Server busy; retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Conversion did not finish within your plan's time limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Convert"
        ],
        "operationId": "convertUrl",
        "summary": "Convert web page or online document URL to Markdown",
        "description": "Fetches the URL (web page or file) and converts it. Web pages are reduced to their main content by default.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Public URL of a web page or document (PDF, DOCX, XLSX...). Google Docs/Sheets/Slides, Google Drive, Dropbox and GitHub share links are converted to direct downloads automatically.",
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://en.wikipedia.org/wiki/Markdown"
          },
          {
            "$ref": "#/components/parameters/FileName"
          },
          {
            "$ref": "#/components/parameters/OutputFormat"
          },
          {
            "$ref": "#/components/parameters/Pages"
          },
          {
            "$ref": "#/components/parameters/Ocr"
          },
          {
            "$ref": "#/components/parameters/OcrLanguages"
          },
          {
            "$ref": "#/components/parameters/MainContentOnly"
          },
          {
            "$ref": "#/components/parameters/IncludeImages"
          },
          {
            "$ref": "#/components/parameters/IncludeLinks"
          },
          {
            "$ref": "#/components/parameters/PageMarkers"
          },
          {
            "$ref": "#/components/parameters/IncludeHeadersFooters"
          },
          {
            "$ref": "#/components/parameters/IncludeSpeakerNotes"
          },
          {
            "$ref": "#/components/parameters/ConvertAttachments"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/IncludePages"
          },
          {
            "$ref": "#/components/parameters/IncludeChunks"
          },
          {
            "$ref": "#/components/parameters/IncludeContent"
          },
          {
            "$ref": "#/components/parameters/ChunkSize"
          },
          {
            "$ref": "#/components/parameters/ChunkOverlap"
          },
          {
            "$ref": "#/components/parameters/Tokenizer"
          },
          {
            "$ref": "#/components/parameters/MaxRowsPerSheet"
          }
        ],
        "responses": {
          "200": {
            "description": "Converted document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "File larger than your plan allows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "file_too_large",
                    "message": "Input exceeds the maximum size of 10 MB for your plan."
                  }
                }
              }
            }
          },
          "415": {
            "description": "Unsupported or unrecognized format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The document could not be converted (corrupt file, password required, URL fetch failed...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "password_required",
                    "message": "This PDF is password protected. Pass the password in the 'password' parameter."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Server busy; retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Conversion did not finish within your plan's time limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/convert/raw": {
      "post": {
        "tags": [
          "Convert"
        ],
        "operationId": "convertDocumentRaw",
        "summary": "Convert file to Markdown (plain text response)",
        "description": "Same input as `POST /v1/convert`, but the response body is the Markdown (`text/markdown`) or text itself. Handy for no-code tools and AI agents. Stats are returned in `X-Token-Count`, `X-Pages-Processed`, `X-Source-Format`, `X-Truncated` headers.",
        "parameters": [
          {
            "$ref": "#/components/parameters/FileName"
          },
          {
            "$ref": "#/components/parameters/OutputFormat"
          },
          {
            "$ref": "#/components/parameters/Pages"
          },
          {
            "$ref": "#/components/parameters/Ocr"
          },
          {
            "$ref": "#/components/parameters/OcrLanguages"
          },
          {
            "$ref": "#/components/parameters/MainContentOnly"
          },
          {
            "$ref": "#/components/parameters/IncludeImages"
          },
          {
            "$ref": "#/components/parameters/IncludeLinks"
          },
          {
            "$ref": "#/components/parameters/PageMarkers"
          },
          {
            "$ref": "#/components/parameters/IncludeHeadersFooters"
          },
          {
            "$ref": "#/components/parameters/IncludeSpeakerNotes"
          },
          {
            "$ref": "#/components/parameters/ConvertAttachments"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/IncludePages"
          },
          {
            "$ref": "#/components/parameters/IncludeChunks"
          },
          {
            "$ref": "#/components/parameters/IncludeContent"
          },
          {
            "$ref": "#/components/parameters/ChunkSize"
          },
          {
            "$ref": "#/components/parameters/ChunkOverlap"
          },
          {
            "$ref": "#/components/parameters/Tokenizer"
          },
          {
            "$ref": "#/components/parameters/MaxRowsPerSheet"
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Send the document in one of three ways: **multipart/form-data** with a `file` field, a **JSON** body with `url` or `base64`, or the **raw file bytes** as the body (any content type).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The document to convert (PDF, DOCX, DOC, PPTX, PPT, XLSX, XLS, CSV, HTML, EPUB, EML, MSG, RTF, ODT, ODS, ODP, IPYNB, SRT, VTT, TXT, MD, JSON, XML, ZIP, images)."
                  },
                  "fileName": {
                    "type": "string",
                    "description": "Override the file name used for format detection."
                  },
                  "outputFormat": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "text"
                    ],
                    "default": "markdown"
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-10"
                  },
                  "ocr": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "force",
                      "off"
                    ],
                    "default": "auto"
                  },
                  "ocrLanguages": {
                    "type": "string",
                    "default": "eng"
                  },
                  "mainContentOnly": {
                    "type": "boolean"
                  },
                  "includeImages": {
                    "type": "boolean",
                    "default": true
                  },
                  "includeLinks": {
                    "type": "boolean",
                    "default": true
                  },
                  "pageMarkers": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeHeadersFooters": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeSpeakerNotes": {
                    "type": "boolean",
                    "default": true
                  },
                  "convertAttachments": {
                    "type": "boolean",
                    "default": true
                  },
                  "password": {
                    "type": "string"
                  },
                  "includePages": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeChunks": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeContent": {
                    "type": "boolean",
                    "default": true
                  },
                  "chunkSize": {
                    "type": "integer",
                    "minimum": 64,
                    "maximum": 8192,
                    "default": 512
                  },
                  "chunkOverlap": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 64
                  },
                  "tokenizer": {
                    "type": "string",
                    "enum": [
                      "o200k_base",
                      "cl100k_base"
                    ],
                    "default": "o200k_base"
                  },
                  "maxRowsPerSheet": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Provide exactly one of `url` or `base64`. All conversion options can be given here or as query parameters.",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public URL of a page or document.",
                    "example": "https://arxiv.org/pdf/1706.03762"
                  },
                  "base64": {
                    "type": "string",
                    "description": "File content, base64 encoded (a `data:...;base64,` prefix is accepted)."
                  },
                  "fileName": {
                    "type": "string",
                    "description": "Original file name (hint for format detection).",
                    "example": "invoice.pdf"
                  },
                  "outputFormat": {
                    "type": "string",
                    "enum": [
                      "markdown",
                      "text"
                    ],
                    "default": "markdown"
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-10"
                  },
                  "ocr": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "force",
                      "off"
                    ],
                    "default": "auto"
                  },
                  "ocrLanguages": {
                    "type": "string",
                    "default": "eng"
                  },
                  "mainContentOnly": {
                    "type": "boolean"
                  },
                  "includeImages": {
                    "type": "boolean",
                    "default": true
                  },
                  "includeLinks": {
                    "type": "boolean",
                    "default": true
                  },
                  "pageMarkers": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeHeadersFooters": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeSpeakerNotes": {
                    "type": "boolean",
                    "default": true
                  },
                  "convertAttachments": {
                    "type": "boolean",
                    "default": true
                  },
                  "password": {
                    "type": "string"
                  },
                  "includePages": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeChunks": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeContent": {
                    "type": "boolean",
                    "default": true
                  },
                  "chunkSize": {
                    "type": "integer",
                    "minimum": 64,
                    "maximum": 8192,
                    "default": 512
                  },
                  "chunkOverlap": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 64
                  },
                  "tokenizer": {
                    "type": "string",
                    "enum": [
                      "o200k_base",
                      "cl100k_base"
                    ],
                    "default": "o200k_base"
                  },
                  "maxRowsPerSheet": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "example": {
                  "url": "https://arxiv.org/pdf/1706.03762",
                  "pages": "1-3",
                  "includeChunks": true,
                  "chunkSize": 512
                }
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The converted content.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                },
                "example": "# Title\n\nFirst paragraph..."
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "File larger than your plan allows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "file_too_large",
                    "message": "Input exceeds the maximum size of 10 MB for your plan."
                  }
                }
              }
            }
          },
          "415": {
            "description": "Unsupported or unrecognized format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The document could not be converted (corrupt file, password required, URL fetch failed...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "password_required",
                    "message": "This PDF is password protected. Pass the password in the 'password' parameter."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Server busy; retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Conversion did not finish within your plan's time limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Convert"
        ],
        "operationId": "convertUrlRaw",
        "summary": "Convert URL to Markdown (plain text response)",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Public URL of a web page or document (PDF, DOCX, XLSX...). Google Docs/Sheets/Slides, Google Drive, Dropbox and GitHub share links are converted to direct downloads automatically.",
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://en.wikipedia.org/wiki/Markdown"
          },
          {
            "$ref": "#/components/parameters/FileName"
          },
          {
            "$ref": "#/components/parameters/OutputFormat"
          },
          {
            "$ref": "#/components/parameters/Pages"
          },
          {
            "$ref": "#/components/parameters/Ocr"
          },
          {
            "$ref": "#/components/parameters/OcrLanguages"
          },
          {
            "$ref": "#/components/parameters/MainContentOnly"
          },
          {
            "$ref": "#/components/parameters/IncludeImages"
          },
          {
            "$ref": "#/components/parameters/IncludeLinks"
          },
          {
            "$ref": "#/components/parameters/PageMarkers"
          },
          {
            "$ref": "#/components/parameters/IncludeHeadersFooters"
          },
          {
            "$ref": "#/components/parameters/IncludeSpeakerNotes"
          },
          {
            "$ref": "#/components/parameters/ConvertAttachments"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/IncludePages"
          },
          {
            "$ref": "#/components/parameters/IncludeChunks"
          },
          {
            "$ref": "#/components/parameters/IncludeContent"
          },
          {
            "$ref": "#/components/parameters/ChunkSize"
          },
          {
            "$ref": "#/components/parameters/ChunkOverlap"
          },
          {
            "$ref": "#/components/parameters/Tokenizer"
          },
          {
            "$ref": "#/components/parameters/MaxRowsPerSheet"
          }
        ],
        "responses": {
          "200": {
            "description": "The converted content.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "File larger than your plan allows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "file_too_large",
                    "message": "Input exceeds the maximum size of 10 MB for your plan."
                  }
                }
              }
            }
          },
          "415": {
            "description": "Unsupported or unrecognized format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The document could not be converted (corrupt file, password required, URL fetch failed...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "password_required",
                    "message": "This PDF is password protected. Pass the password in the 'password' parameter."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Server busy; retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Conversion did not finish within your plan's time limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chunk": {
      "post": {
        "tags": [
          "RAG utilities"
        ],
        "operationId": "chunkText",
        "summary": "Split Markdown into RAG chunks",
        "description": "Heading-aware chunking with token budget, overlap, intact tables and code blocks, and heading breadcrumbs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChunkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chunks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tokens": {
      "post": {
        "tags": [
          "RAG utilities"
        ],
        "operationId": "countTokens",
        "summary": "Count GPT tokens in text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token count.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (bad option values, missing input, blocked or invalid URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "requestId": "4f1c2a9b8e7d6c5b",
                  "error": {
                    "code": "invalid_request",
                    "message": "'chunkSize' must be between 64 and 8192 tokens."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "AI agents (MCP)"
        ],
        "operationId": "mcp",
        "summary": "MCP server for AI agents (convert, chunk, count tokens)",
        "description": "Stateless MCP (Streamable HTTP) server exposing the tools `convert_url`, `convert_file`, `chunk_text` and `count_tokens`. Point Claude Code, Cursor, VS Code, n8n AI agents or any MCP client at this URL with your RapidAPI headers. Send JSON-RPC 2.0 messages with `Accept: application/json, text/event-stream`.",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json, text/event-stream"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "example": "2.0"
                  },
                  "id": {
                    "type": "integer",
                    "example": 1
                  },
                  "method": {
                    "type": "string",
                    "example": "tools/call"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "convert_url",
                  "arguments": {
                    "url": "https://en.wikipedia.org/wiki/Markdown"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response (as a single server-sent event).",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many simultaneous requests for your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/formats": {
      "get": {
        "tags": [
          "Info"
        ],
        "operationId": "listFormats",
        "summary": "List supported formats, OCR languages and plan limits",
        "responses": {
          "200": {
            "description": "Formats and limits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormatsResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "OutputFormat": {
        "name": "outputFormat",
        "in": "query",
        "required": false,
        "description": "Format of `content`: GitHub-flavored **markdown** (headings, lists, tables, links) or clean plain **text**.",
        "schema": {
          "type": "string",
          "enum": [
            "markdown",
            "text"
          ],
          "default": "markdown"
        },
        "example": "markdown"
      },
      "Pages": {
        "name": "pages",
        "in": "query",
        "required": false,
        "description": "Pages / slides / sheets / archive files to convert, e.g. `1-5,8,10-`. Default: all (up to your plan's page limit).",
        "schema": {
          "type": "string"
        },
        "example": "1-10"
      },
      "Ocr": {
        "name": "ocr",
        "in": "query",
        "required": false,
        "description": "OCR for scanned PDFs and images. `auto` OCRs only pages without a usable text layer; `force` OCRs every page; `off` disables OCR.",
        "schema": {
          "type": "string",
          "enum": [
            "auto",
            "force",
            "off"
          ],
          "default": "auto"
        },
        "example": "auto"
      },
      "OcrLanguages": {
        "name": "ocrLanguages",
        "in": "query",
        "required": false,
        "description": "Tesseract language codes joined with `+`, e.g. `eng`, `deu`, `eng+fra`. See `GET /v1/formats` for installed languages.",
        "schema": {
          "type": "string",
          "default": "eng"
        },
        "example": "eng"
      },
      "MainContentOnly": {
        "name": "mainContentOnly",
        "in": "query",
        "required": false,
        "description": "HTML / web pages only: keep just the main article (drops navigation, ads, cookie banners, footers). Default: `true` for `url` input, `false` for uploaded HTML.",
        "schema": {
          "type": "boolean"
        },
        "example": true
      },
      "IncludeImages": {
        "name": "includeImages",
        "in": "query",
        "required": false,
        "description": "Emit image references (`![alt](src)`) for images that have alt text or a URL.",
        "schema": {
          "type": "boolean",
          "default": true
        },
        "example": true
      },
      "IncludeLinks": {
        "name": "includeLinks",
        "in": "query",
        "required": false,
        "description": "Keep hyperlinks. Set `false` to output link text only (saves tokens).",
        "schema": {
          "type": "boolean",
          "default": true
        },
        "example": true
      },
      "PageMarkers": {
        "name": "pageMarkers",
        "in": "query",
        "required": false,
        "description": "Insert `<!-- Page N -->` markers between pages / slides / sheets.",
        "schema": {
          "type": "boolean",
          "default": false
        },
        "example": false
      },
      "IncludeHeadersFooters": {
        "name": "includeHeadersFooters",
        "in": "query",
        "required": false,
        "description": "Keep running page headers, footers and page numbers (PDF) and Word header/footer parts. Removed by default.",
        "schema": {
          "type": "boolean",
          "default": false
        },
        "example": false
      },
      "IncludeSpeakerNotes": {
        "name": "includeSpeakerNotes",
        "in": "query",
        "required": false,
        "description": "PowerPoint / ODP: include speaker notes under each slide.",
        "schema": {
          "type": "boolean",
          "default": true
        },
        "example": true
      },
      "ConvertAttachments": {
        "name": "convertAttachments",
        "in": "query",
        "required": false,
        "description": "E-mails (EML/MSG): also convert attached documents (PDF, DOCX, XLSX...) and append them.",
        "schema": {
          "type": "boolean",
          "default": true
        },
        "example": true
      },
      "Password": {
        "name": "password",
        "in": "query",
        "required": false,
        "description": "Password for encrypted PDFs or Excel workbooks.",
        "schema": {
          "type": "string"
        }
      },
      "IncludePages": {
        "name": "includePages",
        "in": "query",
        "required": false,
        "description": "Also return `pages[]`: the content split per page / slide / sheet (great for citations).",
        "schema": {
          "type": "boolean",
          "default": false
        },
        "example": false
      },
      "IncludeChunks": {
        "name": "includeChunks",
        "in": "query",
        "required": false,
        "description": "Also return `chunks[]`: RAG-ready chunks that respect headings, keep tables/code intact, repeat table headers, and carry heading breadcrumbs and page numbers.",
        "schema": {
          "type": "boolean",
          "default": false
        },
        "example": true
      },
      "IncludeContent": {
        "name": "includeContent",
        "in": "query",
        "required": false,
        "description": "Set `false` to omit the full `content` (e.g. when you only need chunks).",
        "schema": {
          "type": "boolean",
          "default": true
        },
        "example": true
      },
      "ChunkSize": {
        "name": "chunkSize",
        "in": "query",
        "required": false,
        "description": "Maximum tokens per chunk.",
        "schema": {
          "type": "integer",
          "minimum": 64,
          "maximum": 8192,
          "default": 512
        },
        "example": 512
      },
      "ChunkOverlap": {
        "name": "chunkOverlap",
        "in": "query",
        "required": false,
        "description": "Tokens repeated from the end of the previous chunk when a section is split (max half of chunkSize).",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "default": 64
        },
        "example": 64
      },
      "Tokenizer": {
        "name": "tokenizer",
        "in": "query",
        "required": false,
        "description": "Tokenizer for token counts and chunk sizes. `o200k_base` = GPT-4o / GPT-4.1 / GPT-5 family, `cl100k_base` = GPT-4 / GPT-3.5 / OpenAI embeddings.",
        "schema": {
          "type": "string",
          "enum": [
            "o200k_base",
            "cl100k_base"
          ],
          "default": "o200k_base"
        },
        "example": "o200k_base"
      },
      "MaxRowsPerSheet": {
        "name": "maxRowsPerSheet",
        "in": "query",
        "required": false,
        "description": "Spreadsheets/CSV: maximum rows per sheet (capped by your plan).",
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "example": 1000
      },
      "FileName": {
        "name": "fileName",
        "in": "query",
        "required": false,
        "description": "Original file name. Optional: the format is detected from the content, the name is only a hint (useful for raw/base64 uploads of text formats such as .csv or .md).",
        "schema": {
          "type": "string"
        },
        "example": "report.pdf"
      }
    },
    "schemas": {
      "SourceInfo": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "upload",
              "binary",
              "base64",
              "url"
            ]
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "finalUrl": {
            "type": "string",
            "nullable": true,
            "description": "URL after redirects / share-link rewriting."
          },
          "format": {
            "type": "string",
            "description": "Detected format id, e.g. pdf, docx, xlsx, html, code:python."
          },
          "mimeType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Metadata": {
        "type": "object",
        "description": "Document metadata (only known fields are returned).",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "author": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "keywords": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "creator": {
            "type": "string",
            "nullable": true
          },
          "producer": {
            "type": "string",
            "nullable": true
          },
          "siteName": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "canonicalUrl": {
            "type": "string",
            "nullable": true
          },
          "image": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "published": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "pageCount": {
            "type": "integer",
            "nullable": true,
            "description": "Total pages / slides / sheets / chapters in the source."
          },
          "extra": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer"
          },
          "label": {
            "type": "string",
            "example": "Page 3"
          },
          "content": {
            "type": "string"
          },
          "tokens": {
            "type": "integer"
          }
        }
      },
      "Chunk": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "content": {
            "type": "string"
          },
          "tokens": {
            "type": "integer"
          },
          "characters": {
            "type": "integer"
          },
          "headings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Heading breadcrumb of the section the chunk belongs to."
          },
          "pageStart": {
            "type": "integer",
            "nullable": true
          },
          "pageEnd": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "Stats": {
        "type": "object",
        "properties": {
          "characters": {
            "type": "integer"
          },
          "words": {
            "type": "integer"
          },
          "tokens": {
            "type": "integer"
          },
          "tokenizer": {
            "type": "string"
          },
          "pagesProcessed": {
            "type": "integer"
          },
          "ocrPages": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean",
            "description": "True when a plan limit (pages, rows, OCR pages, archive entries) cut the output short."
          },
          "processingMs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ConvertResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/SourceInfo"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "The converted document (Markdown or plain text)."
          },
          "contentFormat": {
            "type": "string",
            "enum": [
              "markdown",
              "text"
            ]
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Page"
            },
            "nullable": true
          },
          "chunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chunk"
            },
            "nullable": true
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "success": true,
          "requestId": "4f1c2a9b8e7d6c5b",
          "source": {
            "type": "url",
            "fileName": "1706.03762",
            "url": "https://arxiv.org/pdf/1706.03762",
            "finalUrl": "https://arxiv.org/pdf/1706.03762",
            "format": "pdf",
            "mimeType": "application/pdf",
            "sizeBytes": 2215244
          },
          "metadata": {
            "title": "Attention Is All You Need",
            "pageCount": 15,
            "creator": "LaTeX with hyperref",
            "extra": {
              "format": "pdf",
              "pdfVersion": "1.5"
            }
          },
          "content": "# Attention Is All You Need\n\n## Abstract\n\nThe dominant sequence transduction models are based on complex recurrent or convolutional neural networks...\n\n## 1 Introduction\n\n...",
          "contentFormat": "markdown",
          "chunks": [
            {
              "index": 0,
              "content": "# Attention Is All You Need\n\n## Abstract\n\nThe dominant sequence transduction models...",
              "tokens": 498,
              "characters": 2210,
              "headings": [
                "Attention Is All You Need",
                "Abstract"
              ],
              "pageStart": 1,
              "pageEnd": 1
            }
          ],
          "stats": {
            "characters": 39581,
            "words": 6097,
            "tokens": 9812,
            "tokenizer": "o200k_base",
            "pagesProcessed": 15,
            "ocrPages": 0,
            "truncated": false,
            "processingMs": 812
          },
          "warnings": []
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "requestId": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "invalid_url",
                  "blocked_url",
                  "fetch_failed",
                  "unsupported_format",
                  "empty_input",
                  "file_too_large",
                  "password_required",
                  "invalid_password",
                  "corrupt_file",
                  "ocr_unavailable",
                  "timeout",
                  "rate_limited",
                  "unauthorized",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "ChunkRequest": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Markdown (or plain text) to split."
          },
          "format": {
            "type": "string",
            "enum": [
              "markdown",
              "text"
            ],
            "default": "markdown"
          },
          "chunkSize": {
            "type": "integer",
            "minimum": 64,
            "maximum": 8192,
            "default": 512
          },
          "chunkOverlap": {
            "type": "integer",
            "minimum": 0,
            "default": 64
          },
          "tokenizer": {
            "type": "string",
            "enum": [
              "o200k_base",
              "cl100k_base"
            ],
            "default": "o200k_base"
          }
        },
        "example": {
          "text": "# Guide\n\n## Install\n\nRun the installer...\n\n## Configure\n\nEdit the settings file...",
          "chunkSize": 256,
          "chunkOverlap": 32
        }
      },
      "ChunkResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string"
          },
          "chunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chunk"
            }
          },
          "totalTokens": {
            "type": "integer"
          },
          "tokenizer": {
            "type": "string"
          },
          "chunkCount": {
            "type": "integer"
          }
        }
      },
      "TokenRequest": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "tokenizer": {
            "type": "string",
            "enum": [
              "o200k_base",
              "cl100k_base"
            ],
            "default": "o200k_base"
          }
        },
        "example": {
          "text": "How many tokens is this sentence?",
          "tokenizer": "o200k_base"
        }
      },
      "TokenResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string"
          },
          "tokens": {
            "type": "integer"
          },
          "characters": {
            "type": "integer"
          },
          "words": {
            "type": "integer"
          },
          "tokenizer": {
            "type": "string"
          }
        },
        "example": {
          "success": true,
          "requestId": "4f1c2a9b8e7d6c5b",
          "tokens": 8,
          "characters": 33,
          "words": 6,
          "tokenizer": "o200k_base"
        }
      },
      "FormatsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "extensions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "description": {
                  "type": "string"
                },
                "available": {
                  "type": "boolean"
                }
              }
            }
          },
          "ocrAvailable": {
            "type": "boolean"
          },
          "pdfOcrAvailable": {
            "type": "boolean"
          },
          "ocrLanguages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tokenizers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "plan": {
            "type": "object",
            "description": "Limits of the plan you are calling with.",
            "properties": {
              "name": {
                "type": "string"
              },
              "maxFileMb": {
                "type": "integer"
              },
              "maxPages": {
                "type": "integer"
              },
              "maxOcrPages": {
                "type": "integer"
              },
              "maxRowsPerSheet": {
                "type": "integer"
              },
              "maxArchiveEntries": {
                "type": "integer"
              },
              "timeoutSeconds": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
  }
}
