Python SDK

Tenant

Read and change your tenant's name and monthly usage quota with the Python SDK.

client.tenant reads and changes settings for the tenant your API key belongs to: its display name and an optional monthly quota. A quota is a safety ceiling you set so a bug or runaway agent cannot use unlimited tokens or requests.

The methods take no tenant ID; the API key selects the tenant. API keys themselves are managed in the dashboard, not through the SDK.

Examples assume client = BlazingAgents(). Every method also accepts extra_headers and timeout. On AsyncBlazingAgents, await the same method names.

settings = client.tenant.update(
    quota={
        "monthly_token_limit": 5_000_000,
        "monthly_request_limit": None,
        "reset_day": 1,
    }
)
print(settings.name, settings.quota)

Available operations

MethodDescriptionReturns
get()Get the tenant's settingsTenantSettings
update()Change the name or quotaTenantSettings

Methods

get()

Gets your tenant's settings.

settings = client.tenant.get()
if settings.quota is None:
    print("No quota set")

Signature: get() -> TenantSettings

Returns TenantSettings. Only the standard authentication and service errors apply.

update()

Changes the tenant's display name, its quota, or both.

settings = client.tenant.update(name="Acme Support")
settings = client.tenant.update(quota=None)

Signature: update(*, name=..., quota=...) -> TenantSettings

ParameterTypeDescription
namestr1 to 80 characters, not blank
quotaQuotaUpdate | NoneThe complete new quota, or None to remove it

Omitted parameters keep their current value. Calling update() with neither raises ValueError before any request. A quota replaces the old one and must have exactly these three keys, or the SDK raises TypeError:

KeyTypeMeaning
monthly_token_limitint | NoneTokens allowed per month; None means no token limit
monthly_request_limitint | NoneTurns allowed per month; None means no request limit
reset_dayintDay of the month the count resets, 1 to 28

Returns TenantSettings. Raises APIStatusError with validation_failed for a bad name, a limit that is not positive, or an invalid reset day.

How quotas apply

Blazing Agents checks usage in the current quota period before each turn starts. When a limit is reached, new turns fail with quota_exceeded, and task runs end as "blocked" instead of "failed". A turn that is already running is never cut off, so usage can go past a limit, especially with turns running at the same time. With no quota, or a limit set to None, that measure is unlimited.

A quota is your own safety setting. It is not a plan limit, credit balance, or bill.

Response model

TenantSettings has name: str and quota: Quota | None. Quota has monthly_token_limit, monthly_request_limit, and reset_day.

Next

On this page