Make decisions with the decision API
Use the decision API to ask structured questions about content and receive probabilities for yes/no answers, choices, or scores. The endpoint is /systemone. Two decision models answer it:
nutrient-document-decision— Nutrient’s own decision model. Accepts images embedded instate, in addition to text. Recommended.nutrient-systemone— A text-only decision model.
Prerequisites
Complete getting started to set up your AI Gateway API key.
Ask a yes/no question
Send the content to evaluate in state, and name each question in questions:
curl --fail-with-body https://api.nutrient.io/ai/v1/systemone \ -H "Authorization: Bearer $NUTRIENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nutrient-document-decision", "state": "I was charged twice for my subscription this month.", "questions": { "billing": { "type": "noul", "instructions": "Is this message about billing?" } } }'Read answers.billing.noul as a probability from 0 to 1 that the answer is yes. It isn’t a Boolean. Choose decision thresholds using your own evaluation data, and route uncertain results for review.
Ask a question about an image
nutrient-document-decision accepts images anywhere inside state, at any nesting depth, as {"type": "image", "source": "data:<mime>;base64,<bytes>"}. The model evaluates the surrounding text and every embedded image together:
curl --fail-with-body https://api.nutrient.io/ai/v1/systemone \ -H "Authorization: Bearer $NUTRIENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nutrient-document-decision", "state": { "invoice": { "vendor": "Acme Corp", "total": 1024.50, "currency": "USD" }, "page_1": { "type": "image", "source": "data:image/png;base64,'"$(base64 -i invoice.png)"'" } }, "questions": { "amount_reasonable": { "type": "noul", "instructions": "Is the total a plausible invoice amount given the attached page image?" } } }'nutrient-systemone doesn’t accept images, so the API rejects a request that embeds one, the same way it rejects any other unsupported question shape.
Question formats
Use noul for yes/no questions, choice to pick one label, and score to place the content on an ordered scale. See the API reference for each format, the limits for each model, and request size limits.
Billing and request IDs
The decision API uses AI Gateway token billing. Each decision model has its own rates. See the token rate table for model pricing and the dashboard pricing page(opens in a new tab) for your account’s current rates.
Next steps
- Pricing — Understand token billing.
- Errors and limits — Handle rejected requests and unavailable access.
- Security and privacy — Review which decision model processes your content.