Python client
Kitaru is ZenML's sibling project for recording, replaying, and improving AI agents. The runs that happen in production become sessions you can replay against your real code. KitaruAPIClient is the async Python interface to a Kitaru server.
This page groups the client into thematic areas. For the complete, auto-generated API (every method and signature), see the full Kitaru SDK reference.
from kitaru.client import KitaruAPIClient
async with KitaruAPIClient() as client:
server = await client.info.get()The client resolves its server URL from KITARU_API_URL or the server selected by kitaru login. It resolves credentials from the worker-provided KITARU_API_TOKEN, KITARU_API_KEY, or stored login credentials. If no server URL is configured, client creation fails instead of guessing a destination.
The client exposes its functionality through resource namespaces accessed as attributes.
Sessions
client.sessions reads and writes the recordings:
list/iter/get- find sessions, with filters for agent, tag, origin, and timeget_with_nodes/list_nodes/iter_nodes- read the recorded model and tool calls, with payloadscreate/ingest_nodes- use the raw recording API that adapters build onmerge_evaluations- attach externally produced evaluation results to a sessionupdate/delete- maintain recorded or imported sessions
Replays and evaluations
client.replays- create and inspect single-session replays: baseline session, optional override, tool policy, and evaluatorsclient.evaluations- batch-evaluate stored sessions and read evaluation rows back
Cohorts and experiments
client.cohorts/client.cohort_versions- freeze immutable populations of sessionsclient.experiments- name a change and start it against a cohort versionclient.experiment_runs- inspect a run, its child jobs, and its cancellation state
Registry
client.agents/client.agent_versions- the agents sessions belong to, and the run commands replay executesclient.evaluators/client.importers- versioned plugins registered from a script or packageclient.imports- import Langfuse, LangSmith, Braintrust, Logfire, or Kitaru JSONL traces as sessions
Review
client.investigations/client.annotations- structure human review as questions, evidence-linked answers, and session verdicts
Execution and operations
client.session_runs- submit a registered agent version as a jobclient.workers/client.jobs/client.tasks- register workers and inspect, cancel, or recover queued workclient.tags- group sessions, versions, cohorts, and experimentsclient.blobs/client.secrets- store plugin source and runtime credentials
Authentication
client.auth/client.devices- authenticate interactive clientsclient.api_keys/client.service_accounts- issue and rotate process credentialsclient.accounts/client.users- inspect accounts and their users
For complete signatures and the full method list, see the Python SDK reference. For the command-line equivalents, see the Kitaru CLI reference. For the TypeScript client, see How to use the SDK.
Last updated
Was this helpful?