ReferenceTypeScript SDK

Tenant

client.tenant reads and updates settings for the Tenant authenticated by the client credential. It does not expose identity lookup; /v1/me is a separate JWT-oriented REST endpoint with no SDK method.

Overview

Settings contain name and nullable quota. quota: null means no configured quota. Inside a quota, a nullable token or request limit disables that measure; resetDay is required.

Methods

get()

get(): Promise<TenantSettingsResponse>GET /v1/tenant.

patch()

patch(body: UpdateTenantSettingsBody): Promise<TenantSettingsResponse>PATCH /v1/tenant. At least one of name or quota is required. Omitted fields remain unchanged; quota: null clears the complete quota configuration.

Types

TenantSettingsResponse is { name, quota }. A quota is { monthlyTokenLimit: number | null, monthlyRequestLimit: number | null, resetDay: number }, where the reset day is from 1 to 28. Tenant identity from GET /v1/me includes its ID and authentication identity but has no SDK method. See objects and schemas.

Errors

Empty patches, invalid names, non-positive limits, or invalid reset days are invalid_request. See errors.

Example

import { BlazingAgents } from "@blazing-agents/sdk";
const client = new BlazingAgents({ apiKey: process.env.BLAZING_AGENTS_API_KEY! });

const current = await client.tenant.get();
const updated = await client.tenant.patch({
  name: current.name,
  quota: {
    monthlyTokenLimit: 1_000_000,
    monthlyRequestLimit: null,
    resetDay: 1,
  },
});
console.log(updated.quota?.monthlyTokenLimit);

On this page