Authentication & Rate Limits
The Agent Provisioning API has two trust zones:API keys & scopes
brs_live_ keys are organization-scoped — the consumer brings its own
Brainstormer org + key, and all provisioned agents and their cost bill to that
org. Pass the key as a bearer token:
agents:write.
A key missing the required scope is rejected by the gateway:
403 — missing scope
/developer → pick an application → Generate Key). New keys default to
chat and kb:read; tick agents:write to allow provisioning. A key’s
granted scopes are listed alongside it in the key table.
No secrets in the browser (READ FIRST)
The only supported v1 integration is Pattern A — client backend proxy:A publishable, origin-scoped browser session token (Pattern B) for
backend-less consumers is deferred — not in v1.
Cloudflare Turnstile (bot protection)
from-url accepts a Cloudflare Turnstile token, verified server-side. When the
platform is configured with a TURNSTILE_SECRET_KEY, the token is required.
- Render the Turnstile widget in the browser; obtain a token per submit.
- Relay the token to your backend.
- Include it as
turnstileTokenon thefrom-urlrequest body.
400 turnstile_failed synchronously. (A
later bot-check rejection inside the build surfaces as a failed event with
error code turnstile_failed.)
Rate limits — 429 + Retry-After
from-url is rate-limited on two axes:
Over-limit requests return
429 with a Retry-After header (in
seconds). Back off and retry after that delay.
Backend — honor Retry-After
failed event with error code rate_limited (retryable: true).
Idempotency
Send anIdempotency-Key header (a UUID you generate) on from-url so a
double-submit — a retried network request, a double-clicked button — returns the
same build instead of spawning a second one.
ready instantly), repeat submits are
safe, fast, and free. See Build lifecycle.
Error reference
For the in-build error model (
plan_limit, insufficient_credits,
scrape_failed, …) with retryable semantics, see the
ProvisioningErrorCode table.
