Skip to main content

Interface: AIGatewayChartOptions

Defined in: src/ai-gateway/telemetry-client.ts:184

Verified SCM filters for requests, cost, tokens and latency charts, and grouped analytics. The historical chart-options name is retained for compatibility. Other charts still accept only time-window options; user grouping accepts these filters but not extra columns. Members of each list match with OR; distinct supplied filters combine with AND. Total-token and cost ranges are inclusive. Cost bounds are in cents, not dollars. These are partial adapters, not the complete upstream analytics query contract.

Example​

import { AIGatewayClient, type AIGatewayChartOptions } from '@cdot65/prisma-airs-sdk';
const options: AIGatewayChartOptions = {
workspaceSlug: 'ws-dev', days: 1, metadata: { environment: 'dev' },
statusCodes: [200, 446], totalUnitsMin: 1,
};
const cost = await new AIGatewayClient().telemetry.cost(options);
console.log(cost.data.total); // cents

Extends​

Extended by​

Properties​

traceId?​

optional traceId?: string;

Defined in: src/ai-gateway/telemetry-client.ts:186

One trace ID. Serialized as SCM traceId, not the ignored upstream trace_id.


metadata?​

optional metadata?: Record<string, string>;

Defined in: src/ai-gateway/telemetry-client.ts:188

Exact string-valued metadata matches. Serialized as JSON in the metadata query parameter.


statusCodes?​

optional statusCodes?: number[];

Defined in: src/ai-gateway/telemetry-client.ts:190

One or more response status codes, matched with OR and serialized as SCM statusCode CSV.


apiKeyIds?​

optional apiKeyIds?: string[];

Defined in: src/ai-gateway/telemetry-client.ts:192

One or more API-key UUIDs, matched with OR and serialized as SCM apiKeyIds CSV.


aiOrgModels?​

optional aiOrgModels?: string[];

Defined in: src/ai-gateway/telemetry-client.ts:198

Provider/model pairs such as openai__gpt-5.6-terra, matched with OR. Each item must contain a provider and model separated by __, without commas or whitespace. Serialized as SCM aiOrgModel CSV; these are analytics identifiers, not inference routing.


totalUnitsMin?​

optional totalUnitsMin?: number;

Defined in: src/ai-gateway/telemetry-client.ts:200

Inclusive minimum total tokens. A nonnegative safe integer; may equal the maximum.


totalUnitsMax?​

optional totalUnitsMax?: number;

Defined in: src/ai-gateway/telemetry-client.ts:202

Inclusive maximum total tokens. Zero is preserved, not omitted.


costMin?​

optional costMin?: number;

Defined in: src/ai-gateway/telemetry-client.ts:204

Inclusive minimum cost in cents; fractional values are preserved.


costMax?​

optional costMax?: number;

Defined in: src/ai-gateway/telemetry-client.ts:206

Inclusive maximum cost in cents. Zero is preserved, not omitted.


workspaceSlug​

workspaceSlug: string;

Defined in: src/ai-gateway/window.ts:7

Workspace slug, e.g. ws-main-a-349e0e. Required by every telemetry endpoint.

Inherited from​

AIGatewayWindowOptions.workspaceSlug


days?​

optional days?: number;

Defined in: src/ai-gateway/window.ts:9

Rolling window size in days, counted back from now. Defaults to 7. Ignored if start is set.

Inherited from​

AIGatewayWindowOptions.days


start?​

optional start?: Date;

Defined in: src/ai-gateway/window.ts:11

Explicit window start. Overrides days.

Inherited from​

AIGatewayWindowOptions.start


end?​

optional end?: Date;

Defined in: src/ai-gateway/window.ts:13

Explicit window end. Defaults to now.

Inherited from​

AIGatewayWindowOptions.end