Class: AIGatewayUsageLimitsClient
Defined in: src/ai-gateway/usage-limits-client.ts:36
Workspace-scoped usageLimits operations on the SCM data plane.
Example
`const client = new AIGatewayClient().usageLimits;`
Constructors
Constructor
new AIGatewayUsageLimitsClient(options): AIGatewayUsageLimitsClient;
Defined in: src/ai-gateway/usage-limits-client.ts:37
Parameters
| Parameter | Type |
|---|---|
options | AIGatewaySubClientOptions |
Returns
AIGatewayUsageLimitsClient
Methods
list()
list(opts?): Promise<{
[key: string]: unknown;
object?: string;
data?: {
[key: string]: unknown;
id: string;
name?: string | null;
conditions?: {
[key: string]: unknown;
key: string;
value: string | string[];
excludes?: string | string[];
}[];
group_by?: {
[key: string]: unknown;
key: string;
}[];
type: string;
credit_limit?: number;
alert_threshold?: number | null;
periodic_reset?: string | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
last_reset_at?: string | null;
status: string;
workspace_id: string;
organisation_id: string;
created_at: string;
last_updated_at: string;
value_key_usage_map?: {
[key: string]: {
[key: string]: unknown;
current_usage?: number;
status?: string;
is_threshold_alerts_sent?: boolean;
is_exhausted_alerts_sent?: boolean;
};
};
}[];
total?: number;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:43
List Usage Limits Policies. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
opts | { workspace_id?: string; status?: string; type?: string; page_size?: number; current_page?: number; } |
opts.workspace_id? | string |
opts.status? | string |
opts.type? | string |
opts.page_size? | number |
opts.current_page? | number |
Returns
Promise<{
[key: string]: unknown;
object?: string;
data?: {
[key: string]: unknown;
id: string;
name?: string | null;
conditions?: {
[key: string]: unknown;
key: string;
value: string | string[];
excludes?: string | string[];
}[];
group_by?: {
[key: string]: unknown;
key: string;
}[];
type: string;
credit_limit?: number;
alert_threshold?: number | null;
periodic_reset?: string | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
last_reset_at?: string | null;
status: string;
workspace_id: string;
organisation_id: string;
created_at: string;
last_updated_at: string;
value_key_usage_map?: {
[key: string]: {
[key: string]: unknown;
current_usage?: number;
status?: string;
is_threshold_alerts_sent?: boolean;
is_exhausted_alerts_sent?: boolean;
};
};
}[];
total?: number;
}>
Example
`await gw.usageLimits.list({});`
create()
create(body): Promise<{
[key: string]: unknown;
id?: string;
object?: string;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:61
Create Usage Limits Policy. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
body | { name?: string; conditions: { key: string; value: string | string[]; excludes?: string | string[]; }[]; group_by: { key: string; }[]; type: string; credit_limit: number; alert_threshold?: number | null; periodic_reset?: string | null; workspace_id?: string; organisation_id?: string; } |
body.name? | string |
body.conditions | { key: string; value: string | string[]; excludes?: string | string[]; }[] |
body.group_by | { key: string; }[] |
body.type | string |
body.credit_limit | number |
body.alert_threshold? | number | null |
body.periodic_reset? | string | null |
body.workspace_id? | string |
body.organisation_id? | string |
Returns
Promise<{
[key: string]: unknown;
id?: string;
object?: string;
}>
Example
`await gw.usageLimits.create(body);`
get()
get(policyUsageLimitsId, opts?): Promise<{
[key: string]: unknown;
id: string;
name?: string | null;
conditions?: {
[key: string]: unknown;
key: string;
value: string | string[];
excludes?: string | string[];
}[];
group_by?: {
[key: string]: unknown;
key: string;
}[];
type: string;
credit_limit?: number;
alert_threshold?: number | null;
periodic_reset?: string | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
last_reset_at?: string | null;
status: string;
workspace_id: string;
organisation_id: string;
created_at: string;
last_updated_at: string;
value_key_usage_map?: {
[key: string]: {
[key: string]: unknown;
current_usage?: number;
status?: string;
is_threshold_alerts_sent?: boolean;
is_exhausted_alerts_sent?: boolean;
};
};
} & {
[key: string]: unknown;
object?: string;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:80
Get Usage Limits Policy. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
policyUsageLimitsId | string |
opts | { status?: string; include_usage?: boolean; } |
opts.status? | string |
opts.include_usage? | boolean |
Returns
Promise<{
[key: string]: unknown;
id: string;
name?: string | null;
conditions?: {
[key: string]: unknown;
key: string;
value: string | string[];
excludes?: string | string[];
}[];
group_by?: {
[key: string]: unknown;
key: string;
}[];
type: string;
credit_limit?: number;
alert_threshold?: number | null;
periodic_reset?: string | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
last_reset_at?: string | null;
status: string;
workspace_id: string;
organisation_id: string;
created_at: string;
last_updated_at: string;
value_key_usage_map?: {
[key: string]: {
[key: string]: unknown;
current_usage?: number;
status?: string;
is_threshold_alerts_sent?: boolean;
is_exhausted_alerts_sent?: boolean;
};
};
} & {
[key: string]: unknown;
object?: string;
}>
Example
`await gw.usageLimits.get('resource-id', {});`
update()
update(policyUsageLimitsId, body): Promise<{
[key: string]: unknown;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:100
Update Usage Limits Policy. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
policyUsageLimitsId | string |
body | { name?: string; description?: string | null; conditions?: { key: string; value: string | string[]; excludes?: string | string[]; }[]; credit_limit?: number; alert_threshold?: number | null; periodic_reset?: string | null; periodic_reset_days?: number | null; next_usage_reset_at?: string | null; reset_usage_for_value?: string; } |
body.name? | string |
body.description? | string | null |
body.conditions? | { key: string; value: string | string[]; excludes?: string | string[]; }[] |
body.credit_limit? | number |
body.alert_threshold? | number | null |
body.periodic_reset? | string | null |
body.periodic_reset_days? | number | null |
body.next_usage_reset_at? | string | null |
body.reset_usage_for_value? | string |
Returns
Promise<{
[key: string]: unknown;
}>
Example
`await gw.usageLimits.update('resource-id', body);`
delete()
delete(policyUsageLimitsId): Promise<{
[key: string]: unknown;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:121
Delete Usage Limits Policy. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
policyUsageLimitsId | string |
Returns
Promise<{
[key: string]: unknown;
}>
Example
`await gw.usageLimits.delete('resource-id');`
listEntities()
listEntities(policyUsageLimitsId, opts?): Promise<{
[key: string]: unknown;
object?: string;
data?: {
[key: string]: unknown;
id?: string;
value_key?: string;
current_usage?: number;
}[];
total?: number;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:137
List Usage Limits Policy Entities. Verified on an isolated SCM fixture, 2026-09-06.
Parameters
| Parameter | Type |
|---|---|
policyUsageLimitsId | string |
opts | { status?: string; search?: string; page_size?: number; current_page?: number; } |
opts.status? | string |
opts.search? | string |
opts.page_size? | number |
opts.current_page? | number |
Returns
Promise<{
[key: string]: unknown;
object?: string;
data?: {
[key: string]: unknown;
id?: string;
value_key?: string;
current_usage?: number;
}[];
total?: number;
}>
Example
`await gw.usageLimits.listEntities('resource-id', {});`
resetEntity()
resetEntity(policyUsageLimitsId, entityId): Promise<{
[key: string]: unknown;
}>;
Defined in: src/ai-gateway/usage-limits-client.ts:158
Experimental
Reset Usage Limits Policy Entity. Owned traffic-derived counters were reset and independently audited on 2026-09-07. Experimental stability is retained; existing counters are never test fixtures.
Parameters
| Parameter | Type |
|---|---|
policyUsageLimitsId | string |
entityId | string |
Returns
Promise<{
[key: string]: unknown;
}>
Example
`await gw.usageLimits.resetEntity('resource-id', 'resource-id');`