POST /v1/analyses
runs one of four passes over items you name; a watch created with an ai step
runs one of them on every event it catches.
The four kinds
group, classify and summarise are the passes the dashboard runs on a
Query’s results. agent is the one you write yourself.
Credits
The agent’s batch is half the size for the same credit because its output is
generated text for every field you asked for, not one verdict per item.
meta.credits_used on the response is what was actually charged, and it is not
always what the estimate quoted: a batch the provider could not answer is not
billed. Price a call first with GET /v1/analyses/estimate?item_count=…,
which is free.
Items
Send them inline:The agent step
An agent step is one instruction and one flat schema of your own fields:The schema subset
Deliberately narrow, so every schema can be enforced rather than merely requested:- 1 to 12 fields, flat. No nesting, no arrays.
- Each field is
string,number,booleanorenum. values(up to 12) belongs toenum;maxLength(up to 400) tostring.descriptionis read by the model — write it as a sentence someone else could apply by hand.- Field names start with a letter and use letters, digits and underscores. They
are yours: they come back as the keys of
output, and becomeagent:<name>rule fields in the dashboard.
null. That is a real answer — “this item does not
support one” — not an error. A model forced to always produce a value produces
confident nonsense, which is worse than a gap you can see.
On a watch
Passai when creating a watch and every event it emits carries the reading in
its ai block. Delivery waits for it, up to 120 seconds, and the event is
delivered either way — see
Webhooks → Agent step on a watch.
Sentiment and intent
A search with analysis turned on has every item it catches read on two more dimensions, on the same pass and at the same rate — one charge, one call, two answers:- sentiment —
positive,neutral,negative,questionormixed - intent —
purchase_intent,comparison,question,complaint,praiseorother
ai step but stay out of output: the keys
you defined are the keys you get back. The reading is delivered on the event’s
own analysis key and comes back from
GET /v1/{source}/watches/{id}/events.
null on either means nothing has read that item yet. It never means “we
looked and found nothing” — that is what neutral and other are for.
Failures
An AI pass is an enhancement, never a dependency. Nothing here can lose a watch event or stop a poll.- A batch the provider could not answer is not charged, and
meta.batchessays how many actually ran. - If no batch answered, the call returns
503and charges nothing. - On a watch, a step that times out or fails still delivers the event, with
ai.output: nullandai.statussaying which. - With no provider configured,
POST /v1/analysesreturns503and watches deliver immediately withai: null.