How to Get a Jev API Key and Set Up Your Environment
Before you send a single judgment question, you need an API key and an environment that keeps it safe. The fastest path to a working Jev setup runs through OpenRouter, the model’s main demo channel: it exposes Jev through an OpenAI-compatible endpoint, so the key you get there works with the request shape you already know. This guide walks through getting the key, wiring it into your environment, setting up credits, and the security habits that prevent an expensive accident.
TL;DR: Sign up on OpenRouter, add credits, and create an API key. Store it in an environment variable (
OPENROUTER_API_KEY), never in code. Jev is listed at roughly $0.0462 per 1M input tokens on third-party listings — confirm current pricing on the OpenRouter model page. For the official TypeSafe AI channel and its own endpoints, follow the official documentation at typesafe.ai.
Step 1: Get the key from OpenRouter
- Create an account on OpenRouter and sign in.
- Open the Keys section of your dashboard and create a new API key.
- Copy the key immediately — some dashboards only show it once. If you lose it, create a new one and revoke the old.
- Find the Jev model page and note the exact model id. As of this writing it is listed as
typesafe/jev-1.13; always confirm the exact model slug on the OpenRouter model page, because slugs change with versions. - Review the model page’s pricing tab for the current per-token rates.
For the official TypeSafe AI channel (direct API access, enterprise terms, version guarantees), do not guess at endpoints — follow the official documentation on typesafe.ai and the announcement post introducing System One models and Jev. The trade-offs between the two channels are covered in the API channels guide.
Step 2: Put the key in your environment
The one non-negotiable rule: the key never goes into source code, config files in git, or chat messages. Use an environment variable:
# ~/.zshrc or ~/.bashrc — session-scoped export
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
After adding the line, restart your shell or run source ~/.zshrc. Your code then reads it at runtime:
import os
api_key = os.environ["OPENROUTER_API_KEY"] # raises if missing — good
Reading from the environment at runtime is the right default: if the variable is missing, the process fails loudly instead of silently shipping a request without auth.
For teams, prefer a secrets manager (AWS Secrets Manager, Doppler, 1Password Connect) and inject the variable at deploy time. For local automation tools like n8n, use the tool’s own credential store rather than pasting the key into workflow nodes.
Step 3: Set up credits and billing
OpenRouter works on prepaid credits:
| Setting | Where | Recommendation |
|---|---|---|
| Credit balance | Billing / Credits page | Start with a small top-up while testing |
| Spend limit | Key settings | Cap each key so a leaked key cannot drain the account |
| Per-key limits | Keys page | One key per project, so usage is attributable |
| Auto top-up | Billing settings | Enable only after your pipeline is stable |
A practical pricing anchor: at the listed rate of about $0.0462 per 1M input tokens (third-party listing data — confirm on the OpenRouter model page), a million judgment calls with short prompts is measured in tens of dollars, not hundreds. Work out your own math in the cost-and-latency guide.
Step 4: Verify the key works
Make one cheap call before wiring anything up:
# Confirm the exact model slug on the OpenRouter model page
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"messages": [{"role": "user", "content": "Judgment question: is the sky blue?"}]
}'
A 200 response with a structured answer in the message content means the key, the credits and the model slug are all correct.
The parsed answer — example fixture, confirm exact field names in the official documentation:
{
"answer": "yes",
"confidence": 0.99,
"rationale": "Visible-sky blue coloration is the expected answer to this common-knowledge question."
}
If you get a 401, the key is wrong or missing; a 404 usually means the model slug is off. Both are covered in the troubleshooting guide.
Security habits that matter
- One key per project. When usage spikes, you know which project to look at, and revoking is surgical.
- Set spend limits per key. A leaked key with no cap is an open tab.
- Rotate on suspicion. If a key appears in a log, a screenshot or a commit, revoke it immediately.
- Never commit
.envfiles. Add them to.gitignoreon day one. - Treat the key like a password, because it is one — with your credit card behind it.
Once the key verifies, continue to the first API call tutorial for the full request walkthrough, or the ticket triage case to see the key used in a real workflow.
This guide applies to Jev 1.13.