Runbook Studio
API

Two on-ramps. One credit wallet.

Ounie accounts hit the REST endpoints with a bearer token. AI assistants — including the Ounie AI Team — connect over MCP and get a native tool surface. Both run the same generation pipeline, and every call draws your shared Ounie credits (1 credit = 1¢), never overdrawing. Generating a runbook is grounded in your own private brain, so it needs a credential we can forward to ounie.com — a session or your ounie_live_ master key.

Authentication · two keys, one wallet
Send Authorization: Bearer <key> on any endpoint (or append ?api_key=<key>when your client can't set headers). Cookie sessions work too — it's the same route.
sop_live_… — this app's key

Minted on Dashboard → API keys. Reads everything — list, get, export, start runs, verify, balance. It has no ounie.com credential, so it can't reach your brains: a generate/regenerate call returns a clear 403 telling you to use your master key.

ounie_live_… — the fleet master key

Your ounie.com developer key. Enable fleet access on ounie.com, and it works across every Ounie app. Because ounie.com accepts it, Runbook Studio forwards it upstream to retrieve and cite your private brain — this is the key that grounds generation. Draws the same wallet.

MCP · for AI assistants and the Ounie AI Team
Streamable HTTP at /api/mcp (legacy SSE at /api/sse). Auth with a sop_live_… key from your dashboard, or the Ounie fleet master key ounie_live_….
Endpoint  https://sops.ounie.com/api/mcp
Header    Authorization: Bearer sop_live_…

# If your MCP client can't set headers, append the key as a query param:
https://sops.ounie.com/api/mcp?api_key=sop_live_…
ToolWhat it doesCost
list_sopsList your generated SOPs / runbooks (newest first).free
get_sopOne SOP with its full step list (detail, role, checklist, citations).free
generate_sopGenerate a runbook grounded in your brain(s). Master key only.5 credits
regenerate_sopRe-compose an SOP's steps from fresh retrieval. Master key only.5 credits
export_sopExport a finished SOP as CSV text (DOCX via REST).free
start_runStart an execution run — snapshots the steps into a checklist.free
verify_sopMark an SOP reviewed now; resets its review clock.free
get_credit_balanceSpendable Ounie credits + monthly included.free
get_pricingPer-action pricing + review intervals. No auth required.public
whoamiThe authenticated key's owner + key id.free
Connect the Ounie AI Team (TabTab)
Its HTTP MCP entries can't set headers, so the key rides the URL as ?api_key=. Use your ounie_live_… master key so it can generate grounded runbooks from your brain.
{
  "mcpServers": {
    "runbook-studio": {
      "url": "https://sops.ounie.com/api/mcp?api_key=ounie_live_…"
    }
  }
}
REST · the same endpoints the dashboard uses
Send Authorization: Bearer <key> (or ?api_key=) on any of these.
GET/api/brainsList your Ounie brains

Master key (or session). The brain_ids you pass to generate come from here.

POST/api/sopsGenerate an SOP
{ "title": "Onboard a new engineer",
  "scope": "for the platform team",
  "brain_ids": ["…"] }

Bills 5 credits. Grounded + cited from your brains — needs a session or the ounie_live_ master key. Thin material refunds in full.

GET/api/sopsList your SOPs

Free.

GET/api/sops/{id}SOP + steps + runs

Free.

PATCH/api/sops/{id}Edit metadata
{ "title": "…", "review_interval_days": 90 }

Free — editing paid work is free.

DELETE/api/sops/{id}Delete an SOP

Free. Cascades steps + runs.

POST/api/sops/{id}/regenerateRe-compose the steps
{ "scope": "optional new scope" }

Bills 5 credits. Master key. Historical runs preserved.

POST/api/sops/{id}/verifyMark reviewed now

Free. Resets the 'last verified' clock.

GET/api/sops/{id}/export?format=csv|docxDownload

Free. CSV for a spreadsheet; DOCX for an operations-manual document.

POST/api/sops/{id}/runsStart an execution run
{ "label": "Q3 onboarding" }

Free. Snapshots the current steps into a checklist.

PATCH/api/sops/{id}/runs/{runId}Toggle a step / set run status
{ "run_step_id": "…", "checked": true }

Free. Or { "status": "completed" }.

PATCH/api/sops/{id}/steps/{stepId}Edit one step
{ "detail": "…", "checklist": ["…"] }

Free.

Shape of a generated SOP
// POST /api/sops →
{ "ok": true, "sop_id": "…", "steps": 9,
  "grounded": true, "credits_spent": 5 }

// GET /api/sops/{id} → { sop, steps, runs }
//   steps[]: { position, title, detail, role, checklist[],
//     citations: [ { brainId, slug, title } ] }  // grounded

// 402 when the wallet can't cover it:
{ "error": "insufficient_credits", "required_credits": 5,
  "balance_credits": 1, "buy_credits_url": "https://ounie.com/dashboard/settings" }
No x402 / keyless rail
Runbook Studio has no pay-per-call x402 endpoint. Generating a runbook is grounded in your own private Ounie brain, which requires an authenticated, brain-scoped identity — there is nothing an anonymous keyless caller could ground against. Agent access is API keys / MCP, billed in Ounie credits.