Coming from Jev
Change the base URL, keep the request. What is the same, what is extra, what to watch.
aityx implements the Jev systemone contract. An integration that calls
POST https://api.typesafe.ai/v1/systemone works against POST https://api.aityx.ai/v1/systemone with a new key.
Point the client at aityx
curl https://api.aityx.ai/v1/systemone \
-H "Authorization: Bearer $AITYX_API_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonconst res = await fetch("https://api.aityx.ai/v1/systemone", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.AITYX_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ model: "jev-latest", state, questions }),
});
const { answers, model, receipt } = await res.json();
// Keep the complete model and receipt in your own application.import os, requests
res = requests.post(
"https://api.aityx.ai/v1/systemone",
headers={"Authorization": f"Bearer {os.environ['AITYX_API_KEY']}"},
json={"model": "jev-latest", "state": state, "questions": questions},
)
result = res.json()
answers, model, receipt = result["answers"], result["model"], result["receipt"]
# Keep the complete model and receipt in your own application.Expect the first call to be slower
With a jev-* model name, the first request for a given set of questions builds a decision model. It takes
seconds. Later requests may reuse the model from a temporary cache, improving latency. Every questions-based
call uses System Two pricing, including cache hits. The cache can expire or be evicted.
Keep and submit the decision model
The response’s model is the complete decision definition and its questions. Save that object, then send it
with each new state:
body: JSON.stringify({ model, state })Matching JSON then uses System One pricing, with output free. The model in the request contributes to input billing. This removes generation from execution and makes the rules you reviewed repeatable.
Add what Jev could not do
Add number and date questions where you were computing in code. Keep noul, choice and score as they
are.
What is the same
- Request shape:
model,state(string or JSON),questionskeyed by id. - Question types
noul,choice,score, withinstructionsandcriteria. Aliasesoptionsandlevels. - Answer fields
noul,choice,score,confidenceandprobabilities, withanswerskeyed by question id. - Usage information and bearer authentication.
What is extra
- Question types
numberanddate. - A portable
modelobject and the complete executionreceiptin the response. - The response
modelis a definition, rather than Jev’s inference-model name. Check clients that expect a string. cache_hit,provider_usageandbillingdistinguish reuse, actual AI work and customer charges.scoreanswers also carrylevel, the most likely level by name.
What to watch
| In Jev | In aityx |
|---|---|
| Your integration may use confidence thresholds to route a result. | Review those thresholds: with matching structured inputs, one option has probability 1. See Determinism and confidence. |
| A missing fact does not stop the call. | A missing required fact fails with 400 invalid_state before execution. Use blank only when your policy permits absence; otherwise supply the missing fact. |
model: jev-1.13.0 pins a model version. |
A jev-* name selects the generator; submit the returned definition to keep the rules fixed. |
| Arithmetic, counting and date comparison happen in your code. | Put them in number and date questions; the engine computes them. |
| State is text or JSON. | Matching JSON plus a full model skips the reader. Text or unresolved fields may add an extraction charge. Questions-based calls remain at System Two rates. |
Models and receipts are yours to retain. The preview does not provide durable model storage or receipt history. See Models and Receipts.