DEVELOPER API

Document Conversion API

Convert PDF, Word, PowerPoint, Excel, EPUB, CSV, RTF, and OpenDocument files into Markdown, structured JSON, or deterministic chunks for retrieval pipelines. Scanned PDFs use OCR automatically.

Authentication and request

Create a key in Settings → API keys and send it as a bearer token.

curl https://anydocai.com/api/v1/documents/convert \
  -H "Authorization: Bearer $ANYDOCAI_API_KEY" \
  -F "file=@report.pdf" \
  -F "output=chunks" \
  -F "ocr=auto"

Fields

fileRequired document, up to 50 MB
outputmarkdown, json, or chunks
ocrauto or off
chunk_size500–12,000 characters
webhook_urlPublic HTTPS callback URL

Signed webhooks

When a callback URL is present, AnydocAI sends document.conversion.completed or document.conversion.failed. Verify the raw body with the HMAC-SHA256 value in x-anydocai-signature.