ZaltharDocs

API reference

Decisions

Ask a decision model typed questions about a situation and get probabilities back instead of generated text.

POST /v1/decisions

Decision models answer structured questions about a situation. Instead of writing text, they return probabilities or scores for each question you ask. Decision models are listed in /v1/models with the modality decisions.

Decision models are enabled on request. If /v1/models lists none for your key, contact us.

Calling /v1/decisions with a text model, or a text endpoint with a decision model, returns 400.

Request body

Field Type Notes
model string Required. A decision model slug.
state string or content parts Required. The situation to judge.
questions object Required. A map from your own key to a question.
assets Optional supporting material.

Each question has:

Field Notes
type noul, choice or score.
instructions What you want decided.
criteria Optional, for example the choices to pick between.

Example

curl https://api.zalthar.com/v1/decisions \
  -H "Authorization: Bearer $ZALTHAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<decision-model-slug>",
    "state": "Customer writes: my parcel arrived crushed and the glass inside is broken.",
    "questions": {
      "refund": {"type": "noul", "instructions": "Should this ticket be refunded without further evidence?"},
      "urgency": {"type": "score", "instructions": "How urgent is this ticket?"}
    }
  }'

Responses have IDs starting dec_. Decisions are not streamed.

Try decision models in the Playground first: it shows the exact request it sends, as curl, Python or TypeScript.