Skip to main content
This guide takes you from zero to a routed completion — and shows you how to see exactly which model PRYSM picked and what it cost.
1

Get an API key

Create a key at prysm1.com. PRYSM keys look like prysm_sk_.... Keep it secret — treat it like any other credential.
Set it as an environment variable so it never lands in your code:
export PRYSM_API_KEY="prysm_sk_your_key"
2

Install an SDK (optional)

PRYSM is OpenAI-compatible, so you can use the official OpenAI SDK directly — or install a first-party PRYSM SDK for the extra helpers.
pip install prysm1
3

Make your first request

Set model: "auto" and let PRYSM route it.
from prysm import Prysm

client = Prysm()  # api_key from $PRYSM_API_KEY

resp = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Write a Python function to reverse a string"}],
)
print(resp.choices[0].message.content)
4

See the routing decision

Every response includes a prysm block. With the SDKs, read it with extension():
from prysm import extension

ext = extension(resp)
print(ext.routing.model_display)  # e.g. "DeepSeek V3.2"
print(ext.routing.reason)         # why this model was chosen
print(ext.cost.total_usd)         # what the call cost
print(ext.proof.proof_hash)       # "sha256:..."
5

Preview routing without spending

Want to know which model PRYSM would pick — and the estimated cost — without actually calling it? Use a dry run:
print(client.route("debug this regex"))
# { routing: { model: "deepseek-v3.2", ... }, estimated_cost: { ... } }

What just happened

  1. You sent an OpenAI-shaped request with model: "auto".
  2. PRYSM classified the intent of your prompt (here: code) and selected the best-value model for it — see How routing works.
  3. It returned a standard OpenAI completion plus a prysm block with the model, reason, cost, latency, and a PrysmProof receipt.

Next steps

Add a BRAIN.md

Pin models to tasks, cap costs, and block models — all in one version-controlled file.

Python SDK

Helpers for routing, usage, savings, and BRAIN.md auto-discovery.

Node SDK

The same drop-in ergonomics, fully typed for TypeScript.

API reference

Every endpoint and field, with copy-paste examples.