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

# Validate BRAIN.md

> Validate a BRAIN.md config — raw text or an object — against the model catalog and schema.

<Note>
  **POST** `https://api.prysm1.com/v1/brain/validate` · No authentication required
</Note>

Validate a [BRAIN.md](/concepts/brain-md) before you ship it. Returns whether it's valid,
any blocking errors, advisory warnings, and the normalized config PRYSM's router consumes.

## Body

Provide **one** of the following:

<ParamField body="brain_md" type="string">
  Raw `BRAIN.md` text (YAML with Markdown affordances).
</ParamField>

<ParamField body="brain_config" type="object">
  An already-parsed config object (alternative to `brain_md`).
</ParamField>

## Response

<ResponseField name="valid" type="boolean">
  `true` if and only if `errors` is empty.
</ResponseField>

<ResponseField name="errors" type="string[]">
  Blocking problems: unknown locked model, unknown rule model, non-positive `max_cost`.
</ResponseField>

<ResponseField name="warnings" type="string[]">
  Advisory issues: unknown `blocked`/`fallback` model; every fallback also blocked.
</ResponseField>

<ResponseField name="normalized" type="object">
  The canonical config PRYSM's router consumes (e.g. `max_cost_per_request` normalized to
  `max_cost`, signal aliases resolved).
</ResponseField>

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

  client = Prysm()
  print(client.validate_brain(open("BRAIN.md").read()))
  ```

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

  const client = new Prysm();
  console.log(await client.validateBrain(readFileSync("BRAIN.md", "utf-8")));
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.prysm1.com/v1/brain/validate \
    -H "Content-Type: application/json" \
    -d '{"brain_md": "max_cost_per_request: 0.005\nrules:\n  - when: code\n    model: deepseek-v4-flash\n"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "valid": true,
    "errors": [],
    "warnings": [],
    "normalized": {
      "max_cost": 0.005,
      "rules": [{ "when": "code", "model": "deepseek-v4-flash" }]
    }
  }
  ```

  ```json 200 (invalid) theme={null}
  {
    "valid": false,
    "errors": ["unknown model in rule: ghost-model"],
    "warnings": [],
    "normalized": { "rules": [] }
  }
  ```
</ResponseExample>
