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

# BRAIN.md Sharing

> Share your BRAIN.md routing config via a short public URL — viral community sharing for the declarative governance standard.

<Note>
  **POST /v1/brain/share** requires a Bearer token. **GET /v1/b/\{id}** is public — no key needed.
</Note>

A shared BRAIN.md is a living snapshot of your routing config: model preference, cost ceiling,
signal-based rules, blocked models. Share it in a blog post, Discord message, or README badge —
anyone (including other agents) can fetch it without an API key. Invalid configs are shareable
too, so the community can help you debug.

***

## POST /v1/brain/share

Create a shareable link for a BRAIN.md config.

<Note>
  **POST** `https://api.prysm1.com/v1/brain/share` · Auth required
</Note>

### Request Body

<ParamField body="brain_md" type="string">
  Raw BRAIN.md text to share. Accepts the same YAML format as `/v1/brain/validate`.
</ParamField>

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

<ParamField body="title" type="string">
  Optional human-readable label shown on the share page (max 120 chars).
</ParamField>

### Response

<ResponseField name="object" type="string">`brain.share`</ResponseField>
<ResponseField name="share_id" type="string">Unique ID for this share (`prysm1.com/b/{share_id}`).</ResponseField>
<ResponseField name="url" type="string">Full API URL to retrieve the config: `https://api.prysm1.com/v1/b/{share_id}`.</ResponseField>
<ResponseField name="short_url" type="string">Marketing short URL: `https://prysm1.com/b/{share_id}`.</ResponseField>
<ResponseField name="title" type="string | null">Echoed title, or null if not provided.</ResponseField>
<ResponseField name="config" type="object">Normalized config object (the canonical form, regardless of which input format was used).</ResponseField>
<ResponseField name="valid" type="boolean">Whether the config passed validation.</ResponseField>
<ResponseField name="errors" type="string[]">Validation errors (empty if valid).</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.prysm1.com/v1/brain/share \
    -H "Authorization: Bearer prysm_sk_..." \
    -H "Content-Type: application/json" \
    -d '{
      "brain_md": "model: deepseek-v3.2\nmax_cost_per_request: 0.05\n",
      "title": "My cost-safe dev config"
    }'
  ```

  ```python Python theme={null}
  import prysm

  share = prysm.brain.share(
      brain_md="model: deepseek-v3.2\nmax_cost_per_request: 0.05\n",
      title="My cost-safe dev config",
  )
  print(share["short_url"])   # https://prysm1.com/b/abc123def456
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "brain.share",
    "share_id": "abc123def456",
    "url": "https://api.prysm1.com/v1/b/abc123def456",
    "short_url": "https://prysm1.com/b/abc123def456",
    "title": "My cost-safe dev config",
    "config": {
      "model": "deepseek-v3.2",
      "max_cost_per_request": 0.05
    },
    "valid": true,
    "errors": []
  }
  ```
</ResponseExample>

***

## GET /v1/b/{share_id}

Retrieve a shared BRAIN.md config by its short ID. **No API key required.**

<Note>
  **GET** `https://api.prysm1.com/v1/b/{share_id}` · Public
</Note>

<ParamField path="share_id" type="string" required>
  The short ID returned by `POST /v1/brain/share`.
</ParamField>

### Response

<ResponseField name="object" type="string">`brain.share`</ResponseField>
<ResponseField name="share_id" type="string">The share ID.</ResponseField>
<ResponseField name="title" type="string | null">Label set by the sharer.</ResponseField>
<ResponseField name="config" type="object">Normalized BRAIN.md config.</ResponseField>
<ResponseField name="brain_md" type="string | null">Original BRAIN.md text (if shared as text).</ResponseField>
<ResponseField name="created_at" type="number">Unix timestamp of when the share was created.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.prysm1.com/v1/b/abc123def456
  ```

  ```python Python theme={null}
  import httpx

  share = httpx.get("https://api.prysm1.com/v1/b/abc123def456").json()
  print(share["config"]["model"])   # deepseek-v3.2
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "brain.share",
    "share_id": "abc123def456",
    "title": "My cost-safe dev config",
    "config": {
      "model": "deepseek-v3.2",
      "max_cost_per_request": 0.05
    },
    "brain_md": "model: deepseek-v3.2\nmax_cost_per_request: 0.05\n",
    "created_at": 1750017000.0
  }
  ```

  ```json 404 theme={null}
  {"error": "share_not_found", "message": "No shared BRAIN.md with id 'abc123def456'."}
  ```
</ResponseExample>

***

## GET /v1/brain/shares

List BRAIN.md configs you have shared, newest first.

<Note>
  **GET** `https://api.prysm1.com/v1/brain/shares` · Auth required
</Note>

Returns `{object: "list", data: [{share_id, title, config, url, short_url, created_at}...]}`.

***

## GET /v1/brain/badge

Generate an SVG badge for embedding in a README or docs page.

<Note>
  **GET** `https://api.prysm1.com/v1/brain/badge` · Public · Cacheable 1h
</Note>

<ParamField query="model" type="string">
  A PRYSM model ID (e.g. `deepseek-v3.2`). The badge value becomes the model's display name,
  colored by tier: budget=green, mid=amber, premium=indigo, frontier=violet.
</ParamField>

<ParamField query="label" type="string">
  Override the left label. Default: `BRAIN.md`.
</ParamField>

Embed in your README:

```markdown theme={null}
[![BRAIN.md](https://api.prysm1.com/v1/brain/badge?model=deepseek-v3.2)](https://prysm1.com/b/YOUR_SHARE_ID)
```

The badge links to your shared config so any developer (or agent) can inspect your routing rules.
