Images and files
Send photos and PDFs for the model to read, and the limits on them.
Some models can read images and documents, not only text: a photo of a handwritten order, a supplier’s invoice in PDF.
const { data } = await ai.extract({
task: 'vision',
case: 'record-supplier-invoice',
schema: Invoice,
input: [
{ type: 'text', text: 'Read this invoice from the flour supplier.' },
{ type: 'file', url: signedUrl }, // a PDF in Sypnia Files, through a signed URL
],
});Over HTTP these are the usual content parts: image_url (an https:// address or a data: URL) and file (a PDF, as base64 or an address).
| Limit | |
|---|---|
| Formats | PNG, JPEG, WebP, GIF (its first frame), PDF |
| Images per request | 10, up to 10 MB each |
| PDFs | 20 MB and 100 pages |
| The whole request | 25 MB |
- Which models. The catalog’s
inputsfield says which models read images and PDFs; a route whose model cannot read them refuses such parts with400 input_not_supported. - Addresses. The gateway fetches
https://addresses only, waits at most 10 seconds, and never fetches private network addresses. - Price. Each model turns an image into tokens its own way; the cost shows up in the call’s usage like any other.
- Kept? No, unless the route keeps what was asked (Data and retention).