The decision API.
Send context and a named question. Use the returned choice and probabilities in your application.
Make a request
Keep your key on your server. Use the bearer authorization header and send JSON over HTTPS.
curl https://api.decoice.com/v1/decisions \
-H "Authorization: Bearer $DECOICE_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "decoice-1.0.0",
"state": {
"message": "I was charged twice."
},
"questions": {
"route": {
"type": "choice",
"instructions": "Choose the team that should handle the message.",
"criteria": {
"billing": "Payments and invoices",
"support": "Product issues"
}
}
}
}'Use choice for named alternatives, noul for a true/false judgment, and score for an ordered rubric. Responses include answers keyed by question name and usage.input_tokens and usage.output_tokens.
Keys, usage and limits
Read your key’s consumption with an authenticated GET /v1/usage. The response gives used tokens, the configured quota, remaining tokens and completed requests. An unlimited key returns null for its quota and remaining balance.
| Status | What to do |
|---|---|
| 401 | Verify that the key is valid and unexpired. |
| 403 | Use a key scoped to the requested mode. |
| 413 / 422 | Reduce the input size or fix the decision schema. |
| 429 · token_quota_reached | The remaining allowance cannot cover the request. Check usage or contact the key issuer. |
| 429 · rate_limit_reached | Wait for the Retry-After interval before sending another request. |
| 503 / 504 | The service is unavailable or the response deadline expired. Keep the request ID for support. |
Responses carry an X-Request-ID. The maximum HTTP body size is 256 KiB. A request may contain up to 128 questions.