Skip to content

Client SDKs

AgentZero ships thin client SDKs that talk to the gateway over HTTP and WebSocket. No native compilation or FFI bindings needed — any platform that can make HTTP calls can control AgentZero.

LanguageTransportInstall
PythonHTTP + WebSocketpip install agentzero
TypeScriptHTTP + WebSocketnpm install @agentzero/client
SwiftHTTP + WebSocketSwift Package Manager
KotlinHTTP + WebSocketMaven Central

All SDKs follow the same pattern: point at a running gateway and send messages.

from agentzero import AgentZeroClient
client = AgentZeroClient("http://localhost:3000")
response = client.chat("What can you do?")
print(response.content)
import { AgentZeroClient } from "@agentzero/client";
const client = new AgentZeroClient("http://localhost:3000");
const response = await client.chat("What can you do?");
console.log(response.content);

The gateway exposes a drop-in /v1/chat/completions endpoint. Any existing OpenAI client library works out of the box — just point it at your gateway URL:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:3000/v1", api_key="unused")
response = client.chat.completions.create(
model="default",
messages=[{"role": "user", "content": "Hello!"}],
)

All SDKs support Server-Sent Events (SSE) for real-time streaming:

for chunk in client.chat_stream("Tell me a story"):
print(chunk.content, end="", flush=True)

For persistent connections, SDKs can pair with the gateway over WebSocket:

async with client.pair() as session:
response = await session.send("Hello!")
print(response.content)

The gateway ships interactive Scalar API docs at /docs. Start the gateway and visit http://localhost:3000/docs to explore all endpoints.