> ## 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.

# Introduction

> One API, every model, always the best one. PRYSM routes every prompt to the best-value model across 27 models and 12 providers — without changing your code.

PRYSM is a **universal AI routing engine**. Point your existing OpenAI code at PRYSM
and every prompt is automatically routed to the best-value model for the job — across
**27 models from 12 providers** (OpenAI, Anthropic, Google, DeepSeek, xAI, Mistral,
Moonshot, Alibaba, Perplexity, Meta, Zhipu, SambaNova) — behind **one API, one key, and one bill**.

<CardGroup cols={2}>
  <Card title="Drop-in for OpenAI" icon="plug" href="/quickstart">
    Change one line — the base URL. Every OpenAI SDK call works unchanged.
  </Card>

  <Card title="Smart routing" icon="route" href="/concepts/routing">
    Intent classification picks the right model for each prompt: quality, balanced, or agility.
  </Card>

  <Card title="BRAIN.md config" icon="file-code" href="/concepts/brain-md">
    A declarative, version-controlled routing file — the <code>.cursorrules</code> of model routing.
  </Card>

  <Card title="Cost guardrails" icon="shield-halved" href="/concepts/agentguard">
    AgentGuard caps per-request spend and blocks models you don't want agents touching.
  </Card>

  <Card title="PrysmProof receipts" icon="fingerprint" href="/concepts/prysmproof">
    Every response carries a tamper-evident SHA-256 receipt of what ran and why.
  </Card>

  <Card title="MCP server" icon="robot" href="/sdks/mcp">
    Give Claude Desktop, Cursor, or Windsurf cost-aware routing as a native tool.
  </Card>
</CardGroup>

## Why PRYSM

The model you reach for by default is rarely the best one for the task in front of you.
A frontier model on a one-line classification is wasted money; a budget model on a
nuanced contract is wasted quality. PRYSM makes that decision **per request** — so you
get the right model every time without hand-tuning, while spend stays predictable.

<CardGroup cols={3}>
  <Card title="Better outputs" icon="wand-magic-sparkles">
    Each prompt goes to the model that's actually best at it — code, writing, math,
    translation, reasoning, and more.
  </Card>

  <Card title="Lower cost" icon="piggy-bank">
    Cheap models handle the easy 80%; premium models are reserved for the hard 20%.
    Typical savings are large versus an all-premium baseline.
  </Card>

  <Card title="Zero lock-in" icon="arrows-rotate">
    OpenAI-compatible. No new SDK to learn, no rewrite, no juggling nine provider keys.
  </Card>
</CardGroup>

## The drop-in pattern

PRYSM speaks the OpenAI API. Set `model: "auto"` and let PRYSM choose:

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="prysm_sk_your_key",
      base_url="https://api.prysm1.com/v1",   # the only change
  )

  resp = client.chat.completions.create(
      model="auto",                          # let PRYSM pick the best model
      messages=[{"role": "user", "content": "Write a Python quicksort"}],
  )
  print(resp.choices[0].message.content)
  ```

  ```typescript Node theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "prysm_sk_your_key",
    baseURL: "https://api.prysm1.com/v1",      // the only change
  });

  const resp = await client.chat.completions.create({
    model: "auto",                           // let PRYSM pick the best model
    messages: [{ role: "user", content: "Write a TypeScript quicksort" }],
  });
  console.log(resp.choices[0].message.content);
  ```

  ```bash cURL theme={null}
  curl https://api.prysm1.com/v1/chat/completions \
    -H "Authorization: Bearer prysm_sk_your_key" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "auto",
      "messages": [{ "role": "user", "content": "Write a Python quicksort" }]
    }'
  ```
</CodeGroup>

<Tip>
  Prefer a native client? The first-party SDKs ([`prysm1`](/sdks/python) for Python
  and [`@prysmai/sdk`](/sdks/node) for Node) subclass the OpenAI client and add helpers
  for routing previews, usage, savings, and BRAIN.md auto-discovery.
</Tip>

## What's in every response

PRYSM returns a standard OpenAI payload **plus** a top-level `prysm` block describing
the decision — which model ran, why, what it cost, latency, and a verifiable proof:

```json theme={null}
{
  "id": "prysm-a1b2c3d4",
  "object": "chat.completion",
  "model": "deepseek-v4-flash",
  "choices": [{ "message": { "role": "assistant", "content": "..." } }],
  "usage": { "prompt_tokens": 18, "completion_tokens": 240, "total_tokens": 258 },
  "prysm": {
    "routing": {
      "mode": "balanced",
      "model_display": "DeepSeek V4 Flash",
      "provider": "deepseek",
      "reason": "Code: 95% cheaper than GPT-5.2",
      "tier": "budget",
      "signals_detected": { "code": true }
    },
    "cost": { "input_usd": 0.0000025, "output_usd": 0.0000672, "total_usd": 0.0000697 },
    "latency_ms": 740,
    "proof": { "proof_hash": "sha256:a1b2c3d4e5f6a7b8", "verifiable": true }
  }
}
```

OpenAI-compatible clients ignore the extra `prysm` field. The PRYSM SDKs expose it
cleanly through [`extension()`](/sdks/python#access-the-prysm-extensions).

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Make your first routed request in under five minutes.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    API keys, the base URL, and environment variables.
  </Card>

  <Card title="How routing works" icon="route" href="/concepts/routing">
    Modes, signals, and how PRYSM picks a model.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/introduction">
    Every endpoint, parameter, and response field.
  </Card>

  <Card title="Building with AI agents" icon="robot" href="/concepts/for-ai-agents">
    Hard spend ceilings, tamper-evident trajectories, and BRAIN.md for autonomous agents.
  </Card>
</CardGroup>
