PDF and documents
Send a PDF, Word file, spreadsheet or text file inside a message and ask the model about it. Syntic extracts the text, and on models that read images it also adds an image of each page, so tables, charts and scanned pages are understood too.
When to use it
- Questions over contracts, reports, manuals and papers.
- Pulling fields out of forms and statements (pair it with JSON output).
- Summaries of long documents.
- Answers that must quote their source (turn on citations).
For the same document across many requests, send it a single time through the Files API, then refer to it by id. Repeat calls then also benefit from prompt caching.
Endpoint and auth
POST https://app.syntic.ai/v1/chat/completions, Authorization: Bearer sk_live_.... On Messages use a document block.
Request fields
A file content part on a user message:
| Field | Type | Required | Details |
|---|---|---|---|
type | string | Yes | "file" |
file.file_id | string | One of these two | A file uploaded with purpose: "document". |
file.file_data | string | One of these two | A data: URL, for example data:application/pdf;base64,.... Up to 10 MB. |
file.filename | string | With file_data | Used to detect the type and shown to the model. |
file.title | string | No | A friendly name the model uses when it refers to the document. |
file.pages | string | No | A page range such as "1-12,40". Only these pages are read and billed. |
file.mode | string | No | auto (default), text (text only) or pages (text plus page images). |
file.citations | object | No | {"enabled": true}. See Citations. |
Supported types
| Type | Read as |
|---|---|
Text per page, plus page images when the model has vision and mode allows | |
| DOCX, PPTX | Text with headings and tables kept |
| XLSX, CSV | One table per sheet, as text |
| TXT, MD, HTML, JSON | Text |
Password-protected or corrupted files return an error before the model runs.
Response
A normal chat completion. usage.prompt_tokens_details adds document_tokens and document_pages so you can see what the document cost.
Cost
| Part | Billing |
|---|---|
| Extracted text | Input tokens as usual (roughly 500 to 1,500 per dense page) |
| Page images | Input tokens per page, using the high image formula on Vision |
Use pages to read only the part you need, and mode: "text" for born-digital documents without charts.
Examples
curl https://app.syntic.ai/v1/chat/completions \
-H "Authorization: Bearer $SYNTIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Amara S1.2",
"stream": false,
"messages": [{
"role": "user",
"content": [
{ "type": "file", "file": { "file_id": "file_01JBW9", "title": "Shop lease 2024", "pages": "1-20" } },
{ "type": "text", "text": "What notice period applies if the tenant leaves early?" }
]
}]
}'Errors
| Status | code | Cause |
|---|---|---|
| 400 | unsupported_file_type | Not one of the types above. |
| 400 | file_encrypted | Password-protected file. |
| 400 | file_unreadable | Corrupt or empty file. |
| 400 | invalid_page_range | pages is malformed or outside the document. |
| 400 | too_many_pages | More than 600 pages after pages is applied. |
| 400 | context_window_exceeded | The extracted document does not fit in the model’s context. Use pages. |
| 404 | file_not_found | Unknown file_id, deleted, or from another organisation. |
| 413 | payload_too_large | file_data over 10 MB; upload with the Files API instead. |
Limits
| Limit | Value |
|---|---|
Inline file_data | 10 MB |
| Uploaded file | 100 MB |
| Pages per request (all documents) | 600 |
| Documents per request | 20 |
Build notes for the platform team
- Reuse the
extract-filepipeline; cache extraction by file hash so repeat requests skip it. - Page rendering at 150 dpi, long side capped at 1,568 px.
- Extraction runs inside the org boundary; no extracted text is shared across orgs even for identical hashes.