> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prysm1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cut your AI API bill 60–80% with one line of code

> Most teams overpay for AI because they send every prompt to the same model. Here's how to stop.

Most AI-powered apps pick one model and use it for everything — a frontier model for a simple
"say hello" and for a complex reasoning task alike. That's the equivalent of hiring a senior
engineer to answer support emails.

PRYSM's routing engine measures ten intent signals per prompt and picks the right model for each
call. Replacing your OpenAI client with PRYSM is a single-line change.

## Before: one model for everything

```python theme={null}
from openai import OpenAI

client = OpenAI()  # every call hits gpt-5.2 at $21/MTok

resp = client.chat.completions.create(
    model="gpt-5.2-pro",
    messages=[{"role": "user", "content": "What's 2 + 2?"}],
)
print(resp.choices[0].message.content)
```

## After: intent-aware routing

```python theme={null}
from prysm import Prysm

client = Prysm()  # same API, every call routed to the best-value model

resp = client.chat.completions.create(
    model="auto",          # ← this is the only change
    messages=[{"role": "user", "content": "What's 2 + 2?"}],
)
print(resp.choices[0].message.content)
# PRYSM routed to mistral-nemo ($0.02/MTok) — 1000× cheaper than gpt-5.2-pro
```

The `model="auto"` flag tells PRYSM to apply its routing engine. Your prompts are never stored —
only an anonymous intent classification runs locally.

## How intent routing works

PRYSM's classifier scores each prompt on ten signals in under 5 ms:

| Signal      | Example prompt                                | Routed to              |
| ----------- | --------------------------------------------- | ---------------------- |
| `simple`    | "What's the capital of France?"               | Budget model           |
| `code`      | "Refactor this async handler…"                | Code-specialized model |
| `reasoning` | "Prove that √2 is irrational"                 | Math/reasoning model   |
| `analysis`  | "Compare these three architectural patterns…" | Frontier model         |
| `translate` | "Translate to French:"                        | Budget multilingual    |
| `realtime`  | "Today's top news"                            | Search-grounded model  |

## Dry-run: preview routing without calling a model

```python theme={null}
preview = client.route("Write unit tests for this function")
print(preview["routing"]["model"])        # e.g. "claude-sonnet-4.5"
print(preview["routing"]["why"])          # "code signal + medium complexity"
print(preview["estimated_cost"]["est_1k_tokens"])  # e.g. 0.003 USD
```

`route()` shows exactly which model would be chosen and why — no tokens consumed.

## Measure your savings

```python theme={null}
savings = client.savings(baseline="gpt-5.2-pro")
print(f"Saved {savings['saved_pct']}% vs. sending everything to {savings['baseline_model']}")
# Saved 71.3% vs. sending everything to gpt-5.2-pro
```

## Install

```bash theme={null}
pip install prysm1
# or
npm install @prysmai/sdk
```

Get your API key at [prysm1.com](https://prysm1.com).

The routing engine is OpenAI-compatible — every parameter, streaming, function-calling, and
tool-use feature works unchanged. You change one word, the bill changes dramatically.
