Skip to content
aityx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Decisions with calculated answers

The seven console examples: one Jev-only, three Decision-only, and three Jev + Decision.

Return the outcome and the calculation together. Use structured application facts directly, let Jev answer semantic questions on its own, or combine Jev’s evidence with amounts, dates and conditions in an aityx model.

The console offers seven original examples with fictional terms, one for each shape of the single POST /v1/systemone endpoint. The Decision and combined results below were recorded on the local development API on October 6, 2026.

Jev only: questions in, answers out

No Decision is sent. Jev’s answers are the result.

Console example Case Answers Complete request
Support triage “Our whole team is locked out since this morning…” urgent (noul) and category (choice) JSON

Add a Decision later if you need to route, prioritise or escalate from those answers with amounts, dates or thresholds.

Decision only: application facts in, calculated answers out

These examples send a native decision and matching state. No questions are sent and no provider is called.

Console example Case Recorded answer Complete request
Invoice payment Approved $25,000 invoice, paid on day 10 Discount $500; pay $24,500 JSON
Expense claims $184 for three people, submitted after 41 days Manager review; cost per person about $61.33 JSON
SLA outage credit 98.5% uptime, $200 fee, claim after three days 25% credit; $50 JSON

Jev + Decision: read the message, apply the calculation

These examples send top-level Jev questions, a native decision, and one shared state. Jev supplies evidence; the Decision computes the consolidated result from it and the business facts.

Console example Case Recorded answer Complete request
Refund or store credit Damaged-item email, $129 order, reported after three days Refund; $129 JSON
Travel delay claim Weather delay of 5h40, Silver tier, no overnight stay €35 payout JSON
Discount approval 22% requested, three years, 400 seats, competitor pressure and upfront payment Allowed band 21%; VP review JSON

Jev evidence can vary on a new call. Each native model explicitly handles the evidence it uses, including a 0.8 threshold for affirmative Noul observations. The API does not turn probabilities into booleans automatically. See Using Jev with aityx.

Run any example from code

Replace sla with invoice, expense, refund, travel, discount or triage:

curl --fail -sS https://aityx.ai/docs/examples/sla-request.json > example-request.json

curl --fail-with-body -sS https://api.aityx.ai/v1/systemone \
  -H "Authorization: Bearer $AITYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d @example-request.json > example-response.json

jq '{answers, receipt, usage, decision_error}' example-response.json

All seven use the same endpoint and rate. A combined request settles as one charge; check decision_error for a partial failure. In the console, open Examples, choose a card and Execute — the badge on the State pane shows which shape will run.

Subscription refunds: the homepage walkthrough

The homepage uses a separate original subscription model. Its quickstart returns a $20 refund and October 28 deadline, then changes unused days and acceptance date to show $30 and October 29.

It demonstrates both Decision-only execution with matching facts and a combined Jev + Decision call that reads the customer’s message. The console’s Refund or store credit example instead uses Jev to assess damage. These are two different examples, with different terms.

Service credits

The console’s SLA example credits 50% below 95% uptime, 25% below 99%, and 10% below 99.9%. Scheduled maintenance is excluded, and claims must arrive within 30 days. At 98.5% uptime on a $200 fee, the calculation is $200 × 25% = $50. Exactly 99.9% earns zero.

Uptime and dates come from monitoring/account facts. A complaint alone should not supply those values. If a needed fact only exists inside a customer message, add a Jev question that establishes it and let the Decision use the answer — see State.

Expense claims

The console example uses a $75 per-person limit, a $500 total limit, a receipt requirement above $75 total and a 30-day submission window. A $184 claim for three people is within the per-person limit, but submission after 41 days requires manager review.

The native cost_per_person calculation returns 61.333333333333336; $61.33 is its display rounded to cents. This console model returns elapsed_days, not a submission deadline. The homepage’s illustrative April 1 deadline is March 2 plus 30 days; add a Date decision if your application needs that answer too.

The recorded invoice guide supplies a second native model with a calculated discount deadline. Your application performs any payment, refund or other action; aityx returns the answer.

Was this page helpful?