sk_ws_...). Base: https://brain.syvon.ai.
This surface serves the frozen published release for an agent: the canonical public copy. An unpublished agent returns defaults and empty lists rather than an error. The exception is the agent lookup itself, which returns 404 when the id is unknown or outside the key’s workspace.
agentId throughout is a Project id in the key’s workspace. Slugs are not accepted here; resolve slug to id upstream.
brain.whoami() → WhoAmI
GET /v1/agent/_whoami — smoke test. Confirms the key resolves to a workspace.
brain.getAgent(agentId) → AgentMetadata
GET /v1/agent/:agentId.
brain.getWrapConfig(agentId) → Record<string, unknown>
GET /v1/agent/:agentId/wrap — the published presentation config (layout, greeting, theme). Unpublished agents return neutral defaults. The parser never throws.
brain.getSiteConfig(agentId) → Record<string, unknown>
GET /v1/agent/:agentId/site — the published brand-site config (sitemap, nav, sections). An empty pages array means “no site published”.
brain.getFiles(agentId) → AgentFileEntry[]
GET /v1/agent/:agentId/files — the frozen workspace file index. Empty for releases that predate indexing.
brain.getItems(agentId) → AgentItem[]
GET /v1/agent/:agentId/items — the agent’s active items.
brain.getSuggestions(agentId) → unknown
GET /v1/agent/:agentId/suggestions — workflow starter suggestions. The shape is workflow-defined, so it is typed unknown intentionally.
brain.getFeed(agentId, query?) → FeedPost[]
GET /v1/agent/:agentId/feed?channel=&category= — published posts (non-empty channels, not expired). Up to 120, newest first.
Keys on this surface are agent-scoped (relative to the project’s storage prefix), unlike the portal file index which is workspace-relative. Stream them through the R2 proxy below.
brain.streamR2File(workspaceRelativeKey) → Response
GET /v1/r2/:path — stream a raw workspace R2 object as a fetch Response. Pipe response.body; do not buffer large objects in memory.
Only allowlisted prefixes are reachable (projects/, workflows/, config/, assets/, meta/, wrapper/, …); others return 403. The key is workspace-relative.
brain.getR2Bytes(key) → Uint8Array
Convenience: buffer the whole object. Small files only.
brain.getR2Text(key) → string
Convenience: read an R2 text or JSON file as a string.
brain.chat(agentId, request) → AsyncIterable<ChatStreamEvent>
POST /v1/agent/:agentId/chat — the public chat stream (NDJSON). Yields one event per line; assemble the reply from event.text.
client is supplied (a salted hash your app mints; never a raw IP). Without it, the whole workspace shares a looser backstop. Rate-limited turns return 429.