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.

StatusWhat to do
401Verify that the key is valid and unexpired.
403Use a key scoped to the requested mode.
413 / 422Reduce the input size or fix the decision schema.
429 · token_quota_reachedThe remaining allowance cannot cover the request. Check usage or contact the key issuer.
429 · rate_limit_reachedWait for the Retry-After interval before sending another request.
503 / 504The 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.

Explore a sample decision