Answer typed questions about supplied state
Relays to https://api.typesafe.ai/v1/systemone, overwriting Authorization with the
gateway’s TypeSafe key — the upstream authenticates on the same header your gateway token
arrives in, so the swap is both the injection and the strip. This is the only mounted
TypeSafe route and TypeSafe’s only billable endpoint; every other /typesafe/* path, and
any method other than POST, answers the gateway’s own 404.
The body is forwarded as sent. It carries three required fields — state (the content to
evaluate, as a string, object, or array), model, and questions (a map of ids you choose
to typed question objects, answered back under the same ids). TypeSafe rejects an
unrecognized top-level field with its own 400, so the gateway adds no second policy.
Each question is one of three types. A noul returns the probability the answer is yes; a
choice returns the picked option plus the probability of every option and a confidence; a
score returns a probability-weighted value across the ordered levels you describe, with
the same distribution and confidence. The state is read once however many questions ride
along, which — since billing counts input tokens only — makes batching markedly cheaper
than one call per question.
jev-1.13.0 is the current model; jev-latest and jev-preview are aliases that may move
without notice. The response always names the concrete version that answered, so a request
for jev-latest comes back as "model": "jev-1.13.0".
TypeSafe’s answer comes back exactly as it arrived — status, headers, and body bytes — and
the charge is settled from the usage.input_tokens it reports, at $0.04431 per million input
tokens (TypeSafe’s rate plus the gateway’s 5.5% fee). Output tokens are free upstream and are
not billed here.
Authentication
Your per-client bearer token — the API key the gateway issued to you. Present it in
Authorization: Bearer <token> form. A token that is missing, unknown, or revoked draws a
401. Before the call is sent upstream the token is removed (stripped, or swapped for the
upstream’s own credential); it never makes it past the gateway.
Request
The content to evaluate — text, or structured data for records, chat logs, or application state.
Response
Whatever the upstream answered, relayed as-is (status, headers, body). Rendered here as JSON; the true shape is the upstream provider’s to define.

