AI

Decisions API

Ask a decision model structured questions about a state.

The Decisions API sends a state and a set of questions to a model filling the decision role, and returns one structured answer per question.

POST /ai/v2/aiDecisions/decide
Authorization: Bearer <token>
Content-Type: application/json

{
  "state": { "shipment": "SHP-42", "delayHours": 30, "slaHours": 24 },
  "questions": {
    "escalate": { "type": "choice", "instructions": "Should this shipment be escalated? yes or no" }
  },
  "purpose": "shipment-triage"
}

Request

FieldNotes
stateAny JSON, up to 32,000 characters when serialised
questions1 to 16 named questions, each with a type and instructions
modelOptional; defaults to the decision role
purposeOptional label, up to 64 characters
dataClassificationDefaults to internal

Response

The response contains an id, the model that answered, an answers object keyed by question name, token usage and cost, and durationMs.

Errors

StatusCause
413The state is too large
422A question is malformed
502The decision provider failed

The audit log records who asked, which model answered and a hash of the state. The state itself is not logged.

Converge