Request type
choiceCancel + refund
Cancellation with a refund requested.
Decision API for AI applications
Ask questions about your data. Get typed answers—including calculated amounts and dates.
Preview access includes credits to try your own questions.
Recorded demo
A customer asks to cancel a subscription. Watch System One use their account and request data to calculate the refund and deadline, then recalculate as the facts change.
Actual System One API results. Native execution: 2–4 ms.
Refine your decision
{ "name": "Subscription cancellation refunds", "inputs": { "customer_intent": { "type": "cancel_refund|cancel_only|other", "desc": "What is the customer's request type?", "options": { "cancel_refund": "Cancellation with a refund requested.", "cancel_only": "Cancellation without a refund requested.", "other": "Any other request." }, "from": "The customer's stated subscription request." }, "plan_amount": { "type": "number >= 0", "desc": "What is the subscription plan amount in USD?", "from": "The stated subscription plan price." }, "period_days": { "type": "number > 0", "desc": "How many days are in the subscription period?", "from": "The stated subscription period length." }, "unused_days": { "type": "number >= 0", "desc": "How many subscription days are unused?", "from": "The stated number of unused subscription days." }, "accepted_on": { "type": "date", "desc": "On what date was the request accepted?", "from": "The stated request acceptance date." }, "refundable": { "type": "boolean", "desc": "Is the account refundable?", "from": "The stated account refundability." } }, "decisions": { "request_type": { "desc": "Return the subscription cancellation request type.", "table": [ [ "customer_intent", "=> cancel_refund|cancel_only|other", "# why" ], [ "cancel_refund", "cancel_refund", "The customer requests cancellation with a refund." ], [ "cancel_only", "cancel_only", "The customer requests cancellation only." ], [ "-", "other", "The request is neither cancellation option." ] ] }, "refund_eligible": { "desc": "Determine whether the cancellation request is eligible for a refund. True only for cancel_refund when the account is refundable and unused_days is greater than zero; false otherwise.", "table": [ [ "customer_intent", "refundable", "unused_days > 0", "=> boolean", "# why" ], [ "cancel_refund", "true", "true", "true", "A refundable account with unused days qualifies for the requested refund." ], [ "-", "-", "-", "false", "At least one required refund condition is not met." ] ] }, "refund_amount": { "desc": "Return the eligible prorated refund in USD, capped at the plan amount and rounded to two decimal places; return zero when ineligible.", "table": [ [ "refund_eligible", "=> number >= 0", "# why" ], [ "true", "prorated_refund(plan_amount, unused_days, period_days)", "Prorate using unused days capped at the subscription period." ], [ "-", "0", "An ineligible request receives no refund." ] ] }, "deadline_days": { "type": "number", "desc": "Processing deadline offset in calendar days.", "expr": "7" }, "processing_deadline": { "type": "date", "desc": "Return the processing deadline seven calendar days after accepted_on.", "expr": "accepted_on + duration(\"P\" + string(deadline_days) + \"D\")" } }, "functions": { "prorated_refund": { "params": { "amount": "number", "unused": "number", "period": "number" }, "returns": "number", "body": "decimal(amount * (if unused < period then unused else period) / period, 2)" } } }
POST /v1/systemone{ "customer_intent": "cancel_refund", "plan_amount": 60, "period_days": 30, "unused_days": 10, "accepted_on": "2026-10-21", "refundable": true }
Your application · JavaScript
async function getRefund(decision, state, apiKey) {const res = await fetch("https://api.aityx.ai/v1/systemone", {method: "POST",headers: {Authorization: `Bearer ${apiKey}`,"Content-Type": "application/json"},body: JSON.stringify({ decision, state })});if (!res.ok) throw new Error(`aityx ${res.status}`);const { answers } = await res.json();return {amount: answers.refund_amount.number,due: answers.processing_deadline.date};}const refund = await getRefund(decision, state, apiKey);console.log(refund);
You’ve seen the request type, calculated refund and deadline. Get answers your application can use.
Built by Aletyx, a team with nearly two decades of enterprise decision experience.Meet the team →
Why aityx
Return the request type, refund amount and due date together. Your application can use each answer directly.
Cancel + refund
Cancellation with a refund requested.
$20.00
$60.00 × 10 unused days ÷ 30 days
October 21 + 7 calendar days
Recorded results using this example’s refund policy.
See the API exampleUse cases
Combine a message with the facts your application already has. Return what qualifies, the amount, and the date—in one response.
Subscription refunds
“Please cancel my subscription and refund the unused time.”
$60 plan · 10 of 30 days unused · accepted October 21 · refundable
$60 × 10 ÷ 30. The example gives seven calendar days to process the refund.
Service credits
“Can we get a credit for last month’s outage?”
98.5% uptime · $200 monthly fee · unscheduled outage · claimed after 3 days
The example credits 25% below 99% uptime: $200 × 25% = $50.
Expense claims
“Dinner with two clients. Receipt attached.”
$184 for 3 people · expense March 2 · submitted April 12
$184 ÷ 3 is within the $75 limit. Submission misses the example’s 30-day window.
How it works
Sometimes getting the answer means running your model. Sometimes you need AI to understand the input first. aityx handles both—and combines interpretation and execution in one call when you need it.
System One
Send your model with matching structured facts. Get choices, calculated amounts and dates in milliseconds.
System Two
Send your model with a message or other input. AI establishes the facts, then your model calculates the answers.
Get started
Describe the answers you need and let the integrated assistant create your decision model. Or build it with your preferred tools and submit it to aityx.
Get a request type, a $20 refund and an October 28 deadline.
Run the example →Describe the answers you need. Let the integrated assistant create your decision model.
Build with aityx →Use your preferred AI assistant or code to build a decision model in the aityx format.
See the model format →Using Jev? Combine its judgments with your aityx model to calculate amounts and dates.
See how they work together →Pricing
Run your model at the System One rate. Use System Two for input interpretation or model creation.
Execute your model
Interpret input or create models
Prices in USD per 1 million tokens. Responses show token usage. Review charges in the console.
Integration questions
Yes, with the same model and identical facts. AI interpretation of text is a separate step; the receipt identifies their sources and records the calculation.
Yes. The response includes input sources and calculations in an inline receipt. Keep it with the facts you submitted. You can also view the model as JSON or a diagram.
The decision stops if a required fact cannot be established reliably. Your app can ask for the missing information or send the case for review.
No. Send your aityx model with matching structured facts for System One execution. Use System Two when AI needs to interpret your input before the model runs.
Yes. Your application can combine Jev judgments with account or other structured data, then pass those facts to your aityx model to calculate amounts and dates. Read the Jev guide →
No. Use your preferred AI assistant or code to create a decision model in the aityx format, then submit it with your input. The integrated assistant is another way to get started. See the model format →
Yes. Define your questions with the answer types you need, or start with a prompt, PDF, spreadsheet, Word document, image or text file.
Aletyx, a team with nearly two decades of enterprise decision experience.
Tech preview
Return the outcome, amount and deadline together, ready for your code to use. Preview access includes credits to try your own questions.