POST

/api/parse

2 credits/page (fast), 5 credits/page (hires)

Document parsing (PDF, images, OCR)

Parse documents into structured markdown. Supports PDF, images, and scanned

documents. Fast mode is synchronous (~15 pages/sec), HiRes mode is asynchronous

with OCR (~16 pages/min).

curl -s -X POST "$BASE/api/parse" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://arxiv.org/pdf/2301.00234v1",
    "mode": "fast"
  }'

Request Body

FieldTypeReqDefaultDescription
urlstringNDocument URL
base64stringNBase64-encoded file content
filenamestringNFilename hint (required with base64)
modestring (fast | hires | auto)Nfastfast: ~15 pages/sec, synchronous. hires: ~16 pages/min, asynchronous with OCR. auto: server chooses.
outputstring (markdown | json)Nmarkdown
waitbooleanNfalseWait for async result (block until complete)
imageModestring (embedded | s3)NHow to handle images in output
promptTypestringNCustom prompt type for OCR
callbackUrlstringNURL for async completion callback
includeDetectionbooleanNfalseInclude detection data in response (bboxes, element types)

Request Example

{
  "url": "https://arxiv.org/pdf/2401.00001.pdf",
  "mode": "fast",
  "output": "markdown"
}

Response Example

{
  "success": true,
  "mode": "fast",
  "document": {
    "markdown": "# Document Title\n\nContent...",
    "pageCount": 10,
    "metadata": {
      "title": "Document Title",
      "author": "Author"
    }
  },
  "cost": {
    "pages": 10,
    "totalCredits": 20
  },
  "processingTime": 680
}

Try it out

Sign in to use your API key
Request Body
Response
Click Execute to test