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"
  }'

请求体

FieldTypeReqDefaultDescription
urlstringN—Document URL
base64stringN—Base64-encoded file content
filenamestringN—Filename 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)N—How to handle images in output
promptTypestringN—Custom prompt type for OCR
callbackUrlstringN—URL for async completion callback
includeDetectionbooleanNfalseInclude detection data in response (bboxes, element types)

请求示例

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

响应示例

{
  "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