askwithai CLI, or a plain HTTP call to the Decision API.
Make your first decision
1
Create an API key
Sign in to the AskWithAI Platform, create a workspace (or start from the Payment Refund template in the guided start), and generate an API key in Settings → API keys.Export it in your shell or
.env.local file:Keep your API key on the server. Never commit it to Git or ship it in client-side browser code.
2
Install the SDK (optional for HTTP)
If you use TypeScript or JavaScript (Node.js 22+), install
@askwithai/sdk — it includes both the typed client and the askwithai CLI:3
Call your Decision Runtime
Ask your runtime for a decision on a sample refund request:
- TypeScript SDK
- CLI
- cURL (Decision API)
4
Report the real outcome later
Once you know what actually happened (for example, a return was verified or a chargeback arrived), report the outcome back to AskWithAI. Real outcomes become verified test cases that improve future versions of your runtime.
Roll out safely with serving modes
You never have to switch production traffic to routed decisions overnight. Every Decision Runtime supports three serving modes so you can verify behavior before it changes a single live answer.1. Parity mode
Returns your fast model’s answer unchanged while recording every call and receipt. Zero behavioral change for your users.
2. Shadow mode
Still returns the parity answer to your app, while AskWithAI runs full routing in the background so you can compare what it would have done.
3. Active mode
Serves routed decisions live — fast answers for routine cases, automatic second opinions when expected mistake cost is high.