API · Last updated

TypeSafe Python SDK

The TypeSafe Python SDK (typesafe-sdk) is the official Python client for Jev / System One. Install it on Python ≥ 3.10. TypeSafeClient and AsyncTypeSafeClient read TYPESAFE_API_KEY and default to jev-latest. They wrap POST https://api.typesafe.ai/v1/systemone.

This page is for builders wiring TypeSafe Jev (System One) into agents, routing, or evals. jev.pro is an independent unofficial field guide — not affiliated with TypeSafe AI. We do not sell or issue keys. Confirm install names, method signatures, and retry defaults on docs.typesafe.ai and the API reference.

Install

pip install typesafe-sdk

uv add typesafe-sdk is the same package. Do not vendor a fork from this site. TypeSafe links source from the official Python SDK page. Pin the package version in production the same way you pin jev-1.13.0 once confidence floors exist.

Synchronous client

from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

with TypeSafeClient() as client:
    response = client.system_one(
        state={"document": "I was charged twice. Please fix this ASAP."},
        questions={
            "billing": Noul(instructions="Is this ticket about billing?"),
            "tone": Choice(
                instructions="What is the customer's tone?",
                criteria={"calm": None, "frustrated": None, "angry": None},
            ),
            "urgency": Score(
                instructions="How urgent is this ticket?",
                criteria=["can wait", "this week", "today"],
            ),
        },
    )

print(response.nouls["billing"].noul)
print(response.choices["tone"].choice)
print(response.scores["urgency"].score)

Use AsyncTypeSafeClient the same way with async with. Retries for 429 and 529 are on by default; honor retry-after. Helpers: Choice (unordered, max 255), Score (2–10 levels), Noul (P(yes) 0–1, no confidence).

What the client is doing

system_one still sends model, state, and questions. Question map keys such as "billing" are your ids. TypeSafe documents that those ids are not sent to the model; they only key answers (and the SDK convenience maps). HTTP clients should read answers. The Python client also exposes response.nouls, response.choices, and response.scores.

The HTTP response still includes a resolved model (often jev-1.13.0 when you sent jev-latest or jev-preview — confirm on the models page) plus usage. TypeSafe’s public list price is a vendor claim: $0.042 per million input tokens, output free. Log both counts; do not assume output is billed.

Production notes

When not to use this package

Skip the SDK if you cannot take a PyPI dependency. Raw POST /v1/systemone is the same contract. Skip it in the browser with a production secret. For Node, use the JavaScript SDK.

See also

FAQ

response.nouls vs answers?

HTTP clients should read answers. The Python SDK also exposes convenience maps. Log raw answers for a decision trace.

Title said “or” as H1 — is that a TypeSafe flag?

No. Thin-page artifact. The package is typesafe-sdk.

Does this site publish a PyPI mirror?

No. Install from the official package name TypeSafe documents. We do not proxy evaluations or accept a key.

Do I still need to handle 422 myself?

Yes. Official retries cover overload and rate limits, not a body that failed validation. Fix the field the JSON names.

What this page does not claim

Disclaimer

This is an independent unofficial site and is not affiliated with TypeSafe AI; official documentation is available at https://docs.typesafe.ai. Never treat jev.pro as TypeSafe official documentation. We do not sell, issue, or proxy API keys.

Sources