> ## 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 OpenAI bill 60–80% with one line of code

> PRYSM routes every prompt to the cheapest model that can handle it. Drop in one line and watch your costs fall.

Most developers send every request to `gpt-4o` or `claude-opus` out of habit. That habit costs 10–50× more than necessary for the majority of prompts.

A simple classification question, a JSON extraction, a grammar check — these tasks don't need a frontier model. PRYSM routes them automatically to the cheapest capable model and reserves the heavy models only for prompts that need them.

## The one-line change

<CodeGroup>
  ```python Python theme={null}
  # Before
  from openai import OpenAI
  client = OpenAI(api_key="sk-...")

  # After — zero other changes
  from openai import OpenAI
  client = OpenAI(
      api_key="prysm_sk_...",      # your PRYSM key
      base_url="https://api.prysm1.com/v1",
  )
  ```

  ```typescript TypeScript theme={null}
  // Before
  import OpenAI from "openai";
  const client = new OpenAI({ apiKey: "sk-..." });

  // After — zero other changes
  import OpenAI from "openai";
  const client = new OpenAI({
    apiKey: "prysm_sk_...",
    baseURL: "https://api.prysm1.com/v1",
  });
  ```
</CodeGroup>

Every `chat.completions.create()` call now routes automatically. Your code stays identical.

## What just happened

When you send a prompt, PRYSM scores it across 10 signals in \~1 ms:

| Signal       | Example prompt                     | Best model tier            |
| ------------ | ---------------------------------- | -------------------------- |
| `simple`     | "Translate 'hello' to French"      | budget (\$0.02–0.10/MTok)  |
| `code`       | "Write a binary search in Python"  | mid (\$0.25–0.50/MTok)     |
| `reasoning`  | "Prove that √2 is irrational"      | premium (\$0.55–3.00/MTok) |
| `multimodal` | Image + "Describe this chart"      | specialist                 |
| `realtime`   | "Latest news on AI chips"          | Perplexity Sonar           |
| `analysis`   | "Analyze Q4 earnings vs. forecast" | quality mode (multi-model) |

Typical distribution in a production app: \~60% simple, \~30% code/mid, \~10% frontier. That mix costs \*\*$0.28–0.50/MTok blended** instead of $5–21/MTok for all-frontier.

## Verify routing in the response

Every PRYSM response adds three fields under `prysm`:

```python theme={null}
response = client.chat.completions.create(
    model="auto",  # let PRYSM decide
    messages=[{"role": "user", "content": "What is 2 + 2?"}],
)

ext = response.model_extra  # or response.choices[0].message.model_extra
print(ext["prysm"]["routing"]["model"])    # "gpt-5-nano"
print(ext["prysm"]["cost"]["total_usd"])   # 0.0000003
print(ext["prysm"]["proof"])               # "sha256:a1b2c3d4e5f6..."
```

## Dry-run before committing

Use `/v1/route` to see which model PRYSM would pick for a prompt — no tokens consumed:

```bash theme={null}
curl https://api.prysm1.com/v1/route \
  -H "Authorization: Bearer prysm_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Summarize this article in 3 bullets"}'
```

```json theme={null}
{
  "model": "deepseek-v4-flash",
  "tier": "budget",
  "mode": "agility",
  "estimated_cost_usd": 0.0000094,
  "signals": ["write", "simple"],
  "why": "Short-form writing, no reasoning required"
}
```

## Real savings estimate

Use `/v1/savings` to quantify what you'd save given your current usage:

```python theme={null}
import httpx, os

r = httpx.post(
    "https://api.prysm1.com/v1/savings",
    headers={"Authorization": f"Bearer {os.environ['PRYSM_API_KEY']}"},
    json={
        "monthly_requests": 100_000,
        "avg_input_tokens": 500,
        "avg_output_tokens": 300,
        "current_model": "gpt-4o",
    },
)
s = r.json()
print(f"Current cost:  ${s['current_monthly_usd']:.2f}/mo")
print(f"PRYSM cost:    ${s['prysm_monthly_usd']:.2f}/mo")
print(f"Monthly saving: ${s['saving_usd']:.2f} ({s['saving_pct']:.0f}%)")
```

<Tip>
  **Get your key in 30 seconds** — sign up at [prysm1.com](https://prysm1.com), get a `prysm_sk_*` key, and your first 1,000 requests are free.
</Tip>
