Skip to main content
POST
Make a Decision

Headers

X-API-Key
string

Body

multipart/form-data
instructions
string
required

What decision to make, and what makes it correct

schema
string
required

Typed schema of the decision fields

file
file | null

Document to decide about

url
string | null

URL to fetch the document from

url_headers
string | null

JSON-encoded headers for URL auth

context
string | null

JSON array of {"label", "content"} context blocks

include_steps
boolean
default:false

Include the agent's tool-call trace

sync
boolean
default:true

Set to false to process asynchronously. Returns a task_id to poll.

webhook_url
string | null

URL to POST the result to when async processing completes.

Response

Successful Response

Response for /decide — ONE coherent decision over the whole schema.

Unlike /analyze, reasoning is a single string and sources a single list: the fields are facets of one judgment, so they share one rationale. A failed decision is an HTTP error, never a null-with-zero-confidence.

data
Data · object
required

Decision values keyed by field name

model_used
string
required

Model used for the decision

success
boolean
default:true
confidence
Confidence · object

Per-field confidence scores (0.0–1.0)

reasoning
string
default:""

One coherent explanation of the decision as a whole

sources
string[]

Quotes from the document/context that support the decision

steps
AgentStepResponse · object[]

Agent tool-call trace. Empty unless include_steps=true.

filename
string | null

Original filename or URL (null for context-only decisions)

content_type
string | null

Detected MIME type

text_length
integer
default:0

Length of extracted document text (0 for context-only)

total_pages
integer
default:0

Total pages in the document (0 for non-paginated files)

credits_used
integer
default:0

Credits consumed

schema_format
enum<string> | null

Schema format: always 'typed'

Available options:
typed