Build an Agent from a URL in 5 Minutes
This quickstart takes you from zero to an embedded, grounded chat agent built from a creator’s YouTube or Instagram channel. The flow:1
Create an org + API key
Get a
brs_live_ key with the agents:write scope.2
Provision from a URL
Your backend
POSTs to /v1/agents:from-url → 202 with a buildId.3
Stream progress
Your backend consumes the SSE stream and relays progress to the browser.
4
Chat
On
ready, the browser chats directly with the agent’s public slug.1. Create an org + API key
API keys are organization-scoped — all provisioned agents and their cost bill to that org. Create (or pick) a Brainstormer org, then mint an API key with theagents:write scope (chat needs chat, which is a default scope).
Set the key in your backend environment — never in client code:
2. Provision from a URL
Your backend submits the build. The request returns immediately (202) — it does
not block while the agent is built.
Backend — submit build
status is already ready (a handle-dedup cache hit), skip straight to
step 4 with build.agentSlug.
3. Stream progress (and relay to the browser)
The SSE stream requires theAuthorization header, so it must be consumed
server-side (the browser’s EventSource can’t send headers). Your backend reads
the stream and relays each event to the browser over your own SSE/WebSocket.
Backend — consume + relay
eventsource-package variant, and reconnect via
Last-Event-ID.
Pattern A: backend proxy (Next.js)
A complete reference: a Next.js Route Handler that holds the key and streams a relay to the browser. The browser opens anEventSource against your route,
never against Brainstormer.
app/api/build/route.ts (Next.js Route Handler)
Browser — talk only to YOUR backend
4. Chat from the browser
Once you haveagentSlug, the browser chats directly — no key, no proxy.
Generate a UUID anonymousId per visitor and seed the UI with the
starterQuestions from the ready event.
Browser — chat
Next steps
Authentication & rate limits
Scopes, Turnstile, 429 / Retry-After, idempotency.
Build lifecycle
The FSM, preview vs. full ingestion, dedup, and preview TTL.
from-url reference
Every request/response field and status code.
SSE reference
Wire format, ProvisioningEvent, error codes.

