@to11ai/sdk 3.0.0-rc.16 → 3.0.0-rc.17

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.
@@ -8613,6 +8613,750 @@ export type RbacSetRolePermissionsResponses = {
8613
8613
  };
8614
8614
  };
8615
8615
  export type RbacSetRolePermissionsResponse = RbacSetRolePermissionsResponses[keyof RbacSetRolePermissionsResponses];
8616
+ export type UsageListTopTracesData = {
8617
+ body?: never;
8618
+ path: {
8619
+ orgId: string;
8620
+ };
8621
+ query: {
8622
+ from?: string | null;
8623
+ to?: string | null;
8624
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
8625
+ n?: number | null;
8626
+ timezone?: string | null;
8627
+ /**
8628
+ * `latency` ranks by duration, `cost` by the API-price equivalent (so subscription traffic ranks by what it consumed), `tokens` by `totalTokens` (input + output).
8629
+ */
8630
+ sort: 'latency' | 'cost' | 'tokens';
8631
+ principalId?: string | null;
8632
+ projectId?: string | null;
8633
+ vendor?: string | null;
8634
+ provider?: string | null;
8635
+ model?: string | null;
8636
+ status?: 'ok' | 'error' | 'timeout' | null;
8637
+ limit?: number | null;
8638
+ };
8639
+ url: '/v1/orgs/{orgId}/traces/top';
8640
+ };
8641
+ export type UsageListTopTracesErrors = {
8642
+ /**
8643
+ * BadRequestError
8644
+ */
8645
+ 400: BadRequestError;
8646
+ /**
8647
+ * UnauthorizedError
8648
+ */
8649
+ 401: UnauthorizedError;
8650
+ /**
8651
+ * ForbiddenError
8652
+ */
8653
+ 403: ForbiddenError;
8654
+ /**
8655
+ * NotFoundError
8656
+ */
8657
+ 404: NotFoundError;
8658
+ /**
8659
+ * ConflictError
8660
+ */
8661
+ 409: ConflictError;
8662
+ /**
8663
+ * GoneError
8664
+ */
8665
+ 410: GoneError;
8666
+ /**
8667
+ * ContentTooLargeError
8668
+ */
8669
+ 413: ContentTooLargeError;
8670
+ /**
8671
+ * MisdirectedRequestError
8672
+ */
8673
+ 421: MisdirectedRequestError;
8674
+ /**
8675
+ * UnprocessableEntityError
8676
+ */
8677
+ 422: UnprocessableEntityError;
8678
+ /**
8679
+ * TooManyRequestsError
8680
+ */
8681
+ 429: TooManyRequestsError;
8682
+ /**
8683
+ * InternalServerError
8684
+ */
8685
+ 500: InternalServerError;
8686
+ /**
8687
+ * ServiceUnavailableError
8688
+ */
8689
+ 503: ServiceUnavailableError;
8690
+ };
8691
+ export type UsageListTopTracesError = UsageListTopTracesErrors[keyof UsageListTopTracesErrors];
8692
+ export type UsageListTopTracesResponses = {
8693
+ /**
8694
+ * Success
8695
+ */
8696
+ 200: {
8697
+ code: number;
8698
+ data: {
8699
+ excludedProjects: Array<{
8700
+ projectId: string;
8701
+ reason: 'other_data_center';
8702
+ }>;
8703
+ items: Array<{
8704
+ apiEquivalentUsd: number | null;
8705
+ billedUsd: number | null;
8706
+ durationMs: number;
8707
+ inputTokens: number;
8708
+ model: string;
8709
+ outputTokens: number;
8710
+ projectId: string;
8711
+ provider: string;
8712
+ sessionId: string | null;
8713
+ sessionLink: string | null;
8714
+ startTime: string;
8715
+ status: 'ok' | 'error' | 'timeout';
8716
+ /**
8717
+ * `inputTokens + outputTokens`, the trace list's definition. Unlike the usage endpoints' `tokens.total`, it leaves out cache reads, cache writes and reasoning tokens.
8718
+ */
8719
+ totalTokens: number;
8720
+ traceId: string;
8721
+ }>;
8722
+ sort: 'latency' | 'cost' | 'tokens';
8723
+ window: {
8724
+ from: string;
8725
+ n?: number | null;
8726
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
8727
+ timezone?: string | null;
8728
+ to: string;
8729
+ };
8730
+ } | null;
8731
+ error: {
8732
+ code: string;
8733
+ details?: unknown | null;
8734
+ message: string;
8735
+ rowErrors?: Array<{
8736
+ code: string;
8737
+ message: string;
8738
+ path: Array<string | number>;
8739
+ }> | null;
8740
+ } | null;
8741
+ pagination: {
8742
+ limit: number;
8743
+ page: number;
8744
+ total: number;
8745
+ totalPages: number;
8746
+ } | null;
8747
+ sdkBehavior?: {
8748
+ flags: {
8749
+ [key: string]: unknown;
8750
+ };
8751
+ v: number;
8752
+ } | null;
8753
+ success: boolean;
8754
+ };
8755
+ };
8756
+ export type UsageListTopTracesResponse = UsageListTopTracesResponses[keyof UsageListTopTracesResponses];
8757
+ export type UsageGetUsageCostsData = {
8758
+ body?: never;
8759
+ path: {
8760
+ orgId: string;
8761
+ };
8762
+ query?: {
8763
+ from?: string | null;
8764
+ to?: string | null;
8765
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
8766
+ n?: number | null;
8767
+ timezone?: string | null;
8768
+ groupBy?: 'principal' | 'vendor' | 'provider' | 'model' | 'project' | 'billingMode' | Array<'principal' | 'vendor' | 'provider' | 'model' | 'project' | 'billingMode'> | null;
8769
+ principalId?: string | null;
8770
+ vendor?: string | null;
8771
+ provider?: string | null;
8772
+ model?: string | null;
8773
+ projectId?: string | null;
8774
+ billingMode?: 'subscription' | 'api' | 'unknown' | null;
8775
+ limit?: number | null;
8776
+ };
8777
+ url: '/v1/orgs/{orgId}/usage/costs';
8778
+ };
8779
+ export type UsageGetUsageCostsErrors = {
8780
+ /**
8781
+ * BadRequestError
8782
+ */
8783
+ 400: BadRequestError;
8784
+ /**
8785
+ * UnauthorizedError
8786
+ */
8787
+ 401: UnauthorizedError;
8788
+ /**
8789
+ * ForbiddenError
8790
+ */
8791
+ 403: ForbiddenError;
8792
+ /**
8793
+ * NotFoundError
8794
+ */
8795
+ 404: NotFoundError;
8796
+ /**
8797
+ * ConflictError
8798
+ */
8799
+ 409: ConflictError;
8800
+ /**
8801
+ * GoneError
8802
+ */
8803
+ 410: GoneError;
8804
+ /**
8805
+ * ContentTooLargeError
8806
+ */
8807
+ 413: ContentTooLargeError;
8808
+ /**
8809
+ * MisdirectedRequestError
8810
+ */
8811
+ 421: MisdirectedRequestError;
8812
+ /**
8813
+ * UnprocessableEntityError
8814
+ */
8815
+ 422: UnprocessableEntityError;
8816
+ /**
8817
+ * TooManyRequestsError
8818
+ */
8819
+ 429: TooManyRequestsError;
8820
+ /**
8821
+ * InternalServerError
8822
+ */
8823
+ 500: InternalServerError;
8824
+ /**
8825
+ * ServiceUnavailableError
8826
+ */
8827
+ 503: ServiceUnavailableError;
8828
+ };
8829
+ export type UsageGetUsageCostsError = UsageGetUsageCostsErrors[keyof UsageGetUsageCostsErrors];
8830
+ export type UsageGetUsageCostsResponses = {
8831
+ /**
8832
+ * Success
8833
+ */
8834
+ 200: {
8835
+ code: number;
8836
+ data: {
8837
+ byProvider?: Array<{
8838
+ apiEquivalentUsd: number | null;
8839
+ /**
8840
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
8841
+ */
8842
+ billedUsd: number | null;
8843
+ provider: string;
8844
+ requests: number;
8845
+ tokens: {
8846
+ cacheRead: number;
8847
+ cacheWrite: number;
8848
+ input: number;
8849
+ output: number;
8850
+ reasoning: number;
8851
+ total: number;
8852
+ };
8853
+ unpricedRequests: number;
8854
+ }> | null;
8855
+ excludedProjects: Array<{
8856
+ projectId: string;
8857
+ reason: 'other_data_center';
8858
+ }>;
8859
+ groupBy: Array<'principal' | 'vendor' | 'provider' | 'model' | 'project' | 'billingMode'>;
8860
+ groups: Array<{
8861
+ apiEquivalentUsd: number | null;
8862
+ /**
8863
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
8864
+ */
8865
+ billedUsd: number | null;
8866
+ /**
8867
+ * Present when grouped by `billingMode`. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode: it forms no group then, as the cost views give it no billing-mode line, but it still counts in `totals`.
8868
+ */
8869
+ billingMode?: 'subscription' | 'api' | 'unknown' | null;
8870
+ model?: string | null;
8871
+ principal?: {
8872
+ displayName: string | null;
8873
+ id: string;
8874
+ } | null | null;
8875
+ project?: {
8876
+ id: string;
8877
+ name: string;
8878
+ } | null;
8879
+ provider?: string | null;
8880
+ requests: number;
8881
+ tokens: {
8882
+ cacheRead: number;
8883
+ cacheWrite: number;
8884
+ input: number;
8885
+ output: number;
8886
+ reasoning: number;
8887
+ total: number;
8888
+ };
8889
+ unpricedRequests: number;
8890
+ vendor?: string | null;
8891
+ }>;
8892
+ otherGroups: number;
8893
+ totals: {
8894
+ apiEquivalentUsd: number | null;
8895
+ /**
8896
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
8897
+ */
8898
+ billedUsd: number | null;
8899
+ byBillingMode: Array<{
8900
+ apiEquivalentUsd: number | null;
8901
+ /**
8902
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
8903
+ */
8904
+ billedUsd: number | null;
8905
+ billingMode: 'subscription' | 'api' | 'unknown';
8906
+ requests: number;
8907
+ tokens: {
8908
+ cacheRead: number;
8909
+ cacheWrite: number;
8910
+ input: number;
8911
+ output: number;
8912
+ reasoning: number;
8913
+ total: number;
8914
+ };
8915
+ unpricedRequests: number;
8916
+ }>;
8917
+ requests: number;
8918
+ tokens: {
8919
+ cacheRead: number;
8920
+ cacheWrite: number;
8921
+ input: number;
8922
+ output: number;
8923
+ reasoning: number;
8924
+ total: number;
8925
+ };
8926
+ unpricedRequests: number;
8927
+ };
8928
+ window: {
8929
+ from: string;
8930
+ n?: number | null;
8931
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
8932
+ timezone?: string | null;
8933
+ to: string;
8934
+ };
8935
+ } | null;
8936
+ error: {
8937
+ code: string;
8938
+ details?: unknown | null;
8939
+ message: string;
8940
+ rowErrors?: Array<{
8941
+ code: string;
8942
+ message: string;
8943
+ path: Array<string | number>;
8944
+ }> | null;
8945
+ } | null;
8946
+ pagination: {
8947
+ limit: number;
8948
+ page: number;
8949
+ total: number;
8950
+ totalPages: number;
8951
+ } | null;
8952
+ sdkBehavior?: {
8953
+ flags: {
8954
+ [key: string]: unknown;
8955
+ };
8956
+ v: number;
8957
+ } | null;
8958
+ success: boolean;
8959
+ };
8960
+ };
8961
+ export type UsageGetUsageCostsResponse = UsageGetUsageCostsResponses[keyof UsageGetUsageCostsResponses];
8962
+ export type UsageListUsagePrincipalsData = {
8963
+ body?: never;
8964
+ path: {
8965
+ orgId: string;
8966
+ };
8967
+ query?: {
8968
+ query?: string | null;
8969
+ email?: string | null;
8970
+ };
8971
+ url: '/v1/orgs/{orgId}/usage/principals';
8972
+ };
8973
+ export type UsageListUsagePrincipalsErrors = {
8974
+ /**
8975
+ * BadRequestError
8976
+ */
8977
+ 400: BadRequestError;
8978
+ /**
8979
+ * UnauthorizedError
8980
+ */
8981
+ 401: UnauthorizedError;
8982
+ /**
8983
+ * ForbiddenError
8984
+ */
8985
+ 403: ForbiddenError;
8986
+ /**
8987
+ * NotFoundError
8988
+ */
8989
+ 404: NotFoundError;
8990
+ /**
8991
+ * ConflictError
8992
+ */
8993
+ 409: ConflictError;
8994
+ /**
8995
+ * GoneError
8996
+ */
8997
+ 410: GoneError;
8998
+ /**
8999
+ * ContentTooLargeError
9000
+ */
9001
+ 413: ContentTooLargeError;
9002
+ /**
9003
+ * MisdirectedRequestError
9004
+ */
9005
+ 421: MisdirectedRequestError;
9006
+ /**
9007
+ * UnprocessableEntityError
9008
+ */
9009
+ 422: UnprocessableEntityError;
9010
+ /**
9011
+ * TooManyRequestsError
9012
+ */
9013
+ 429: TooManyRequestsError;
9014
+ /**
9015
+ * InternalServerError
9016
+ */
9017
+ 500: InternalServerError;
9018
+ /**
9019
+ * ServiceUnavailableError
9020
+ */
9021
+ 503: ServiceUnavailableError;
9022
+ };
9023
+ export type UsageListUsagePrincipalsError = UsageListUsagePrincipalsErrors[keyof UsageListUsagePrincipalsErrors];
9024
+ export type UsageListUsagePrincipalsResponses = {
9025
+ /**
9026
+ * Success
9027
+ */
9028
+ 200: {
9029
+ code: number;
9030
+ data: {
9031
+ excludedProjects: Array<{
9032
+ projectId: string;
9033
+ reason: 'other_data_center';
9034
+ }>;
9035
+ items: Array<{
9036
+ displayName: string;
9037
+ principalId: string;
9038
+ }>;
9039
+ } | null;
9040
+ error: {
9041
+ code: string;
9042
+ details?: unknown | null;
9043
+ message: string;
9044
+ rowErrors?: Array<{
9045
+ code: string;
9046
+ message: string;
9047
+ path: Array<string | number>;
9048
+ }> | null;
9049
+ } | null;
9050
+ pagination: {
9051
+ limit: number;
9052
+ page: number;
9053
+ total: number;
9054
+ totalPages: number;
9055
+ } | null;
9056
+ sdkBehavior?: {
9057
+ flags: {
9058
+ [key: string]: unknown;
9059
+ };
9060
+ v: number;
9061
+ } | null;
9062
+ success: boolean;
9063
+ };
9064
+ };
9065
+ export type UsageListUsagePrincipalsResponse = UsageListUsagePrincipalsResponses[keyof UsageListUsagePrincipalsResponses];
9066
+ export type UsageListUsageSessionsData = {
9067
+ body?: never;
9068
+ path: {
9069
+ orgId: string;
9070
+ };
9071
+ query?: {
9072
+ from?: string | null;
9073
+ to?: string | null;
9074
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
9075
+ n?: number | null;
9076
+ timezone?: string | null;
9077
+ /**
9078
+ * `session` (default) or `run`. A session's owner is whoever sent its first request ever, stored with the session. A run stores no owner, so under `run` the owner and the `principalId` filter use the first sender inside the window.
9079
+ */
9080
+ groupBy?: 'session' | 'run' | null;
9081
+ /**
9082
+ * Only sessions (runs) this principal owns. Under `groupBy=session`: the session's stored owner, its first sender ever. Under `groupBy=run`: the run's first sender inside the window, since a run stores no owner.
9083
+ */
9084
+ principalId?: string | null;
9085
+ projectId?: string | null;
9086
+ billingMode?: 'subscription' | 'api' | 'unknown' | null;
9087
+ cursor?: string | null;
9088
+ limit?: number | null;
9089
+ };
9090
+ url: '/v1/orgs/{orgId}/usage/sessions';
9091
+ };
9092
+ export type UsageListUsageSessionsErrors = {
9093
+ /**
9094
+ * BadRequestError
9095
+ */
9096
+ 400: BadRequestError;
9097
+ /**
9098
+ * UnauthorizedError
9099
+ */
9100
+ 401: UnauthorizedError;
9101
+ /**
9102
+ * ForbiddenError
9103
+ */
9104
+ 403: ForbiddenError;
9105
+ /**
9106
+ * NotFoundError
9107
+ */
9108
+ 404: NotFoundError;
9109
+ /**
9110
+ * ConflictError
9111
+ */
9112
+ 409: ConflictError;
9113
+ /**
9114
+ * GoneError
9115
+ */
9116
+ 410: GoneError;
9117
+ /**
9118
+ * ContentTooLargeError
9119
+ */
9120
+ 413: ContentTooLargeError;
9121
+ /**
9122
+ * MisdirectedRequestError
9123
+ */
9124
+ 421: MisdirectedRequestError;
9125
+ /**
9126
+ * UnprocessableEntityError
9127
+ */
9128
+ 422: UnprocessableEntityError;
9129
+ /**
9130
+ * TooManyRequestsError
9131
+ */
9132
+ 429: TooManyRequestsError;
9133
+ /**
9134
+ * InternalServerError
9135
+ */
9136
+ 500: InternalServerError;
9137
+ /**
9138
+ * ServiceUnavailableError
9139
+ */
9140
+ 503: ServiceUnavailableError;
9141
+ };
9142
+ export type UsageListUsageSessionsError = UsageListUsageSessionsErrors[keyof UsageListUsageSessionsErrors];
9143
+ export type UsageListUsageSessionsResponses = {
9144
+ /**
9145
+ * Success
9146
+ */
9147
+ 200: {
9148
+ code: number;
9149
+ data: {
9150
+ excludedProjects: Array<{
9151
+ projectId: string;
9152
+ reason: 'other_data_center';
9153
+ }>;
9154
+ groupBy: 'session' | 'run';
9155
+ pagination: {
9156
+ limit: number;
9157
+ nextCursor: string | null;
9158
+ };
9159
+ runs?: Array<{
9160
+ apiEquivalentUsd: number | null;
9161
+ /**
9162
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9163
+ */
9164
+ billedUsd: number | null;
9165
+ byBillingMode: Array<{
9166
+ apiEquivalentUsd: number | null;
9167
+ /**
9168
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9169
+ */
9170
+ billedUsd: number | null;
9171
+ billingMode: 'subscription' | 'api' | 'unknown';
9172
+ requests: number;
9173
+ tokens: {
9174
+ cacheRead: number;
9175
+ cacheWrite: number;
9176
+ input: number;
9177
+ output: number;
9178
+ reasoning: number;
9179
+ total: number;
9180
+ };
9181
+ unpricedRequests: number;
9182
+ }>;
9183
+ conversationId: string;
9184
+ firstSeen: string;
9185
+ lastActivity: string;
9186
+ models: Array<string>;
9187
+ /**
9188
+ * The run's first sender inside the window, not its first ever: a run stores no owner. `null` when no span in the window carried one.
9189
+ */
9190
+ owner: {
9191
+ displayName: string | null;
9192
+ id: string;
9193
+ } | null;
9194
+ projectId: string;
9195
+ requests: number;
9196
+ startedInWindow: boolean;
9197
+ tokens: {
9198
+ cacheRead: number;
9199
+ cacheWrite: number;
9200
+ input: number;
9201
+ output: number;
9202
+ reasoning: number;
9203
+ total: number;
9204
+ };
9205
+ unpricedRequests: number;
9206
+ }> | null;
9207
+ sessions?: Array<{
9208
+ apiEquivalentUsd: number | null;
9209
+ /**
9210
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9211
+ */
9212
+ billedUsd: number | null;
9213
+ byBillingMode: Array<{
9214
+ apiEquivalentUsd: number | null;
9215
+ /**
9216
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9217
+ */
9218
+ billedUsd: number | null;
9219
+ billingMode: 'subscription' | 'api' | 'unknown';
9220
+ requests: number;
9221
+ tokens: {
9222
+ cacheRead: number;
9223
+ cacheWrite: number;
9224
+ input: number;
9225
+ output: number;
9226
+ reasoning: number;
9227
+ total: number;
9228
+ };
9229
+ unpricedRequests: number;
9230
+ }>;
9231
+ firstSeen: string;
9232
+ lastActivity: string;
9233
+ link: string;
9234
+ models: Array<string>;
9235
+ owner: {
9236
+ displayName: string | null;
9237
+ id: string;
9238
+ } | null;
9239
+ projectId: string;
9240
+ requests: number;
9241
+ sessionId: string;
9242
+ startedInWindow: boolean;
9243
+ tokens: {
9244
+ cacheRead: number;
9245
+ cacheWrite: number;
9246
+ input: number;
9247
+ output: number;
9248
+ reasoning: number;
9249
+ total: number;
9250
+ };
9251
+ unpricedRequests: number;
9252
+ }> | null;
9253
+ totals: {
9254
+ active: number;
9255
+ apiEquivalentUsd: number | null;
9256
+ /**
9257
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9258
+ */
9259
+ billedUsd: number | null;
9260
+ byBillingMode: Array<{
9261
+ apiEquivalentUsd: number | null;
9262
+ /**
9263
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9264
+ */
9265
+ billedUsd: number | null;
9266
+ billingMode: 'subscription' | 'api' | 'unknown';
9267
+ requests: number;
9268
+ tokens: {
9269
+ cacheRead: number;
9270
+ cacheWrite: number;
9271
+ input: number;
9272
+ output: number;
9273
+ reasoning: number;
9274
+ total: number;
9275
+ };
9276
+ unpricedRequests: number;
9277
+ }>;
9278
+ requests: number;
9279
+ startedInWindow: number;
9280
+ tokens: {
9281
+ cacheRead: number;
9282
+ cacheWrite: number;
9283
+ input: number;
9284
+ output: number;
9285
+ reasoning: number;
9286
+ total: number;
9287
+ };
9288
+ unpricedRequests: number;
9289
+ };
9290
+ ungrouped: {
9291
+ apiEquivalentUsd: number | null;
9292
+ /**
9293
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9294
+ */
9295
+ billedUsd: number | null;
9296
+ byBillingMode: Array<{
9297
+ apiEquivalentUsd: number | null;
9298
+ /**
9299
+ * Per-token cost of `api` traffic at the org's rates. Subscription traffic is billed 0. `unknown` traffic (Anthropic calls from before the billing-mode stamp) is never folded in. A request that never reached the provider (a response-cache hit or a guardrail block) has no billing mode and adds nothing here; its tokens are still in `tokens` and `apiEquivalentUsd`, as in the cost views, and it forms no `byBillingMode` line. `null` when the group's `api` traffic has no rate; when the group is only `unknown` traffic, as the `unknown` billing-mode line always is: that traffic can't be classified as subscription or API, so it has no billed figure (its `apiEquivalentUsd` still prices it); or when the group is only requests that never reached the provider.
9300
+ */
9301
+ billedUsd: number | null;
9302
+ billingMode: 'subscription' | 'api' | 'unknown';
9303
+ requests: number;
9304
+ tokens: {
9305
+ cacheRead: number;
9306
+ cacheWrite: number;
9307
+ input: number;
9308
+ output: number;
9309
+ reasoning: number;
9310
+ total: number;
9311
+ };
9312
+ unpricedRequests: number;
9313
+ }>;
9314
+ label: string;
9315
+ requests: number;
9316
+ tokens: {
9317
+ cacheRead: number;
9318
+ cacheWrite: number;
9319
+ input: number;
9320
+ output: number;
9321
+ reasoning: number;
9322
+ total: number;
9323
+ };
9324
+ unpricedRequests: number;
9325
+ };
9326
+ window: {
9327
+ from: string;
9328
+ n?: number | null;
9329
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
9330
+ timezone?: string | null;
9331
+ to: string;
9332
+ };
9333
+ } | null;
9334
+ error: {
9335
+ code: string;
9336
+ details?: unknown | null;
9337
+ message: string;
9338
+ rowErrors?: Array<{
9339
+ code: string;
9340
+ message: string;
9341
+ path: Array<string | number>;
9342
+ }> | null;
9343
+ } | null;
9344
+ pagination: {
9345
+ limit: number;
9346
+ page: number;
9347
+ total: number;
9348
+ totalPages: number;
9349
+ } | null;
9350
+ sdkBehavior?: {
9351
+ flags: {
9352
+ [key: string]: unknown;
9353
+ };
9354
+ v: number;
9355
+ } | null;
9356
+ success: boolean;
9357
+ };
9358
+ };
9359
+ export type UsageListUsageSessionsResponse = UsageListUsageSessionsResponses[keyof UsageListUsageSessionsResponses];
8616
9360
  export type RbacSetUserPermissionOverridesData = {
8617
9361
  body: {
8618
9362
  overrides: Array<{
@@ -23751,7 +24495,7 @@ export type TracesListTracesData = {
23751
24495
  query?: {
23752
24496
  page?: string | null;
23753
24497
  limit?: string | null;
23754
- sort?: 'startTime' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'model' | 'provider' | 'toolCalls' | 'costUsd' | null;
24498
+ sort?: 'startTime' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'model' | 'provider' | 'toolCalls' | 'costUsd' | 'totalTokens' | 'apiEquivalentUsd' | null;
23755
24499
  order?: 'asc' | 'desc' | null;
23756
24500
  status?: 'ok' | 'error' | 'timeout' | null;
23757
24501
  provider?: string | Array<string> | null;
@@ -23762,6 +24506,8 @@ export type TracesListTracesData = {
23762
24506
  vcsHeadName?: string | null;
23763
24507
  vcsHeadRevision?: string | null;
23764
24508
  billingMode?: 'subscription' | 'api' | 'unknown' | Array<'subscription' | 'api' | 'unknown'> | null;
24509
+ principalId?: string | null;
24510
+ vendor?: string | null;
23765
24511
  minTokens?: string | null;
23766
24512
  maxTokens?: string | null;
23767
24513
  minCost?: string | null;
@@ -24068,7 +24814,7 @@ export type TracesListTracePromptFacetsData = {
24068
24814
  query?: {
24069
24815
  page?: string | null;
24070
24816
  limit?: string | null;
24071
- sort?: 'startTime' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'model' | 'provider' | 'toolCalls' | 'costUsd' | null;
24817
+ sort?: 'startTime' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'model' | 'provider' | 'toolCalls' | 'costUsd' | 'totalTokens' | 'apiEquivalentUsd' | null;
24072
24818
  order?: 'asc' | 'desc' | null;
24073
24819
  status?: 'ok' | 'error' | 'timeout' | null;
24074
24820
  provider?: string | Array<string> | null;
@@ -24079,6 +24825,8 @@ export type TracesListTracePromptFacetsData = {
24079
24825
  vcsHeadName?: string | null;
24080
24826
  vcsHeadRevision?: string | null;
24081
24827
  billingMode?: 'subscription' | 'api' | 'unknown' | Array<'subscription' | 'api' | 'unknown'> | null;
24828
+ principalId?: string | null;
24829
+ vendor?: string | null;
24082
24830
  minTokens?: string | null;
24083
24831
  maxTokens?: string | null;
24084
24832
  minCost?: string | null;