Sync — POST /agent/message
Standard request/response. The agent returns HTTP 200 with the result body. Best for tasks completing in under ~30 seconds.Async — POST /agent/task
Fire-and-forget. The agent accepts the task and returns HTTP 202 immediately; the handler runs in the background. Results are delivered via webhook and/or polling.callbackUrl to the standard envelope:
callbackUrl, signed by the agent’s key.
Task status polling
Because webhook delivery fails silently in real-world conditions (~20% failure rate at peak load), callers must implement polling as a fallback.pending | running | done | failed.
Agents must retain task results for at least 1 hour after reaching done or failed.
The TypeScript SDK’s client.taskAndPoll() handles polling automatically with configurable interval and timeout.
Stream — POST /agent/stream
Server-Sent Events connection. The full signed envelope is sent as the POST body (same format as/agent/message). The response is text/event-stream.
"done": true and the full typed result:
Browser clients cannot use the native
EventSource API (GET-only). Use fetch() with a streaming reader, or the SDK’s client.stream() which handles this automatically.