Automette docs

Tools API

Each tool agents use is also an endpoint of its own. Call one, and the result comes back in the same response. Nothing needs to be set up in the app first.

All requests need a Bearer token, as for the rest of the API:

Authorization: Bearer dg_your_api_key

Tools

ToolEndpointWhat it does
Read a documentPOST /api/v1/documents/readThe text of a document: a PDF page by page (scanned pages are read with OCR), a spreadsheet or CSV as rows, a Word or text file as text.
Extract dataPOST /api/v1/documents/extractReads a document into the fields you ask for, with the page each value came from.
ClassifyPOST /api/v1/documents/classifySorts a document, or text you send, into your categories, with a reason for each.
ComparePOST /api/v1/documents/compareChecks two to five documents against each other, field by field and line by line.
Split a PDFPOST /api/v1/documents/splitSplits one PDF into separate documents, by page ranges, a number pattern or a description.
Generate an imagePOST /api/v1/images/generateA new picture made by AI from a description.
Edit an imagePOST /api/v1/images/editChanges a picture as described, keeping the rest of it.

To make documents from your templates, use renders instead.

Sending files

A file goes in the request body as its name and either its bytes or a link:

{ "file": { "name": "invoice.pdf", "content_base64": "JVBERi0xLjcK..." } }
{ "file": { "name": "invoice.pdf", "url": "https://example.com/invoice.pdf" } }

A link must start with https://. Each file can be up to 25 MB.

What comes back

The tool's result, as described on its reference page, plus credits_used: what the call cost, including any AI it used. A file a tool makes, such as a picture or part of a split PDF, comes with a url that works for 24 hours.

For example, extracting two fields:

curl https://automette.com/api/v1/documents/extract \
  -H "Authorization: Bearer dg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"file": {"name": "invoice.pdf", "url": "https://example.com/invoice.pdf"}, "instructions": "The invoice number and total"}'
{
  "data": { "invoice_number": "INV-104", "total": "1250.00" },
  "pages": { "invoice_number": 1, "total": 1 },
  "missing": [],
  "credits_used": 0.0042
}

Errors

An error comes back as { "error": "...", "code": "..." }:

StatuscodeMeaning
401The API key is missing or not valid.
402no_creditsNot enough credits for this call.
404not_foundSomething the request names does not exist.
422invalid_inputA parameter is missing or not valid, or a file is over 25 MB. error says which.
500service_errorA problem on Automette's side. Try again in a little while.

Last updated on

On this page