KaizenClient
Core async HTTP client that powers every SDK call.
Configuration
| Option | Type | Default | Description | |
|---|---|---|---|---|
base_url | str | https://api.getkaizen.io/ | Point to SaaS, staging, or self-hosted deployments. | |
api_key | `str | None` | KAIZEN_API_KEY env var | Bearer token sent as Authorization: Bearer .... |
timeout | float | 30.0 | HTTPX request timeout in seconds. | |
verify_ssl | bool | True | Disable only when using custom CA bundles. | |
default_headers | dict[str, str] | {} | Inject headers such as X-Request-ID. |
Usage
Lifecycle helpers
KaizenClient.from_env()instantiates a client with env-derived config.with_kaizen_client()decorator (seepython/kaizen_client/decorators.py) auto-creates and closes the client for each function invocation.
Notes
- The client is async; wrap synchronous environments with
asyncio.run()or convert methods usingasyncio.to_thread. - Close the client (
await client.close()) when you are done to release sockets if you don’t use the context manager. - All high-level methods eventually call
httpx.AsyncClient.requestand raiseKaizenAPIErroron non-2xx responses.