Decisions

POST /v1/decisions takes OpenRouter's decisions body, { model, state, questions }, and answers one entry per question under answers. POST /v1/systemone is the same endpoint at the path the OpenRouter and TypeSafe SDKs post to. The model is <provider>/<model>, for example openrouter/~typesafe/jev-latest or openrouter/typesafe/jev-1.13. GET /v1/models lists the rest.

cURLcurl
1curl https://api.aile.sh/v1/decisions \
2-H "Authorization: Bearer $AILE_KEY" \
3-H "Content-Type: application/json" \
4-d '{
5 "model": "openrouter/~typesafe/jev-latest",
6 "state": "Order #1042 arrived broken. I want my money back.",
7 "questions": {
8 "refund": { "type": "noul", "instructions": "Is the customer asking for a refund?" },
9 "tone": {
10 "type": "choice",
11 "instructions": "How does the customer sound?",
12 "criteria": { "calm": "polite, patient", "angry": "hostile or urgent" }
13 }
14 }
15}'
  • Each question has a type (noul, choice or score) and instructions. choice needs a criteria object, score a criteria array.
  • trace, session_id and user are not forwarded. Everything else passes through.
  • The answer carries the model id you sent and usage with input_tokens and output_tokens, and no cost fields.
  • An error's code is the HTTP status as an integer.

Billing

  • Per input and output token, at the model's list price or less.
  • The hold is the model's context window (32,000 tokens when unknown) per question, plus 256 output tokens per question. You pay the tokens the provider reports.
  • A $AILE discount tab applies, as on chat.
  • A key's pins and the routing headers choose the lender here too, and x-aile-provider must match the model's prefix. x-aile-max-price and a key's price limit are checked against that price.
  • A response that reports no tokens is a 502 and is not charged.
  • A provider refusal you can fix (400, 404, 413, 422 …) passes through. One about the lender's account is a 502 saying you were not charged. A 502 or 504 arrives as 503 with the real code in x-aile-status.
  • An API key is required. Keyless x402 does not cover decisions.