Skip to main content
prysm1 subclasses openai.OpenAI, so all your existing OpenAI code works unchanged — plus helpers for routing previews, usage, savings, proof verification, and BRAIN.md auto-discovery.

Drop-in replacement for OpenAI

Already using openai? You don’t have to install prysm1 at all — just point the official client at PRYSM’s base URL. The SDK is for the extra ergonomics below.

Access the PRYSM extensions

Every response carries a prysm block (routing, cost, latency, proof). Use extension() for clean dot-access:
extension() returns None for responses without a prysm block, so it’s safe to call on any completion.

BRAIN.md auto-discovery

Drop a BRAIN.md in your project root and the SDK finds it automatically, applying your routing rules, cost caps, and blocked models:
Point it explicitly, pass a dict, or disable:

Orchestration (v2)

Beyond routing to one model, orchestrate() runs a prompt across several models — cascading, ensembling, decomposing, or debating — and returns one synthesized answer plus a PrysmProof v2. Pick the objective with a policy; PRYSM plans the strategy (or you force one). See How orchestration works.
Force a strategy, widen the ensemble, or cap spend:

Code Mode (v2)

code() writes code, reviews it with a separate critic model, and repairs against that feedback until the review passes or a budget/iteration cap is hit. In depth, several diverse coders run in parallel and the best candidate is kept. PRYSM never executes the generated code. See How Code Mode works.
Force the models, cap iterations, or skip the critic loop for a single shot:

Compliance (v2)

Load the providers your organization approves and PRYSM routes only to models that satisfy your policy — non-compliant models are filtered out before scoring. See compliance routing. compliance_preview() is a pure dry-run (no model call, no keys needed): it shows which models a policy allows vs excludes, the Compliance Cost Premium, and a sample attestation.
Then enforce the same policy on a real run — orchestrate() (and complete()) accept a compliance= spec. Excluded models can never be selected, and the result carries a compliance decision plus an attestation in its PrysmProof:
Prefer to declare it once and version it: put a compliance: block in your BRAIN.md and it applies to every request automatically.

Helpers

Validate a BRAIN.md before shipping

Configuration

If PRYSM_API_KEY is unset, the SDK falls back to OPENAI_API_KEY — so migrating existing code can be a one-line base-URL change.

Next steps

CLI

prysm1 ships a prysm command for routing, models, validation, and usage.

API reference

The endpoints these helpers call, documented field by field.