zoowork
Official Python SDK for the ZooWork Managed Agents API. Developer Preview.
The client is asynchronous, typed, and built on httpx. Request and response fields retain the public API's wire spelling, while methods use Python snake_case.
pip install zoowork
Quickstart
Create an organization API key (zct_...) in ZooWork under Settings → API Keys and keep it on your server. It authenticates as the organization, not as one end user.
import asyncio
import os
from zoowork import assistant_text, create_zoowork_client, is_run_finished
async def main() -> None:
async with create_zoowork_client(os.environ["ZOOWORK_API_KEY"]) as client:
models = await client.list_models()
agent = await client.create_agent(
{"name": "research-agent", "model": {"primary": models[0]["model"]}}
)
agent_id = agent["agent_id"]
await client.start_agent(agent_id)
await client.wait_until_running(agent_id)
session = await client.create_session(
agent_id,
{"initial_events": [{"type": "user.message", "content": "What can you do?"}]},
)
async for event in client.stream_events(agent_id, session["session_id"]):
print(assistant_text(event), end="", flush=True)
if is_run_finished(event):
break
asyncio.run(main())
Set ZOOWORK_API_KEY and call create_zoowork_client() with no argument if you prefer. The client uses the production API by default; ZOOWORK_BASE_URL or base_url= selects another deployment.
Pagination
list_agents() returns one AgentPage. Iterate the page to continue lazily through every remaining page while retaining the original filters:
page = await client.list_agents(labels={"project": "research"})
print(page.data, page.total, page.next_page)
async for agent in page:
print(agent["agent_id"])
Use await page.get_next_page() for manual navigation or client.iter_agents() when you do not need the first page's metadata.
Durable events
The event stream is session-scoped and does not close when one turn ends. Break on is_run_finished(event). Save event.cursor after consuming an event and pass it back as cursor= when reconnecting.
async for event in client.stream_events(agent_id, session_id, cursor=last_cursor):
if event.cursor is not None:
last_cursor = event.cursor
if is_run_finished(event):
break
list_events() reads one durable page. list_all_events() follows cursor pagination, with a safe fallback for older deployments.
API surface
The runtime client follows the TypeScript SDK's public capabilities:
- agents, lifecycle, models and paginated listing;
- channels and guided Feishu/WeCom/WeChat setup;
- skill upload, versioning and agent attachment;
- sessions, events and SSE streaming;
- approvals, artifacts and system prompts;
- schedules, wake and sandbox exec;
- Environments and immutable Environment versions.
Methods return dictionaries containing the API response unchanged unless the SDK must normalize pagination or events. Unknown fields are intentionally preserved.
Errors
Every non-successful response raises ZooworkError. Match error.type or error.status, never the human-readable message. Diagnostic fields include content_type, body_snippet, cf_ray, request_id, and retryable.
Development
python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'
python -m pytest
python -m ruff check .
python -m mypy src
python -m build
python -m twine check dist/*
Unit tests are offline. The live staging procedure is documented in e2e/README.md and is never run by CI.
Metadata
Release files for zoowork 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zoowork-0.1.0.tar.gz | 18.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zoowork-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / zoowork-0.1.0.tar.gz
| Download URL | zoowork-0.1.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd1307b2de0345b29890323aae754ef514fc1a03c5bc00b42a51ee2648c1ee89
|
|
BLAKE2b-256 checksum How to use checksums |
032150a453f7e7e836c205ead8962849f9f8ff1883697027b493203d80daa631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / zoowork-0.1.0-py3-none-any.whl
| Download URL | zoowork-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af4954e0d1ac15f48a4afca3310958071c867ea7c7b9c1dc42975a47ceabaefa
|
|
BLAKE2b-256 checksum How to use checksums |
e8f16267916f9afbd44544d072aae1bebe772ab7f2738a0eeea194940d2cf5ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency log