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.
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,choiceorscore) andinstructions.choiceneeds acriteriaobject,scoreacriteriaarray. trace,session_idanduserare not forwarded. Everything else passes through.- The answer carries the model id you sent and
usagewithinput_tokensandoutput_tokens, and no cost fields. - An error's
codeis 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-providermust match the model's prefix.x-aile-max-priceand a key's price limit are checked against that price. - A response that reports no tokens is a
502and is not charged. - A provider refusal you can fix (
400,404,413,422…) passes through. One about the lender's account is a502saying you were not charged. A502or504arrives as503with the real code inx-aile-status. - An API key is required. Keyless x402 does not cover decisions.