Provision Agent from URL
Kick off an asynchronous build that turns a creator’s channel URL (YouTube or Instagram) into a published, chat-ready agent. The request returns immediately with202 Accepted and a buildId; you observe progress over
Server-Sent Events, a
polling snapshot, or an optional
webhook. Once the build reaches ready,
visitors chat with the agent over the
anonymous chat endpoints.
Authentication
The key is organization-scoped; all provisioned agents and their cost bill
to that org. The required scope is
agents:write. A key missing the scope
returns 403 insufficient_scope. See
Authentication & rate limits.
Request Body
string
required
A YouTube or Instagram channel URL (e.g.
https://youtube.com/@channel or
https://instagram.com/handle). Normalized and platform-detected server-side.
An unsupported platform returns 400 unsupported_url.string
A Cloudflare Turnstile token, verified server-side. Required when the
platform has
TURNSTILE_SECRET_KEY configured. A missing or invalid token
returns 400 turnstile_failed.string
default:"preview"
Ingestion mode.
preview(default) — bounded demo ingestion (~8 most-recent items, transcripts-only). Indexing finishes in seconds to about a minute.full— full ingestion (deferred to a real signup; preview is the recommended path for landing-page / demo flows).
string
Optional agent intent (e.g.
creator). Drives the default tool set selected
for the agent.string
Optional OpenRouter model id (e.g.
openai/gpt-4o-mini). Defaults to the
platform default model when omitted.object
Optional delivery preferences.
Response — 202 Accepted
string
Build identifier (
bld_…). Use it to construct the stream and poll URLs.string
queued for a fresh build, or ready immediately on a cache / handle-dedup
hit (a fresh existing published agent for the same normalized handle is
reused).string
Present only when
status is ready — the public slug to chat with.string
Relative SSE URL:
/v1/agents/builds/bld_…/events.string
Relative snapshot URL:
/v1/agents/builds/bld_….Request / Response Examples
Behaviors
- Turnstile is verified server-side; supply a fresh token per submit.
- URL normalization + platform detection —
youtube/instagram/unsupported. Unsupported platforms return400 unsupported_url. - Handle dedup — a fresh existing published agent for the same normalized
handle is reused and returned as
readyinstantly, with no new build and no new cost. - Idempotency — supplying
Idempotency-Keymakes a double-submit return the same build instead of spawning a second one. - Pre-flight failures (plan limit, insufficient credits) come back as a
failedbuild event — observed over SSE / poll / webhook — not as a synchronous HTTP error on this request.
HTTP Status Codes
Build Status & Error Model
The build progresses through a finite state machine. The completeProvisioningStatus and ProvisioningErrorCode enums — with retryable
semantics — are documented in the
SSE reference
and explained as concepts in
Build lifecycle.
