@soat/sdk 0.77.0 → 0.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +16 -16
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -994,7 +994,7 @@ var AiProviders = class {
|
|
|
994
994
|
*
|
|
995
995
|
* Deletes an AI provider configuration.
|
|
996
996
|
*
|
|
997
|
-
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks
|
|
997
|
+
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
|
|
998
998
|
*
|
|
999
999
|
*/
|
|
1000
1000
|
static deleteAiProvider(options) {
|
|
@@ -4753,7 +4753,7 @@ var Usage = class {
|
|
|
4753
4753
|
*
|
|
4754
4754
|
* Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
4755
4755
|
*
|
|
4756
|
-
* An id
|
|
4756
|
+
* An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
|
|
4757
4757
|
*
|
|
4758
4758
|
*/
|
|
4759
4759
|
static listUsageEvents(options) {
|
|
@@ -4767,7 +4767,7 @@ var Usage = class {
|
|
|
4767
4767
|
*
|
|
4768
4768
|
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
4769
4769
|
*
|
|
4770
|
-
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource
|
|
4770
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
|
|
4771
4771
|
*
|
|
4772
4772
|
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
4773
4773
|
*
|
package/dist/index.d.cts
CHANGED
|
@@ -7415,7 +7415,7 @@ type UsageEvent = {
|
|
|
7415
7415
|
*/
|
|
7416
7416
|
session_id?: string | null;
|
|
7417
7417
|
/**
|
|
7418
|
-
* Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider.
|
|
7418
|
+
* Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Kept after the provider is deleted, like every attribution id on the event.
|
|
7419
7419
|
*
|
|
7420
7420
|
*/
|
|
7421
7421
|
ai_provider_id?: string | null;
|
|
@@ -7430,7 +7430,7 @@ type UsageEvent = {
|
|
|
7430
7430
|
*/
|
|
7431
7431
|
action_id?: string | null;
|
|
7432
7432
|
/**
|
|
7433
|
-
* Public ID of the tool a `tool_execution` event metered. Null on every other meter
|
|
7433
|
+
* Public ID of the tool a `tool_execution` event metered. Null on every other meter and for an inline tool definition.
|
|
7434
7434
|
*
|
|
7435
7435
|
*/
|
|
7436
7436
|
tool_id?: string | null;
|
|
@@ -7440,12 +7440,12 @@ type UsageEvent = {
|
|
|
7440
7440
|
*/
|
|
7441
7441
|
publisher_project_id?: string | null;
|
|
7442
7442
|
/**
|
|
7443
|
-
* Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding
|
|
7443
|
+
* Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding and on every other meter.
|
|
7444
7444
|
*
|
|
7445
7445
|
*/
|
|
7446
7446
|
document_id?: string | null;
|
|
7447
7447
|
/**
|
|
7448
|
-
* Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding
|
|
7448
|
+
* Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding and on every other meter.
|
|
7449
7449
|
*
|
|
7450
7450
|
*/
|
|
7451
7451
|
memory_store_id?: string | null;
|
|
@@ -20752,22 +20752,22 @@ type ListUsageEventsData = {
|
|
|
20752
20752
|
*/
|
|
20753
20753
|
trace_id?: string;
|
|
20754
20754
|
/**
|
|
20755
|
-
* Filter by the actor (end user) the usage is attributed to.
|
|
20755
|
+
* Filter by the actor (end user) the usage is attributed to.
|
|
20756
20756
|
*
|
|
20757
20757
|
*/
|
|
20758
20758
|
actor_id?: string;
|
|
20759
20759
|
/**
|
|
20760
|
-
* Filter by the session the usage was produced in.
|
|
20760
|
+
* Filter by the session the usage was produced in.
|
|
20761
20761
|
*
|
|
20762
20762
|
*/
|
|
20763
20763
|
session_id?: string;
|
|
20764
20764
|
/**
|
|
20765
|
-
* Filter by the provider record the spend was billed against.
|
|
20765
|
+
* Filter by the provider record the spend was billed against.
|
|
20766
20766
|
*
|
|
20767
20767
|
*/
|
|
20768
20768
|
ai_provider_id?: string;
|
|
20769
20769
|
/**
|
|
20770
|
-
* Filter by the orchestration run that metered the event.
|
|
20770
|
+
* Filter by the orchestration run that metered the event.
|
|
20771
20771
|
*
|
|
20772
20772
|
*/
|
|
20773
20773
|
orchestration_run_id?: string;
|
|
@@ -20790,12 +20790,12 @@ type ListUsageEventsData = {
|
|
|
20790
20790
|
*/
|
|
20791
20791
|
action_id?: string;
|
|
20792
20792
|
/**
|
|
20793
|
-
* Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
|
|
20793
|
+
* Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
|
|
20794
20794
|
*
|
|
20795
20795
|
*/
|
|
20796
20796
|
tool_id?: string;
|
|
20797
20797
|
/**
|
|
20798
|
-
* Filter to the calls made through a share of a resource the named project owns.
|
|
20798
|
+
* Filter to the calls made through a share of a resource the named project owns.
|
|
20799
20799
|
*
|
|
20800
20800
|
*/
|
|
20801
20801
|
publisher_project_id?: string;
|
|
@@ -20886,7 +20886,7 @@ type GetUsageAggregateData = {
|
|
|
20886
20886
|
*/
|
|
20887
20887
|
meter_type?: string;
|
|
20888
20888
|
/**
|
|
20889
|
-
* Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model.
|
|
20889
|
+
* Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. Like every id narrowing it matches the id the event recorded, so a deleted session's spend stays selectable; an id no event in this project recorded yields an empty rollup, never the project total.
|
|
20890
20890
|
*
|
|
20891
20891
|
*/
|
|
20892
20892
|
session_id?: string;
|
|
@@ -20944,12 +20944,12 @@ type GetUsageAggregateData = {
|
|
|
20944
20944
|
*/
|
|
20945
20945
|
action_id?: string;
|
|
20946
20946
|
/**
|
|
20947
|
-
* Narrow to the executions of one tool, including one another project shares with this one.
|
|
20947
|
+
* Narrow to the executions of one tool, including one another project shares with this one.
|
|
20948
20948
|
*
|
|
20949
20949
|
*/
|
|
20950
20950
|
tool_id?: string;
|
|
20951
20951
|
/**
|
|
20952
|
-
* Narrow to the calls made through a share of a resource the named project owns.
|
|
20952
|
+
* Narrow to the calls made through a share of a resource the named project owns.
|
|
20953
20953
|
*
|
|
20954
20954
|
*/
|
|
20955
20955
|
publisher_project_id?: string;
|
|
@@ -22237,7 +22237,7 @@ export declare class AiProviders {
|
|
|
22237
22237
|
*
|
|
22238
22238
|
* Deletes an AI provider configuration.
|
|
22239
22239
|
*
|
|
22240
|
-
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks
|
|
22240
|
+
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
|
|
22241
22241
|
*
|
|
22242
22242
|
*/
|
|
22243
22243
|
static deleteAiProvider<ThrowOnError extends boolean = false>(options: Options<DeleteAiProviderData, ThrowOnError>): RequestResult<DeleteAiProviderResponses, DeleteAiProviderErrors, ThrowOnError>;
|
|
@@ -24163,7 +24163,7 @@ export declare class Usage {
|
|
|
24163
24163
|
*
|
|
24164
24164
|
* Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
24165
24165
|
*
|
|
24166
|
-
* An id
|
|
24166
|
+
* An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
|
|
24167
24167
|
*
|
|
24168
24168
|
*/
|
|
24169
24169
|
static listUsageEvents<ThrowOnError extends boolean = false>(options?: Options<ListUsageEventsData, ThrowOnError>): RequestResult<ListUsageEventsResponses, ListUsageEventsErrors, ThrowOnError>;
|
|
@@ -24172,7 +24172,7 @@ export declare class Usage {
|
|
|
24172
24172
|
*
|
|
24173
24173
|
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
24174
24174
|
*
|
|
24175
|
-
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource
|
|
24175
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
|
|
24176
24176
|
*
|
|
24177
24177
|
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
24178
24178
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -7415,7 +7415,7 @@ type UsageEvent = {
|
|
|
7415
7415
|
*/
|
|
7416
7416
|
session_id?: string | null;
|
|
7417
7417
|
/**
|
|
7418
|
-
* Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider.
|
|
7418
|
+
* Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Kept after the provider is deleted, like every attribution id on the event.
|
|
7419
7419
|
*
|
|
7420
7420
|
*/
|
|
7421
7421
|
ai_provider_id?: string | null;
|
|
@@ -7430,7 +7430,7 @@ type UsageEvent = {
|
|
|
7430
7430
|
*/
|
|
7431
7431
|
action_id?: string | null;
|
|
7432
7432
|
/**
|
|
7433
|
-
* Public ID of the tool a `tool_execution` event metered. Null on every other meter
|
|
7433
|
+
* Public ID of the tool a `tool_execution` event metered. Null on every other meter and for an inline tool definition.
|
|
7434
7434
|
*
|
|
7435
7435
|
*/
|
|
7436
7436
|
tool_id?: string | null;
|
|
@@ -7440,12 +7440,12 @@ type UsageEvent = {
|
|
|
7440
7440
|
*/
|
|
7441
7441
|
publisher_project_id?: string | null;
|
|
7442
7442
|
/**
|
|
7443
|
-
* Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding
|
|
7443
|
+
* Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding and on every other meter.
|
|
7444
7444
|
*
|
|
7445
7445
|
*/
|
|
7446
7446
|
document_id?: string | null;
|
|
7447
7447
|
/**
|
|
7448
|
-
* Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding
|
|
7448
|
+
* Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding and on every other meter.
|
|
7449
7449
|
*
|
|
7450
7450
|
*/
|
|
7451
7451
|
memory_store_id?: string | null;
|
|
@@ -20752,22 +20752,22 @@ type ListUsageEventsData = {
|
|
|
20752
20752
|
*/
|
|
20753
20753
|
trace_id?: string;
|
|
20754
20754
|
/**
|
|
20755
|
-
* Filter by the actor (end user) the usage is attributed to.
|
|
20755
|
+
* Filter by the actor (end user) the usage is attributed to.
|
|
20756
20756
|
*
|
|
20757
20757
|
*/
|
|
20758
20758
|
actor_id?: string;
|
|
20759
20759
|
/**
|
|
20760
|
-
* Filter by the session the usage was produced in.
|
|
20760
|
+
* Filter by the session the usage was produced in.
|
|
20761
20761
|
*
|
|
20762
20762
|
*/
|
|
20763
20763
|
session_id?: string;
|
|
20764
20764
|
/**
|
|
20765
|
-
* Filter by the provider record the spend was billed against.
|
|
20765
|
+
* Filter by the provider record the spend was billed against.
|
|
20766
20766
|
*
|
|
20767
20767
|
*/
|
|
20768
20768
|
ai_provider_id?: string;
|
|
20769
20769
|
/**
|
|
20770
|
-
* Filter by the orchestration run that metered the event.
|
|
20770
|
+
* Filter by the orchestration run that metered the event.
|
|
20771
20771
|
*
|
|
20772
20772
|
*/
|
|
20773
20773
|
orchestration_run_id?: string;
|
|
@@ -20790,12 +20790,12 @@ type ListUsageEventsData = {
|
|
|
20790
20790
|
*/
|
|
20791
20791
|
action_id?: string;
|
|
20792
20792
|
/**
|
|
20793
|
-
* Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
|
|
20793
|
+
* Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
|
|
20794
20794
|
*
|
|
20795
20795
|
*/
|
|
20796
20796
|
tool_id?: string;
|
|
20797
20797
|
/**
|
|
20798
|
-
* Filter to the calls made through a share of a resource the named project owns.
|
|
20798
|
+
* Filter to the calls made through a share of a resource the named project owns.
|
|
20799
20799
|
*
|
|
20800
20800
|
*/
|
|
20801
20801
|
publisher_project_id?: string;
|
|
@@ -20886,7 +20886,7 @@ type GetUsageAggregateData = {
|
|
|
20886
20886
|
*/
|
|
20887
20887
|
meter_type?: string;
|
|
20888
20888
|
/**
|
|
20889
|
-
* Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model.
|
|
20889
|
+
* Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. Like every id narrowing it matches the id the event recorded, so a deleted session's spend stays selectable; an id no event in this project recorded yields an empty rollup, never the project total.
|
|
20890
20890
|
*
|
|
20891
20891
|
*/
|
|
20892
20892
|
session_id?: string;
|
|
@@ -20944,12 +20944,12 @@ type GetUsageAggregateData = {
|
|
|
20944
20944
|
*/
|
|
20945
20945
|
action_id?: string;
|
|
20946
20946
|
/**
|
|
20947
|
-
* Narrow to the executions of one tool, including one another project shares with this one.
|
|
20947
|
+
* Narrow to the executions of one tool, including one another project shares with this one.
|
|
20948
20948
|
*
|
|
20949
20949
|
*/
|
|
20950
20950
|
tool_id?: string;
|
|
20951
20951
|
/**
|
|
20952
|
-
* Narrow to the calls made through a share of a resource the named project owns.
|
|
20952
|
+
* Narrow to the calls made through a share of a resource the named project owns.
|
|
20953
20953
|
*
|
|
20954
20954
|
*/
|
|
20955
20955
|
publisher_project_id?: string;
|
|
@@ -22237,7 +22237,7 @@ export declare class AiProviders {
|
|
|
22237
22237
|
*
|
|
22238
22238
|
* Deletes an AI provider configuration.
|
|
22239
22239
|
*
|
|
22240
|
-
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks
|
|
22240
|
+
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
|
|
22241
22241
|
*
|
|
22242
22242
|
*/
|
|
22243
22243
|
static deleteAiProvider<ThrowOnError extends boolean = false>(options: Options<DeleteAiProviderData, ThrowOnError>): RequestResult<DeleteAiProviderResponses, DeleteAiProviderErrors, ThrowOnError>;
|
|
@@ -24163,7 +24163,7 @@ export declare class Usage {
|
|
|
24163
24163
|
*
|
|
24164
24164
|
* Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
24165
24165
|
*
|
|
24166
|
-
* An id
|
|
24166
|
+
* An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
|
|
24167
24167
|
*
|
|
24168
24168
|
*/
|
|
24169
24169
|
static listUsageEvents<ThrowOnError extends boolean = false>(options?: Options<ListUsageEventsData, ThrowOnError>): RequestResult<ListUsageEventsResponses, ListUsageEventsErrors, ThrowOnError>;
|
|
@@ -24172,7 +24172,7 @@ export declare class Usage {
|
|
|
24172
24172
|
*
|
|
24173
24173
|
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
24174
24174
|
*
|
|
24175
|
-
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource
|
|
24175
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
|
|
24176
24176
|
*
|
|
24177
24177
|
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
24178
24178
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -993,7 +993,7 @@ var AiProviders = class {
|
|
|
993
993
|
*
|
|
994
994
|
* Deletes an AI provider configuration.
|
|
995
995
|
*
|
|
996
|
-
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks
|
|
996
|
+
* Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
|
|
997
997
|
*
|
|
998
998
|
*/
|
|
999
999
|
static deleteAiProvider(options) {
|
|
@@ -4752,7 +4752,7 @@ var Usage = class {
|
|
|
4752
4752
|
*
|
|
4753
4753
|
* Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
4754
4754
|
*
|
|
4755
|
-
* An id
|
|
4755
|
+
* An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
|
|
4756
4756
|
*
|
|
4757
4757
|
*/
|
|
4758
4758
|
static listUsageEvents(options) {
|
|
@@ -4766,7 +4766,7 @@ var Usage = class {
|
|
|
4766
4766
|
*
|
|
4767
4767
|
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
4768
4768
|
*
|
|
4769
|
-
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource
|
|
4769
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
|
|
4770
4770
|
*
|
|
4771
4771
|
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
4772
4772
|
*
|