Runtime Client

Switch between Python and TypeScript code examples using the language tabs.
The ZabyRuntime client is for interacting with deployed agents at runtime. Unlike Zaby, it uses a JWT token for authentication rather than an API key. See Runtime Tokens for generating a JWT from zaby.runtime_tokens.create().
For non-production environments, use configureZaby() to set the API origin before creating ZabyRuntime:

Create a Runtime Token

Generate a JWT from zaby.runtime_tokens.create() or zaby.runtimeTokens.create()

Agents Client

Create, publish, and deploy agents.

Start a run

input
string
required
The user’s message to the agent
requestId
string
Idempotency key for safe retries — use a unique value per request
runId
string
Unique run identifier
status
string
Run status: "COMPLETED", "FAILED", or "PENDING"
finalOutput
string
Agent’s final response text (present when status is COMPLETED)

Stream agent responses

Stream real-time agent output via Server-Sent Events.

Event types

SseEvent fields

event
string
Event type identifier
data
any
Parsed JSON payload
id
string
Optional event ID for tracking

Retrieve events

Fetch stored events for a completed run:
limit
number
Maximum events to return (default: 50)

Approvals

Respond to approval requests during a run:

Feedback

rating
number
required
Rating score from 1 to 5
comment
string
Optional free-text feedback

Complete example

Requires the full agent lifecycle: create agent → publish → deploy → bind external app → create quota policy → generate runtime token.

Agents & Provisioning

Full agent lifecycle reference.

Testing

Mock SSE streaming with MockTransport.