How to Use Jev on OpenRouter
Use OpenRouter’s TypeSafe-compatible endpoint and distinguish it from the separate alpha Decisions API.
On this page
Two API surfacesCreate and configure a keyModel IDsComplete Python exampleJavaScript client configurationBatch questions and read resultsAlpha Decisions APIPricing and common errorsProvider integration checked: 2026-09-21. OpenRouter’s alpha Decisions surface is experimental and may change. The compatible System One path below is documented separately by OpenRouter.
Two API surfaces
OpenRouter documents a TypeSafe-compatible System One endpoint at https://openrouter.ai/api/v1/systemone. An existing TypeSafe client can target it by changing the base URL and key. OpenRouter also exposes /api/alpha/decisions, with its own documented schema. Do not assume a chat-completions endpoint accepts either body.
Create and configure a key
Create a key in OpenRouter settings. Store it as OPENROUTER_API_KEY. Do not send a direct TypeSafe key to this host. The SDK base URL is https://openrouter.ai/api; the SDK appends /v1/systemone.
Model IDs
OpenRouter’s current compatibility guide uses jev-1.13, which maps to typesafe/jev-1.13. It maps jev-latest to its latest Jev alias. Already-prefixed IDs are used as supplied. These names are provider-specific and should not be substituted for the direct pinned ID without checking the catalog.
Complete Python example
import os
from typesafe_sdk import TypeSafeClient, Choice, Score, Noul
with TypeSafeClient(api_key=os.environ["OPENROUTER_API_KEY"],
base_url="https://openrouter.ai/api") as client:
response = client.system_one(
model="jev-1.13",
state={"ticket": "I was charged twice. Please refund the duplicate before Friday."},
questions={
"department": Choice(instructions="Which team owns the ticket?",
criteria={"billing": "Payments and refunds", "technical": "Bugs", "other": "Neither"}),
"urgency": Score(instructions="How urgent is the ticket?",
criteria=["Routine", "This week", "Today"]),
"refund": Noul(instructions="Is a refund explicitly requested?")})
print(response.choices["department"].choice)
print(response.choices["department"].confidence)
print(response.scores["urgency"].score)
print(response.nouls["refund"].noul)
print(response.model, response.usage)
Install typesafe-sdk, save as openrouter_demo.py, set the environment variable, and run python openrouter_demo.py. This is a live billed call; no model result is claimed by this manual.
JavaScript client configuration
import { TypeSafeClient } from '@typesafe-ai/sdk';
const client = new TypeSafeClient({
apiKey: process.env.OPENROUTER_API_KEY,
baseURL: 'https://openrouter.ai/api'
});
Use client.systemOne() with the same typed question structure. Read results under their named keys. An SDK-compatible route lets you reuse application logic, but provider pricing, limits, model mapping, and retention still require separate checks.
Batch questions and read results
The example includes all three primitives against one state. Choice and Score carry distributions; Noul is a yes probability. Preserve the returned model and usage so later changes in provider routing can be investigated.
Alpha Decisions API
The alpha endpoint reference is the source for that experimental request and response contract. Use its current schema and provider model ID. This guide recommends the compatibility path for readers already using the direct SDK because it avoids silently mixing two interface shapes.
Pricing and common errors
Check the provider’s model page for actual rates; the direct TypeSafe price is not automatically your OpenRouter bill. For 401, verify the OpenRouter key and base URL together. For 404, check the model namespace and endpoint. For 422, verify which API surface your body targets. For 429, respect provider limits and retry headers.