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
Access the PRYSM extensions
Every response carries aprysm 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 aBRAIN.md in your project root and the SDK finds it
automatically, applying your routing rules, cost caps, and blocked models:
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.
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.
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.
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:
Helpers
| Method | Description |
|---|---|
client.complete(prompt, ...) | One-shot chat with model="auto" + BRAIN.md auto-applied. |
client.orchestrate(prompt, policy=..., strategy=...) | Multi-model orchestration (v2): cascade / ensemble / debate + PrysmProof. |
client.code(task, policy=..., review=...) | Code Mode (v2): self-correcting, multi-model code generation + PrysmProof. |
client.compliance_preview(prompt, compliance=...) | Compliance preview (v2): dry-run the policy gate — allowed/excluded models, CCP, attestation. No model call. |
client.route(prompt, mode=None) | Dry run: which model + estimated cost, no model call. |
client.usage() | Usage stats for your key. |
client.savings(baseline="gpt-5.2") | Estimated $ saved vs. an all-premium baseline. |
client.verify_proof(request_id) | Verify a PrysmProof. |
client.validate_brain(text_or_dict) | Validate a BRAIN.md config. |
client.models_catalog() | The 19-model catalog with pricing. |
Validate a BRAIN.md before shipping
Configuration
| Setting | Argument | Env var | Default |
|---|---|---|---|
| API key | api_key= | PRYSM_API_KEY | — |
| Base URL | base_url= | PRYSM_BASE_URL | https://api.prysm1.com/v1 |
| BRAIN.md | brain= | — | "auto" (discover) |
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.