You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Score level limits: the API enforces at most 10 levels, but the OpenAPI schema has no maximum, and a single level is accepted #6
Score level limits: the API enforces at most 10 levels, but the OpenAPI schema has no maximum, and a single level is accepted
What the docs say (API reference → ScoreQuestion): "A Score should have at least two levels; the API accepts up to 10."
What the OpenAPI schema says (https://api.typesafe.ai/openapi.json, ScoreQuestion.criteria): "type": "array", "minItems": 1, with no maxItems.
What the API does (checked 2026-09-21, jev-latest → jev-1.13.0):
fornin 1 2 10 11;do
L=$(python3 -c "import json;print(json.dumps([f'level {i}' for i in range($n)]))")
curl -s -w " HTTP %{http_code}\n" https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" -H "Content-Type: application/json" \
-d "{\"model\":\"jev-latest\",\"state\":\"The service is down for all users.\",\"questions\":{\"s\":{\"type\":\"score\",\"instructions\":\"How severe?\",\"criteria\":$L}}}"done
A one-level Score always returns confidence: 1.0 without looking at the state. It is accepted silently, so a caller who builds levels dynamically gets a confident, meaningless answer instead of an error.
The SDKs disagree on the minimum: the Python SDK accepts one level (questions.py), the JS SDK requires two (questions.ts).
Suggested fix
Add "maxItems": 10 to ScoreQuestion.criteria.
Either reject fewer than two levels (and set "minItems": 2), or document that a single level is allowed and always returns confidence 1.0.
Score level limits: the API enforces at most 10 levels, but the OpenAPI schema has no maximum, and a single level is accepted
What the docs say (API reference → ScoreQuestion): "A Score should have at least two levels; the API accepts up to 10."
What the OpenAPI schema says (
https://api.typesafe.ai/openapi.json,ScoreQuestion.criteria):"type": "array", "minItems": 1, with nomaxItems.What the API does (checked 2026-09-21,
jev-latest→jev-1.13.0):"score":0.0,"confidence":1.0,"probabilities":{"0":1.0}{"detail":"Too many score levels. Must have at most 10 levels."}Why it matters
openapi.jsoncannot catch it, and it surfaces as a 400 that the error table does not list (see Docs report: request-body validation returns 400, but the API reference documents 422 #1).confidence: 1.0without looking at the state. It is accepted silently, so a caller who builds levels dynamically gets a confident, meaningless answer instead of an error.questions.py), the JS SDK requires two (questions.ts).Suggested fix
"maxItems": 10toScoreQuestion.criteria."minItems": 2), or document that a single level is allowed and always returns confidence 1.0.