TypeSafe Jev (Three Calling Methods)
This document is based on real verified calls against this relay instance; all requests and responses are actual test results. Jev is TypeSafe's "System One" judgement model: it does not do free-text chat. Given a
stateand a set ofquestions, it returns structured judgements (choice/score/noul).
Basics
| Item | Value |
|---|---|
| Relay Base URL | https://llmapi.cttai.art |
| Auth | Authorization: Bearer <API Key> |
| API Key | Generate one on the API Console "Tokens" page (keep it secret, never share it) |
| Available models | jev-1.13.0, jev-latest, jev-preview (currently all resolve to jev-1.13.0) |
| Billing | Billed on input_tokens only ($0.042 / 1M input tokens); output is free |
Note:
jev-latestpoints to the latest stable version (use this by default);jev-previewpoints to the newest build and can be ahead of stable when a preview exists;jev-1.13.0is a pinned version.
Method 1: List available models (connectivity check)
GET https://llmapi.cttai.art/v1/models
Authorization: Bearer <API Key>
Verified response:
{
"data": [
{ "id": "jev-1.13.0", "object": "model", "owned_by": "task plugin", "supported_endpoint_types": ["openai"] },
{ "id": "jev-latest", "object": "model", "owned_by": "task plugin", "supported_endpoint_types": ["openai"] },
{ "id": "jev-preview", "object": "model", "owned_by": "task plugin", "supported_endpoint_types": ["openai"] }
],
"object": "list",
"success": true
}
Note:
supported_endpoint_types: ["openai"]is just a generic marker from new-api — it does not meanchat/completionsworks. See "Unsupported usage" at the end.
Method 2: Native route (recommended, synchronous answer)
POST https://llmapi.cttai.art/typesafe/v1/systemone
Authorization: Bearer <API Key>
Content-Type: application/json
Request body
{
"model": "jev-latest",
"state": "Customer: My payouts have been failing for 3 days, I am losing sales, please help ASAP",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoicing, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
},
"urgent": {
"type": "noul",
"instructions": "Does this express urgency?"
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}
Field rules:
model: required, one of the three model names.state: shared context, can be text / object / array / null (within the 64k context budget).questions: required, non-empty object; each questiontypemust be one of:choice:criteriais an object, 1~255 options.score:criteriais an array, 2~10 levels.noul:criteriaoptional; if set, the keys can only be"true"/"false".
stream: not supported (must be false or omitted).
Verified response
{
"model": "jev-1.13.0",
"answers": {
"department": {
"type": "choice",
"choice": "billing",
"confidence": 0.91,
"probabilities": { "billing": 0.94, "sales": 0, "technical": 0.06 }
},
"urgent": {
"type": "noul",
"noul": 0.98
},
"frustration": {
"type": "score",
"score": 1.07,
"confidence": 0.9,
"legend": { "0": "Calm", "1": "Frustrated", "2": "Very angry" },
"probabilities": { "0": 0, "1": 0.93, "2": 0.07 }
}
},
"usage": { "input_tokens": 425, "output_tokens": 70 }
}
Answer field mapping:
| Question type | Returned fields |
|---|---|
| choice | choice (matched option key) + confidence + probabilities (per-option probability) |
| score | score (level number, 0-based) + confidence + legend (level names) + probabilities |
| noul | noul (0~1 confidence) |
- This endpoint is synchronous — request and response return immediately;
usage.input_tokensis what is billed. - The result is not retained for the task query API; be sure to save this response.
curl example
curl 'https://llmapi.cttai.art/typesafe/v1/systemone' \
-H 'Authorization: Bearer <API Key>' \
-H 'Content-Type: application/json' \
-d '{
"model": "jev-latest",
"state": "Customer: My payouts have been failing for 3 days.",
"questions": {
"urgent": { "type": "noul", "instructions": "Does this express urgency?" }
}
}'
Method 3: Generic task API (submit + poll)
POST https://llmapi.cttai.art/v1/tasks/typesafe # submit a task
GET https://llmapi.cttai.art/v1/tasks/{task_id} # query task status
The request body is the same structure as Method 2 (model required).
Submit (verified)
curl 'https://llmapi.cttai.art/v1/tasks/typesafe' \
-H 'Authorization: Bearer <API Key>' \
-H 'Content-Type: application/json' \
-d '{
"model": "jev-latest",
"state": "Customer: My payouts have been failing for 3 days.",
"questions": { "urgent": { "type": "noul", "instructions": "Does this express urgency?" } }
}'
Submit response (returns the public gateway task ID; task_id is the same as id):
{
"created_at": 1789967908,
"id": "task_HA2KPl4UIKSwr7ZOCcGQStelcz357SpI",
"model": "jev-latest",
"status": "queued",
"task_id": "task_HA2KPl4UIKSwr7ZOCcGQStelcz357SpI"
}
Query status (verified)
GET https://llmapi.cttai.art/v1/tasks/task_HA2KPl4UIKSwr7ZOCcGQStelcz357SpI
{
"created_at": 1789967908,
"fail_reason": "",
"finished_at": 1789967908,
"platform": "typesafe",
"progress": "100%",
"status": "SUCCESS",
"task_id": "task_HA2KPl4UIKSwr7ZOCcGQStelcz357SpI"
}
Note: the generic task query only returns standard status fields — it does not return the answer body (this plugin uses a synchronous route). To get judgements, use Method 2 and save the synchronous response; task records are only for status and billing verification.
Unsupported usage
The following usages were verified to be unavailable — do not use them:
| Usage | Result |
|---|---|
POST /v1/chat/completions | 503 model_not_found (Jev does not chat) |
stream: true | Error (TypeSafe System One does not support streaming) |
| Polling tasks for answers | The query only returns status, not answers |
Appendix: Python example (verified runnable)
import json, urllib.request, ssl
BASE = "https://llmapi.cttai.art"
KEY = "<API Key>"
CTX = ssl.create_default_context()
def call(path, method="GET", body=None):
data = json.dumps(body, ensure_ascii=False).encode() if body is not None else None
req = urllib.request.Request(BASE + path, data=data, method=method,
headers={"Authorization": "Bearer " + KEY,
"Content-Type": "application/json"})
with urllib.request.urlopen(req, context=CTX, timeout=30) as resp:
return resp.status, json.loads(resp.read().decode("utf-8"))
# Method 2: native route
status, resp = call("/typesafe/v1/systemone", "POST", {
"model": "jev-latest",
"state": "Customer: My payouts have been failing for 3 days.",
"questions": {"urgent": {"type": "noul", "instructions": "Does this express urgency?"}},
})
print(status, json.dumps(resp, ensure_ascii=False, indent=2))
Tip: all content in this document comes from real verified calls against the relay instance; you can verify directly with curl or any OpenAI-compatible client.