Skip to content

Images and files

Send photos and PDFs for the model to read, and the limits on them.

Applies to EngineCloud
View as Markdown

Some models can read images and documents, not only text: a photo of a handwritten order, a supplier’s invoice in PDF.

TypeScript
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
FormatsPNG, JPEG, WebP, GIF (its first frame), PDF
Images per request10, up to 10 MB each
PDFs20 MB and 100 pages
The whole request25 MB
  • Which models. The catalog’s inputs field says which models read images and PDFs; a route whose model cannot read them refuses such parts with 400 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).

    Search pages, sections and terms