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

# Preview routing

> Dry-run the router: see which model PRYSM would pick and the estimated cost — without calling the model.

<Note>
  **POST** `https://api.prysm1.com/v1/route` · Requires authentication
</Note>

Preview a routing decision without generating a completion. Returns the model PRYSM would
select for a prompt plus an estimated cost — perfect for testing
[BRAIN.md](/concepts/brain-md) rules and showing users a price before they spend.

## Authorization

<ParamField header="Authorization" type="string" required>
  Your secret key as a bearer token: `Bearer prysm_sk_...`
</ParamField>

## Body

<ParamField body="prompt" type="string" required>
  The prompt to classify and route.
</ParamField>

<ParamField body="routing_mode" type="string">
  Force a routing mode: `quality`, `balanced`, or `agility`. Omit to let PRYSM choose.
</ParamField>

<ParamField body="brain_config" type="object">
  An inline [BRAIN.md](/concepts/brain-md) config to apply when routing.
</ParamField>

## Response

<ResponseField name="routing" type="object">
  The routing decision.

  <Expandable title="routing">
    <ResponseField name="mode" type="string">`quality`, `balanced`, or `agility`.</ResponseField>
    <ResponseField name="model" type="string">The chosen model's catalog ID.</ResponseField>
    <ResponseField name="display" type="string">Human-readable model name.</ResponseField>
    <ResponseField name="provider" type="string">Upstream provider.</ResponseField>
    <ResponseField name="why" type="string">Why this model was chosen.</ResponseField>
    <ResponseField name="tier" type="string">`budget`, `mid`, `premium`, or `frontier`.</ResponseField>
    <ResponseField name="signals" type="object">Intent signals detected in the prompt.</ResponseField>
    <ResponseField name="in_cost" type="number">Input price, USD per MTok.</ResponseField>
    <ResponseField name="out_cost" type="number">Output price, USD per MTok.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="estimated_cost" type="object">
  <Expandable title="estimated_cost">
    <ResponseField name="input_per_mtok" type="number">Input price, USD per MTok.</ResponseField>
    <ResponseField name="output_per_mtok" type="number">Output price, USD per MTok.</ResponseField>
    <ResponseField name="est_1k_tokens" type="number">Estimated cost for \~1K tokens, USD.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="model_info" type="object">
  <Expandable title="model_info">
    <ResponseField name="context_window" type="integer">Maximum context length in tokens.</ResponseField>
    <ResponseField name="expected_latency_ms" type="integer">Typical latency in milliseconds.</ResponseField>
    <ResponseField name="strengths" type="string[]">What this model is good at.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```python Python theme={null}
  from prysm import Prysm

  client = Prysm()
  print(client.route("write a python function to sort a list"))
  ```

  ```typescript Node theme={null}
  import { Prysm } from "@prysmai/sdk";

  const client = new Prysm();
  console.log(await client.route("write a python function to sort a list"));
  ```

  ```bash cURL theme={null}
  curl https://api.prysm1.com/v1/route \
    -H "Authorization: Bearer $PRYSM_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "prompt": "write a python function to sort a list" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "routing": {
      "mode": "balanced",
      "model": "deepseek-v4-flash",
      "display": "DeepSeek V4 Flash",
      "provider": "deepseek",
      "why": "Code: 95% cheaper than GPT-5.2",
      "tier": "budget",
      "signals": { "code": true },
      "in_cost": 0.28,
      "out_cost": 0.42
    },
    "estimated_cost": {
      "input_per_mtok": 0.28,
      "output_per_mtok": 0.42,
      "est_1k_tokens": 0.0007
    },
    "model_info": {
      "context_window": 128000,
      "expected_latency_ms": 220,
      "strengths": ["general", "code", "multilingual", "value"]
    }
  }
  ```
</ResponseExample>
