System One API
Evaluate a state against typed questions and return structured decisions in one roundtrip. Built for TypeSafe's flagship Jev 1.13 System One decision model.
System One vs Generative LLMs: Unlike traditional text-generation models that output prose requiring brittle regex/JSON parsing, Jev is trained specifically for fast, calibrated decisions. You send structured data (state) and typed questions (questions), and get back typed probabilities and confidence scores ready for code logic (if/else, routing, ranking).
Available Models
| Model Slug | TypeSafe Upstream | Context Window | Pricing (Input / Output) |
|---|---|---|---|
typesafe/jev-1.13 |
jev-1.13 |
64k tokens | $0.042 / Mtok (Output: Free) |
Output tokens are free: Jev 1.13 only charges for input tokens ($42 per billion tokens / $0.042 per million tokens). Output decisions are 100% free.
Authentication
Authenticate requests using your standard RouterHub API key in the Authorization header:
Authorization: Bearer $ROUTERHUB_API_KEY
Content-Type: application/jsonRequest Body
| Field | Type | Description | |
|---|---|---|---|
| model | string | Required | The model to use. Accepts typesafe/jev-1.13. |
| state | string | object | array | Required | The context to evaluate against. Can be a plain string (e.g. ticket message, review) or a nested structured JSON object/array. Maximum 32k tokens. |
| questions | map<string, Question> | Required | A dictionary of typed questions evaluated in parallel. Keys are user-defined identifiers returned in the response. |
Question Primitives
Every question in questions belongs to one of three primitives, set by its type field. All questions are evaluated simultaneously in parallel with zero context rot.
1. Noul (Boolean / Likelihood)
Evaluates a yes/no statement and returns a probability value between 0.0 (no) and 1.0 (yes).
| Field | Type | Description | |
|---|---|---|---|
| type | string | Required | Must be "noul". |
| instructions | string | object | Required | The statement or question to evaluate. Can reference nested state fields via backticks (e.g. `ticket.text`). |
| criteria | object | Optional | Definitions for what yes and no mean. Keys: true and false. |
2. Choice (Categorical Selection)
Selects exactly one option from a defined set (up to 255 options) and returns probabilities across all options alongside a confidence score.
| Field | Type | Description | |
|---|---|---|---|
| type | string | Required | Must be "choice". |
| instructions | string | object | Required | What the model should decide. |
| criteria | map<string, string | null> | Required | Map of option names to rubric descriptions. Use null if an option needs no description. |
3. Score (Graduated Rubric Rating)
Rates the state against 2 to 10 ordered rubric levels and returns an expected score value, level distribution, and confidence.
| Field | Type | Description | |
|---|---|---|---|
| type | string | Required | Must be "score". |
| instructions | string | object | Required | What the model should rate. |
| criteria | array<string> | Required | An ordered array of 2 to 10 level descriptions from lowest to highest. |
Quick Example
curl -X POST https://api.routerhub.ai/v1/systemone \
-H "Authorization: Bearer $ROUTERHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"state": "Our payment cluster in us-east-1 went down 15 minutes ago. All checkouts are failing!",
"questions": {
"is_outage": {
"type": "noul",
"instructions": "Does this indicate an active production outage?",
"criteria": {
"true": "Critical service disruption happening now",
"false": "General feature question or non-urgent issue"
}
},
"routing_target": {
"type": "choice",
"instructions": "Which on-call team should respond?",
"criteria": {
"sre_infra": "Database, server crash, network outage",
"billing_finance": "Invoices, payment refunds without system outage",
"general_support": null
}
},
"severity": {
"type": "score",
"instructions": "Rate the severity level",
"criteria": [
"Low: Non-urgent",
"Medium: Minor degraded feature",
"High: Major production disruption",
"Critical: Total global blackout"
]
}
}
}'from typesafe_sdk import TypeSafeClient
# Direct TypeSafe official SDK to RouterHub Gateway
client = TypeSafeClient(
base_url="https://api.routerhub.ai/v1",
api_key="YOUR_ROUTERHUB_API_KEY",
model="typesafe/jev-1.13",
)
result = client.system_one(
state="Our payment cluster in us-east-1 went down 15 minutes ago. All checkouts are failing!",
questions={
"is_outage": client.noul("Does this indicate an active production outage?"),
"routing_target": client.choice(
"Which on-call team should respond?",
{
"sre_infra": "Database, server crash, network outage",
"billing_finance": "Invoices, payment refunds without system outage",
},
),
"severity": client.score(
"Rate the severity level",
["Low", "Medium", "High", "Critical"],
),
},
)
print(result.answers)
# Access typed answers directly in code:
# result.answers["is_outage"].noul -> 0.98
# result.answers["routing_target"].choice -> "sre_infra"const response = await fetch("https://api.routerhub.ai/v1/systemone", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ROUTERHUB_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "typesafe/jev-1.13",
state: "Our payment cluster in us-east-1 went down 15 minutes ago. All checkouts are failing!",
questions: {
is_outage: {
type: "noul",
instructions: "Does this indicate an active production outage?",
},
routing_target: {
type: "choice",
instructions: "Which on-call team should respond?",
criteria: {
sre_infra: "Server down, DB timeout",
billing_finance: "Invoice dispute",
},
},
},
}),
});
const data = await response.json();
console.log(data.answers);Response Structure
The response returns typed answers under the exact question IDs you provided, along with token usage statistics:
{
"model": "jev-1.13.0",
"answers": {
"is_outage": {
"type": "noul",
"noul": 0.98
},
"routing_target": {
"type": "choice",
"choice": "sre_infra",
"probabilities": {
"sre_infra": 0.96,
"billing_finance": 0.04
},
"confidence": 0.94
},
"severity": {
"type": "score",
"score": 2.1,
"legend": {
"0": "Low: Non-urgent",
"1": "Medium: Minor degraded feature",
"2": "High: Major production disruption",
"3": "Critical: Total global blackout"
},
"probabilities": {
"0": 0.0,
"1": 0.02,
"2": 0.86,
"3": 0.12
},
"confidence": 0.88
}
},
"usage": {
"input_tokens": 348,
"output_tokens": 42
}
}Errors
System One errors follow the TypeSafe official error shape with a structured detail object:
| Status Code | Error Type | Description |
|---|---|---|
401 Unauthorized |
authentication_error |
Missing or invalid RouterHub Bearer token. |
422 Unprocessable Entity |
validation_error |
Request validation failed (e.g. empty state, missing questions, choice options > 255, score levels < 2 or > 10). |
429 Too Many Requests |
rate_limit_error |
Rate limit exceeded. Check the Retry-After response header and back off before retrying. |
504 Gateway Timeout |
timeout_error |
Request timed out waiting for upstream evaluation. |
529 Overloaded |
service_unavailable |
TypeSafe upstream is temporarily overloaded. Retry with exponential backoff. |
{
"detail": {
"error_type": "validation_error",
"message": "score question 'severity' must have between 2 and 10 levels"
}
}