Protocols and contracts

Protocols and contracts

Look up the objects, errors, streams, IDs, pagination, and limits that every SDK method and endpoint shares.

Some rules apply to every endpoint: how errors look, how streams end, how to page through a list, what an ID means, and how large a request can be. These pages collect those rules in one place. Each SDK and REST page covers its own operation and links here for the shared parts.

Examples

Streaming a completion follows the streaming protocol and reports failures through the error contract:

const result = await client.completion({ agentId, prompt: "Summarize this." });

for await (const delta of result.textStream) {
  process.stdout.write(delta);
}

Listing sessions over REST uses IDs, pagination, objects, errors, and limits together:

curl "$BLAZING_AGENTS_BASE_URL/v1/agents/$AGENT_ID/sessions?limit=50" \
  -H "Authorization: Bearer $BLAZING_AGENTS_API_KEY"

Next

On this page