Skip to content

Options

Updated

Shape#

options is a JSON-encoded string sent as a form field — not nested multipart data:

-F 'options={"model":"invoice","store_db":true}'

Malformed JSON returns 400 invalid_options.

Accepted keys#

KeyTypeDefaultDescription
modelstringPrompt template name (document type)
document_typestringinvoiceSynonym for model; either works
store_dbbooleanfalseStore the result server-side

Any other key is ignored.

document_type defaults to invoice#

Warning
Omit both model and document_type and the server assumes invoice. A passport sent without a type is extracted as though it were an invoice: you get a successful 200, plausible-looking output, and a wasted credit.

Always set the type explicitly. Values are lowercased and trimmed server-side.

store_db#

Defaults to false — results are not retained server-side unless you ask for it.

{"model":"invoice","store_db":true}

Set it to true and the result is stored and the response carries an extraction_id you can reference later. Leave it off and no extraction_id is returned, because there is nothing to reference.

Note
Not storing is the safer default for documents containing personal data — Aadhaar, PAN, passports, bank statements — since nothing is kept beyond the response. It does not reduce the credit cost either way.

Per-chunk options on multi-page documents#

process takes the same options object, and the model is chosen per chunk — the split itself is model-independent.

Note
Passing different models across chunks of one document is permitted but produces a mixed_models warning on collect, and the combined result may be inconsistent. Use the same model for every chunk unless you have a specific reason not to.

The form field must be named exactly options; anything else returns 400 invalid_options naming the fields it did receive.

Unknown models#

An unrecognised template name returns 400 unknown_model. Call models to see what your key may use — it costs no credits.