Cereal docs
TypeScript SDK

HTTP API and TypeScript SDK map

Which interface you are calling, what it adds, and where its contract lives.

The platform concepts are shared. The TypeScript helper signature and the HTTP request shape are separate contracts. Use this map when moving between examples.

TypeScript callHTTP relationshipAdded behavior
client.agents.upsert({ slug, definition })POST /v1/agents/upsertTyped inputs/results and errors
client.sessions.create({ agentId, initialMessage })POST /v1/sessions/createRequires an explicit agent ID
agent.sessions.start({ message })Initializes dependencies and agent, then creates a sessionSupplies agentId; translates message to initialMessage
agent.init()Provider/connection/agent upserts and supporting lookupsDerives tool configuration and learns target verification context; does not deploy code
client.sessions.stream(id)Token minting followed by GET /sessions/{id}/streamAn async iterable over one projected SSE connection; requires data scope
subscribe({ tokenSource, ... })Browser stream consumerToken renewal and automatic reconnection
agent.approvals.allow(id, toolCallId)POST /v1/sessions/decideSupplies decision: "allow"
client.me()POST /v1/auth/meDifferent namespace placement
createNodeHandler(agent)No Cereal operationAdapts incoming Node requests to Web Request/Response

agent is the return value of defineAgent. client is the return value of createCerealClient. They are not interchangeable: agent.sessions.start is not client.sessions.start, and there is no HTTP operation named sessions.start.

Find the exact contract

An operation available over HTTP may have no typed SDK wrapper. Use its documented HTTP request instead of inferring a method name. A helper may call several operations, so its scope requirements can exceed those of one read operation.

On this page