Jev evaluates context and returns structured decisions: classify a request, choose a capability, assess urgency or estimate a probability. Use the dedicated routes above for these evaluations; they return JSON without streaming.
You need an active Pro subscription, a Fantasy user API key and prepaid credits. Send your key with Authorization: Bearer or x-api-key. The TypeSafe key is configured by the administrator on the Fantasy server.
Fantasy recommendations — /jev/decisions
Send your conversation’s text history in messages. The preset evaluates task type, model tier, research, required context, answer length and suitability for durable memory. Your application can then use these recommendations.
1–50 messages, at most 24,000 characters each, including at least one non-empty user message. Only recent user and assistant text is used; system, developer and tool content is excluded.
Your own questions — /systemone
Define state (text, object or array), then questions, an object keyed by your question names. Each question contains type, instructions and, depending on its type, criteria. model is optional and defaults to the configured Jev model, normally jev-latest.
1–32 questions. Choice: 1–255 named options. Score: 2–10 ordered descriptions. Noul: optional true/false criteria. Unsupported fields, including stream, are rejected.
Set FANTASY_API_KEY in your application’s environment. The JavaScript example uses fetch in Node.js; the Python example uses requests and demonstrates all three question types. In the playground, select Jev decisions or Jev native API, paste your key and send the request; successful evaluations consume credits.
These responses are illustrative: values, latency, the resolved model and token counts depend on your request.
For /jev/decisions, each recommendation contains value and confidence. taskType identifies a capability (general, code, reasoning, security or vision); modelTier is economy, standard or premium. decision.model is the Jev model that evaluated the request. Your application chooses the corresponding chat model.
Check active before applying a Fantasy recommendation. In shadow mode, active is false: decisions are advisory. A Desktop request carrying x-fantasy-desktop-context: 1 then receives decision: null and usage.credits: 0. Native /systemone evaluations remain usable in shadow mode.
Choice: answers.department.choice is the selected option name; probabilities maps each option to its probability.
Score: answers.urgency.score ranges from 0 to the number of criteria minus one and can be fractional. legend maps each index to its description; probabilities provides the distribution over those indices.
Noul: answers.duplicate.noul is a probability between 0 and 1, not a boolean. Choose a threshold suitable for your application if you need a true/false result.
For Choice and Score, confidence is distinct from the winning option’s probability. The 0.7 threshold in the JavaScript example is an application choice. usage.input_tokens and usage.output_tokens describe TypeSafe-reported consumption on the native route.
Both /jev/decisions and /systemone bill the input tokens reported by Jev at its provider rate: USD 0.042 per million input tokens, converted to EUR using the cached ECB reference rate or the configured settlement rate, without markup. Output tokens and cached decisions are free. One credit equals EUR 0.01; charges round up to EUR 0.000001 (0.0001 credit). For example, 1,000 input tokens at a USD-to-EUR rate of 0.8 use 0.0034 credits. Before a paid call, the price of the 64,000-token maximum is reserved; only actual usage is captured on success and the unused hold is returned. Failures release the reservation. X-Jev-Credits reports the actual charge; usage.credits also reports it for the preset.
The preset truncates recent history and redacts known secrets; basic personal information redaction is enabled by default. The native route sends your state and criteria to TypeSafe without automatic redaction or truncation.
- 400
- Invalid JSON or parameters: check messages or the question schema.
- 401
- Invalid or disabled Fantasy key, or expired Pro subscription.
- 402
- Insufficient prepaid credits: top up your balance in Billing.
- 413
- The JSON body exceeds 256,000 UTF-8 bytes: reduce the context.
- 422
- TypeSafe rejected the native evaluation: check the model and questions.
- 429
- Request, token or concurrency limit reached: consult Retry-After when present.
- 502
- Provider error or invalid evaluation response.
- 503
- Jev is disabled or unconfigured, or evaluation is temporarily unavailable. For a self-hosted instance, configure JEV_ENABLED=true and TYPESAFE_API_KEY, then restart the server.