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

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.json
const 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), questions keyed by id.
  • Question types noul, choice, score, with instructions and criteria. Aliases options and levels.
  • Answer fields noul, choice, score, confidence and probabilities, with answers keyed by question id.
  • Usage information and bearer authentication.

What is extra

  • Question types number and date.
  • A portable model object and the complete execution receipt in the response.
  • The response model is a definition, rather than Jev’s inference-model name. Check clients that expect a string.
  • cache_hit, provider_usage and billing distinguish reuse, actual AI work and customer charges.
  • score answers also carry level, 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.

Was this page helpful?