API Documentation

Extraction -> Markdown

Convert files to Markdown. No schema. Optional space_id stores the document in that knowledge space.

PDF → Markdown

PDF to Markdown

Endpoint

POSThttps://claix.dev/api/pdf-markdown

A PDF with selectable text is converted locally. If selectable text is below the minimum (a scanned PDF), it is sent to the same model and the same BYOK path as PDF → JSON, asking only for Markdown.

There is no schema_id. The Markdown is always returned. Send window_context=true to keep it for the window_time you choose; the response then includes document_id. space_id is optional and only applies when the document is kept: it attaches that document to the knowledge space.

1. Authentication

Same API key check as the JSON endpoints. The key must be active and the account status must be active.

x-api-key: <TU_API_KEY>

Or:

Authorization: Bearer <TU_API_KEY>

2. Parameters

FieldRequiredDescription
fileYesMultipart file. .pdf, 15 MB maximum.
window_contextNotrue keeps the Markdown and returns document_id. Omit it or send false to only return the Markdown.
window_timeRequired if window_context is trueMinutes: 5, 10, 15, 30, 45, 60, 90, 120, 180, 240, 360, 480, 720, 1440, or infinity. infinity requires Persistent Mode on the account.
space_idNoUUID of a knowledge space owned by the API key. Only when window_context is true. The kept document is attached to that space.

Model: Only when the PDF is scanned or does not have enough selectable text.

3. Example

curl -X POST "https://claix.dev/api/pdf-markdown" \
  -H "x-api-key: TU_API_KEY" \
  -F "file=@contrato.pdf" \
  -F "window_context=true" \
  -F "window_time=1440" \
  -F "space_id=SPACE_UUID"
{
  "success": true,
  "markdown": "# Title\n\nBody...",
  "document_id": "DOCUMENT_UUID",
  "log_id": "LOG_UUID"
}

4. Status codes

CodeWhen
200Markdown produced. Stored only when window_context is true.
400Missing file or content, bad format, invalid window_time, space_id without window_context, or infinity without Persistent Mode.
401API key missing, invalid, inactive, or account not active.
404space_id does not exist for this account.
405Method other than POST.
413File or text over the same limit as the JSON endpoint.
422Scanned PDF, image or audio rejected as unreadable, or empty Markdown.
502The model call failed.