Pre-triage with Jev
This recipe uses Jev, TypeSafe’s decision model, to answer a cheap yes, no or unknown question about each incoming item, so only the items that need it go to a large model.
How it works
Section titled “How it works”Jev is not a chat model. You send a state (the facts, as JSON) and typed questions, and get answers. Question types:
noul: yes, no or unknown, for example “Is this ticket urgent?”choice: one option out of a listscore: a number
You call it on OpenPike’s /v1/systemone endpoint with the same virtual key as your other requests. Its requests show in Logs and count toward the plan, and request-per-minute loop limits apply to them; spend budgets do not, because Jev is not priced in OpenPike yet.
1. Add a key
Section titled “1. Add a key”Add a TypeSafe key on the Providers page, and use typesafe/jev-1.13.0. If TypeSafe’s API is not open to you yet, add an OpenRouter key instead and use openrouter/typesafe/jev-1.13; OpenRouter serves the same endpoint. See TypeSafe (Jev).
2. Ask the question
Section titled “2. Ask the question”curl https://api.openpike.dev/v1/systemone \ -H "Authorization: Bearer $OPENPIKE_API_KEY" \ -H "Content-Type: application/json" \ -H "x-openpike-tags: agent=triage" \ -d '{ "model": "typesafe/jev-1.13.0", "state": {"ticket": "Customer reports the checkout page returns a 500 error for all users."}, "questions": [{"id": "urgent", "type": "noul", "question": "Is this ticket urgent?"}] }'import os
import httpx
ticket = "Customer reports the checkout page returns a 500 error for all users."
decision = httpx.post( "https://api.openpike.dev/v1/systemone", headers={ "Authorization": f"Bearer {os.environ['OPENPIKE_API_KEY']}", "x-openpike-tags": "agent=triage", }, json={ "model": "typesafe/jev-1.13.0", "state": {"ticket": ticket}, "questions": [{"id": "urgent", "type": "noul", "question": "Is this ticket urgent?"}], }, timeout=30,)decision.raise_for_status()print(decision.json()["answers"])const ticket = "Customer reports the checkout page returns a 500 error for all users.";
const res = await fetch("https://api.openpike.dev/v1/systemone", { method: "POST", headers: { Authorization: `Bearer ${process.env.OPENPIKE_API_KEY}`, "Content-Type": "application/json", "x-openpike-tags": "agent=triage", }, body: JSON.stringify({ model: "typesafe/jev-1.13.0", state: { ticket }, questions: [{ id: "urgent", type: "noul", question: "Is this ticket urgent?" }], }),});if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);const decision = (await res.json()) as { answers: unknown };console.log(decision.answers);3. Act on the answer
Section titled “3. Act on the answer”- Yes: send the ticket to your large model, page someone, or both.
- No: put it in the normal queue, no large-model call.
- Unknown: treat it as yes, or ask a follow-up question with more of the ticket in
state.
4. Watch it
Section titled “4. Watch it”Tag the requests, as in the example, with agent=triage. Agents then shows how many decisions you made; Jev is not priced in OpenPike yet, so its requests show no cost.
OpenPike has not tested TypeSafe’s API live yet; check the first responses in Logs.