Skip to content

Client

The entry point. Construct once, then reach every namespace as an attribute.

superb_ai.Client

Client(*, tenant: str | None = None, api_key: str | None = None, access_token: str | None = None, base_url: str | None = None, timeout: float = _DEFAULT_TIMEOUT_S, max_retries: int = 2, transport: BaseTransport | None = None)

Synchronous client. Thread-safe for concurrent requests.

Parameters:

Name Type Description Default
tenant str | None

workspace slug (every API path is tenant-scoped); falls back to SUPERB_AI_TENANT.

None
api_key str | None

machine key (sbd_pk_…); falls back to SUPERB_AI_API_KEY.

None
access_token str | None

WorkOS JWT alternative to a key (short-lived; browser flows).

None
base_url str | None

API origin; falls back to SUPERB_AI_BASE_URL then the platform default.

None
timeout float

per-request seconds (default 60; long-poll helpers set their own).

_DEFAULT_TIMEOUT_S
max_retries int

automatic retries for 408/429/5xx/transport (default 2).

2
transport BaseTransport | None

custom httpx.BaseTransport — used by tests (ASGI/mock).

None

Debugging: set SUPERB_AI_LOG=debug (or attach handlers to the superb_ai logger) to see every request as METHOD path [request-id] -> status in Nms plus retry warnings. The bracketed id is sent as x-request-id, so the platform operator can find the same request in server logs — quote it when reporting issues.

request

request(method: str, path: str, *, params: dict[str, Any] | None = None, json: Any = None, idempotency_key: str | None = None, auto_idempotency: bool = False, timeout: float | None = None, tenant_scoped: bool = True, headers: dict[str, str] | None = None) -> httpx.Response

One API call with retries + typed errors. Resources call this; you can too for endpoints newer than this SDK (raw escape hatch).