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

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.
@@ -142,6 +142,25 @@ export type OAuthCredential = {
142
142
  tokenExpiry?: number | null;
143
143
  type: 'oauth';
144
144
  };
145
+ export type OrgPromptRow = {
146
+ description: string | null;
147
+ name: string;
148
+ projectId: string;
149
+ projectName: string;
150
+ promptId: string;
151
+ slug: string;
152
+ /**
153
+ * The version the `latest` label serves at listing time. Pass it to the by-version render route so the run uses exactly this version.
154
+ */
155
+ version: number;
156
+ };
157
+ export type OrgPromptsResponse = {
158
+ excludedProjects: Array<{
159
+ projectId: string;
160
+ reason: 'other_data_center';
161
+ }>;
162
+ items: Array<OrgPromptRow>;
163
+ };
145
164
  export type PrincipalApiKeyContextInvariant = {
146
165
  actorType?: 'oidc' | 'api_key' | null;
147
166
  apiKey?: {
@@ -434,6 +453,39 @@ export type TooManyRequestsError = {
434
453
  };
435
454
  success: false;
436
455
  };
456
+ export type TopTracesResponse = {
457
+ excludedProjects: Array<{
458
+ projectId: string;
459
+ reason: 'other_data_center';
460
+ }>;
461
+ items: Array<{
462
+ apiEquivalentUsd: number | null;
463
+ billedUsd: number | null;
464
+ durationMs: number;
465
+ inputTokens: number;
466
+ model: string;
467
+ outputTokens: number;
468
+ projectId: string;
469
+ provider: string;
470
+ sessionId: string | null;
471
+ sessionLink: string | null;
472
+ startTime: string;
473
+ status: 'ok' | 'error' | 'timeout';
474
+ /**
475
+ * `inputTokens + outputTokens`, the trace list's definition. Unlike the usage endpoints' `tokens.total`, it leaves out cache reads, cache writes and reasoning tokens.
476
+ */
477
+ totalTokens: number;
478
+ traceId: string;
479
+ }>;
480
+ sort: 'latency' | 'cost' | 'tokens';
481
+ window: {
482
+ from: string;
483
+ n?: number | null;
484
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
485
+ timezone?: string | null;
486
+ to: string;
487
+ };
488
+ };
437
489
  export type UnauthorizedError = {
438
490
  _tag: 'UnauthorizedError';
439
491
  code: number;
@@ -464,6 +516,301 @@ export type UnprocessableEntityError = {
464
516
  };
465
517
  success: false;
466
518
  };
519
+ export type UsageCostsResponse = {
520
+ byProvider?: Array<{
521
+ apiEquivalentUsd: number | null;
522
+ /**
523
+ * 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.
524
+ */
525
+ billedUsd: number | null;
526
+ provider: string;
527
+ requests: number;
528
+ tokens: {
529
+ cacheRead: number;
530
+ cacheWrite: number;
531
+ input: number;
532
+ output: number;
533
+ reasoning: number;
534
+ total: number;
535
+ };
536
+ unpricedRequests: number;
537
+ }> | null;
538
+ excludedProjects: Array<{
539
+ projectId: string;
540
+ reason: 'other_data_center';
541
+ }>;
542
+ groupBy: Array<'principal' | 'vendor' | 'provider' | 'model' | 'project' | 'billingMode'>;
543
+ groups: Array<{
544
+ apiEquivalentUsd: number | null;
545
+ /**
546
+ * 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.
547
+ */
548
+ billedUsd: number | null;
549
+ /**
550
+ * 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`.
551
+ */
552
+ billingMode?: 'subscription' | 'api' | 'unknown' | null;
553
+ model?: string | null;
554
+ principal?: {
555
+ displayName: string | null;
556
+ id: string;
557
+ } | null | null;
558
+ project?: {
559
+ id: string;
560
+ name: string;
561
+ } | null;
562
+ provider?: string | null;
563
+ requests: number;
564
+ tokens: {
565
+ cacheRead: number;
566
+ cacheWrite: number;
567
+ input: number;
568
+ output: number;
569
+ reasoning: number;
570
+ total: number;
571
+ };
572
+ unpricedRequests: number;
573
+ vendor?: string | null;
574
+ }>;
575
+ otherGroups: number;
576
+ totals: {
577
+ apiEquivalentUsd: number | null;
578
+ /**
579
+ * 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.
580
+ */
581
+ billedUsd: number | null;
582
+ byBillingMode: Array<{
583
+ apiEquivalentUsd: number | null;
584
+ /**
585
+ * 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.
586
+ */
587
+ billedUsd: number | null;
588
+ billingMode: 'subscription' | 'api' | 'unknown';
589
+ requests: number;
590
+ tokens: {
591
+ cacheRead: number;
592
+ cacheWrite: number;
593
+ input: number;
594
+ output: number;
595
+ reasoning: number;
596
+ total: number;
597
+ };
598
+ unpricedRequests: number;
599
+ }>;
600
+ requests: number;
601
+ tokens: {
602
+ cacheRead: number;
603
+ cacheWrite: number;
604
+ input: number;
605
+ output: number;
606
+ reasoning: number;
607
+ total: number;
608
+ };
609
+ unpricedRequests: number;
610
+ };
611
+ window: {
612
+ from: string;
613
+ n?: number | null;
614
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
615
+ timezone?: string | null;
616
+ to: string;
617
+ };
618
+ };
619
+ export type UsagePrincipalsResponse = {
620
+ excludedProjects: Array<{
621
+ projectId: string;
622
+ reason: 'other_data_center';
623
+ }>;
624
+ items: Array<{
625
+ displayName: string;
626
+ principalId: string;
627
+ }>;
628
+ };
629
+ export type UsageSessionsResponse = {
630
+ excludedProjects: Array<{
631
+ projectId: string;
632
+ reason: 'other_data_center';
633
+ }>;
634
+ groupBy: 'session' | 'run';
635
+ pagination: {
636
+ limit: number;
637
+ nextCursor: string | null;
638
+ };
639
+ runs?: Array<{
640
+ apiEquivalentUsd: number | null;
641
+ /**
642
+ * 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.
643
+ */
644
+ billedUsd: number | null;
645
+ byBillingMode: Array<{
646
+ apiEquivalentUsd: number | null;
647
+ /**
648
+ * 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.
649
+ */
650
+ billedUsd: number | null;
651
+ billingMode: 'subscription' | 'api' | 'unknown';
652
+ requests: number;
653
+ tokens: {
654
+ cacheRead: number;
655
+ cacheWrite: number;
656
+ input: number;
657
+ output: number;
658
+ reasoning: number;
659
+ total: number;
660
+ };
661
+ unpricedRequests: number;
662
+ }>;
663
+ conversationId: string;
664
+ firstSeen: string;
665
+ lastActivity: string;
666
+ models: Array<string>;
667
+ /**
668
+ * 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.
669
+ */
670
+ owner: {
671
+ displayName: string | null;
672
+ id: string;
673
+ } | null;
674
+ projectId: string;
675
+ requests: number;
676
+ startedInWindow: boolean;
677
+ tokens: {
678
+ cacheRead: number;
679
+ cacheWrite: number;
680
+ input: number;
681
+ output: number;
682
+ reasoning: number;
683
+ total: number;
684
+ };
685
+ unpricedRequests: number;
686
+ }> | null;
687
+ sessions?: Array<{
688
+ apiEquivalentUsd: number | null;
689
+ /**
690
+ * 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.
691
+ */
692
+ billedUsd: number | null;
693
+ byBillingMode: Array<{
694
+ apiEquivalentUsd: number | null;
695
+ /**
696
+ * 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.
697
+ */
698
+ billedUsd: number | null;
699
+ billingMode: 'subscription' | 'api' | 'unknown';
700
+ requests: number;
701
+ tokens: {
702
+ cacheRead: number;
703
+ cacheWrite: number;
704
+ input: number;
705
+ output: number;
706
+ reasoning: number;
707
+ total: number;
708
+ };
709
+ unpricedRequests: number;
710
+ }>;
711
+ firstSeen: string;
712
+ lastActivity: string;
713
+ link: string;
714
+ models: Array<string>;
715
+ owner: {
716
+ displayName: string | null;
717
+ id: string;
718
+ } | null;
719
+ projectId: string;
720
+ requests: number;
721
+ sessionId: string;
722
+ startedInWindow: boolean;
723
+ tokens: {
724
+ cacheRead: number;
725
+ cacheWrite: number;
726
+ input: number;
727
+ output: number;
728
+ reasoning: number;
729
+ total: number;
730
+ };
731
+ unpricedRequests: number;
732
+ }> | null;
733
+ totals: {
734
+ active: number;
735
+ apiEquivalentUsd: number | null;
736
+ /**
737
+ * 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.
738
+ */
739
+ billedUsd: number | null;
740
+ byBillingMode: Array<{
741
+ apiEquivalentUsd: number | null;
742
+ /**
743
+ * 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.
744
+ */
745
+ billedUsd: number | null;
746
+ billingMode: 'subscription' | 'api' | 'unknown';
747
+ requests: number;
748
+ tokens: {
749
+ cacheRead: number;
750
+ cacheWrite: number;
751
+ input: number;
752
+ output: number;
753
+ reasoning: number;
754
+ total: number;
755
+ };
756
+ unpricedRequests: number;
757
+ }>;
758
+ requests: number;
759
+ startedInWindow: number;
760
+ tokens: {
761
+ cacheRead: number;
762
+ cacheWrite: number;
763
+ input: number;
764
+ output: number;
765
+ reasoning: number;
766
+ total: number;
767
+ };
768
+ unpricedRequests: number;
769
+ };
770
+ ungrouped: {
771
+ apiEquivalentUsd: number | null;
772
+ /**
773
+ * 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.
774
+ */
775
+ billedUsd: number | null;
776
+ byBillingMode: Array<{
777
+ apiEquivalentUsd: number | null;
778
+ /**
779
+ * 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.
780
+ */
781
+ billedUsd: number | null;
782
+ billingMode: 'subscription' | 'api' | 'unknown';
783
+ requests: number;
784
+ tokens: {
785
+ cacheRead: number;
786
+ cacheWrite: number;
787
+ input: number;
788
+ output: number;
789
+ reasoning: number;
790
+ total: number;
791
+ };
792
+ unpricedRequests: number;
793
+ }>;
794
+ label: string;
795
+ requests: number;
796
+ tokens: {
797
+ cacheRead: number;
798
+ cacheWrite: number;
799
+ input: number;
800
+ output: number;
801
+ reasoning: number;
802
+ total: number;
803
+ };
804
+ unpricedRequests: number;
805
+ };
806
+ window: {
807
+ from: string;
808
+ n?: number | null;
809
+ preset?: 'last_n_hours' | 'last_n_days' | 'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | null;
810
+ timezone?: string | null;
811
+ to: string;
812
+ };
813
+ };
467
814
  export type ApiKeysGetApiKeyJwksData = {
468
815
  body?: never;
469
816
  path?: never;
@@ -4523,6 +4870,109 @@ export type OrganizationsUpdateOrganizationResponses = {
4523
4870
  };
4524
4871
  };
4525
4872
  export type OrganizationsUpdateOrganizationResponse = OrganizationsUpdateOrganizationResponses[keyof OrganizationsUpdateOrganizationResponses];
4873
+ export type AssistantRunsRecordAssistantRunData = {
4874
+ body: {
4875
+ finishedAt: string;
4876
+ model: string;
4877
+ outcome: 'answered' | 'limit_tool_rounds' | 'limit_wall_clock' | 'limit_output_tokens' | 'refused' | 'credential_expired' | 'model_error' | 'disabled' | 'superseded';
4878
+ runId: string;
4879
+ runType: 'data_question' | 'skill_run';
4880
+ startedAt: string;
4881
+ surface: 'slack' | 'web_chat' | 'mcp';
4882
+ toolsCalled: Array<string>;
4883
+ };
4884
+ path: {
4885
+ orgId: string;
4886
+ };
4887
+ query?: never;
4888
+ url: '/v1/orgs/{orgId}/assistant/runs';
4889
+ };
4890
+ export type AssistantRunsRecordAssistantRunErrors = {
4891
+ /**
4892
+ * BadRequestError
4893
+ */
4894
+ 400: BadRequestError;
4895
+ /**
4896
+ * UnauthorizedError
4897
+ */
4898
+ 401: UnauthorizedError;
4899
+ /**
4900
+ * ForbiddenError
4901
+ */
4902
+ 403: ForbiddenError;
4903
+ /**
4904
+ * NotFoundError
4905
+ */
4906
+ 404: NotFoundError;
4907
+ /**
4908
+ * ConflictError
4909
+ */
4910
+ 409: ConflictError;
4911
+ /**
4912
+ * GoneError
4913
+ */
4914
+ 410: GoneError;
4915
+ /**
4916
+ * ContentTooLargeError
4917
+ */
4918
+ 413: ContentTooLargeError;
4919
+ /**
4920
+ * MisdirectedRequestError
4921
+ */
4922
+ 421: MisdirectedRequestError;
4923
+ /**
4924
+ * UnprocessableEntityError
4925
+ */
4926
+ 422: UnprocessableEntityError;
4927
+ /**
4928
+ * TooManyRequestsError
4929
+ */
4930
+ 429: TooManyRequestsError;
4931
+ /**
4932
+ * InternalServerError
4933
+ */
4934
+ 500: InternalServerError;
4935
+ /**
4936
+ * ServiceUnavailableError
4937
+ */
4938
+ 503: ServiceUnavailableError;
4939
+ };
4940
+ export type AssistantRunsRecordAssistantRunError = AssistantRunsRecordAssistantRunErrors[keyof AssistantRunsRecordAssistantRunErrors];
4941
+ export type AssistantRunsRecordAssistantRunResponses = {
4942
+ /**
4943
+ * Success
4944
+ */
4945
+ 201: {
4946
+ code: number;
4947
+ data: {
4948
+ id: string;
4949
+ } | null;
4950
+ error: {
4951
+ code: string;
4952
+ details?: unknown | null;
4953
+ message: string;
4954
+ rowErrors?: Array<{
4955
+ code: string;
4956
+ message: string;
4957
+ path: Array<string | number>;
4958
+ }> | null;
4959
+ } | null;
4960
+ pagination: {
4961
+ limit: number;
4962
+ page: number;
4963
+ total: number;
4964
+ totalPages: number;
4965
+ } | null;
4966
+ sdkBehavior?: {
4967
+ flags: {
4968
+ [key: string]: unknown;
4969
+ };
4970
+ v: number;
4971
+ } | null;
4972
+ success: boolean;
4973
+ };
4974
+ };
4975
+ export type AssistantRunsRecordAssistantRunResponse = AssistantRunsRecordAssistantRunResponses[keyof AssistantRunsRecordAssistantRunResponses];
4526
4976
  export type OrgAuditListOrgAuditEventsData = {
4527
4977
  body?: never;
4528
4978
  path: {
@@ -4609,7 +5059,7 @@ export type OrgAuditListOrgAuditEventsResponses = {
4609
5059
  organizationId: string | null;
4610
5060
  reason: string | null;
4611
5061
  resourceId: string;
4612
- resourceType: 'role' | 'organization' | 'organization_invitation' | 'workspace' | 'platform_setting' | 'api_key';
5062
+ resourceType: 'role' | 'organization' | 'organization_invitation' | 'workspace' | 'platform_setting' | 'api_key' | 'assistant_run';
4613
5063
  scope: 'organization' | 'system';
4614
5064
  workspaceId: string | null;
4615
5065
  }>;
@@ -7851,6 +8301,111 @@ export type OrganizationsUpsertProjectMemberForOrgResponses = {
7851
8301
  };
7852
8302
  };
7853
8303
  export type OrganizationsUpsertProjectMemberForOrgResponse = OrganizationsUpsertProjectMemberForOrgResponses[keyof OrganizationsUpsertProjectMemberForOrgResponses];
8304
+ export type OrgPromptsListOrgPromptsData = {
8305
+ body?: never;
8306
+ path: {
8307
+ orgId: string;
8308
+ };
8309
+ query?: {
8310
+ /**
8311
+ * `skill`, the only kind listed org-wide (and the default when omitted).
8312
+ */
8313
+ kind?: 'skill' | null;
8314
+ /**
8315
+ * Case-insensitive substring of the skill's name or slug. Matched as a bound parameter, with `%`, `_` and `\` taken literally.
8316
+ */
8317
+ query?: string | null;
8318
+ /**
8319
+ * At most this many rows across the org (default 20, max 50).
8320
+ */
8321
+ limit?: number | null;
8322
+ };
8323
+ url: '/v1/orgs/{orgId}/prompts';
8324
+ };
8325
+ export type OrgPromptsListOrgPromptsErrors = {
8326
+ /**
8327
+ * BadRequestError
8328
+ */
8329
+ 400: BadRequestError;
8330
+ /**
8331
+ * UnauthorizedError
8332
+ */
8333
+ 401: UnauthorizedError;
8334
+ /**
8335
+ * ForbiddenError
8336
+ */
8337
+ 403: ForbiddenError;
8338
+ /**
8339
+ * NotFoundError
8340
+ */
8341
+ 404: NotFoundError;
8342
+ /**
8343
+ * ConflictError
8344
+ */
8345
+ 409: ConflictError;
8346
+ /**
8347
+ * GoneError
8348
+ */
8349
+ 410: GoneError;
8350
+ /**
8351
+ * ContentTooLargeError
8352
+ */
8353
+ 413: ContentTooLargeError;
8354
+ /**
8355
+ * MisdirectedRequestError
8356
+ */
8357
+ 421: MisdirectedRequestError;
8358
+ /**
8359
+ * UnprocessableEntityError
8360
+ */
8361
+ 422: UnprocessableEntityError;
8362
+ /**
8363
+ * TooManyRequestsError
8364
+ */
8365
+ 429: TooManyRequestsError;
8366
+ /**
8367
+ * InternalServerError
8368
+ */
8369
+ 500: InternalServerError;
8370
+ /**
8371
+ * ServiceUnavailableError
8372
+ */
8373
+ 503: ServiceUnavailableError;
8374
+ };
8375
+ export type OrgPromptsListOrgPromptsError = OrgPromptsListOrgPromptsErrors[keyof OrgPromptsListOrgPromptsErrors];
8376
+ export type OrgPromptsListOrgPromptsResponses = {
8377
+ /**
8378
+ * Success
8379
+ */
8380
+ 200: {
8381
+ code: number;
8382
+ data: OrgPromptsResponse | null;
8383
+ error: {
8384
+ code: string;
8385
+ details?: unknown | null;
8386
+ message: string;
8387
+ rowErrors?: Array<{
8388
+ code: string;
8389
+ message: string;
8390
+ path: Array<string | number>;
8391
+ }> | null;
8392
+ } | null;
8393
+ pagination: {
8394
+ limit: number;
8395
+ page: number;
8396
+ total: number;
8397
+ totalPages: number;
8398
+ } | null;
8399
+ sdkBehavior?: {
8400
+ flags: {
8401
+ [key: string]: unknown;
8402
+ };
8403
+ v: number;
8404
+ } | null;
8405
+ success: boolean;
8406
+ };
8407
+ };
8408
+ export type OrgPromptsListOrgPromptsResponse = OrgPromptsListOrgPromptsResponses[keyof OrgPromptsListOrgPromptsResponses];
7854
8409
  export type RbacIntrospectEffectivePermissionsData = {
7855
8410
  body?: never;
7856
8411
  path: {
@@ -8695,39 +9250,7 @@ export type UsageListTopTracesResponses = {
8695
9250
  */
8696
9251
  200: {
8697
9252
  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;
9253
+ data: TopTracesResponse | null;
8731
9254
  error: {
8732
9255
  code: string;
8733
9256
  details?: unknown | null;
@@ -8833,106 +9356,7 @@ export type UsageGetUsageCostsResponses = {
8833
9356
  */
8834
9357
  200: {
8835
9358
  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;
9359
+ data: UsageCostsResponse | null;
8936
9360
  error: {
8937
9361
  code: string;
8938
9362
  details?: unknown | null;
@@ -9027,16 +9451,7 @@ export type UsageListUsagePrincipalsResponses = {
9027
9451
  */
9028
9452
  200: {
9029
9453
  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;
9454
+ data: UsagePrincipalsResponse | null;
9040
9455
  error: {
9041
9456
  code: string;
9042
9457
  details?: unknown | null;
@@ -9146,191 +9561,7 @@ export type UsageListUsageSessionsResponses = {
9146
9561
  */
9147
9562
  200: {
9148
9563
  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;
9564
+ data: UsageSessionsResponse | null;
9334
9565
  error: {
9335
9566
  code: string;
9336
9567
  details?: unknown | null;