@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.
@@ -150,6 +150,24 @@ export const zOAuthCredential = z.object({
150
150
  type: z.enum(['oauth'])
151
151
  });
152
152
 
153
+ export const zOrgPromptRow = z.object({
154
+ description: z.string().nullable(),
155
+ name: z.string(),
156
+ projectId: z.string(),
157
+ projectName: z.string(),
158
+ promptId: z.string(),
159
+ slug: z.string(),
160
+ version: z.int().gte(-9007199254740991).lte(9007199254740991)
161
+ });
162
+
163
+ export const zOrgPromptsResponse = z.object({
164
+ excludedProjects: z.array(z.object({
165
+ projectId: z.string(),
166
+ reason: z.enum(['other_data_center'])
167
+ })),
168
+ items: z.array(zOrgPromptRow)
169
+ });
170
+
153
171
  export const zPrincipalApiKeyContextInvariant = z.object({
154
172
  actorType: z.enum(['oidc', 'api_key']).nullish(),
155
173
  apiKey: z.object({
@@ -267,7 +285,7 @@ export const zRenderedSkill = z.object({
267
285
  format: z.enum(['skill']),
268
286
  label: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
269
287
  promptId: z.string(),
270
- version: z.number(),
288
+ version: z.int().gte(-9007199254740991).lte(9007199254740991),
271
289
  versionId: z.string()
272
290
  });
273
291
 
@@ -276,7 +294,7 @@ export const zRenderedSkillVersion = z.object({
276
294
  files: z.array(zRenderedSkillFile),
277
295
  format: z.enum(['skill']),
278
296
  promptId: z.string(),
279
- version: z.number(),
297
+ version: z.int().gte(-9007199254740991).lte(9007199254740991),
280
298
  versionId: z.string()
281
299
  });
282
300
 
@@ -511,6 +529,54 @@ export const zTooManyRequestsError = z.object({
511
529
  success: z.literal(false)
512
530
  });
513
531
 
532
+ export const zTopTracesResponse = z.object({
533
+ excludedProjects: z.array(z.object({
534
+ projectId: z.string(),
535
+ reason: z.enum(['other_data_center'])
536
+ })),
537
+ items: z.array(z.object({
538
+ apiEquivalentUsd: z.number().nullable(),
539
+ billedUsd: z.number().nullable(),
540
+ durationMs: z.number(),
541
+ inputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
542
+ model: z.string(),
543
+ outputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
544
+ projectId: z.string(),
545
+ provider: z.string(),
546
+ sessionId: z.string().nullable(),
547
+ sessionLink: z.string().nullable(),
548
+ startTime: z.string(),
549
+ status: z.enum([
550
+ 'ok',
551
+ 'error',
552
+ 'timeout'
553
+ ]),
554
+ totalTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
555
+ traceId: z.string()
556
+ })),
557
+ sort: z.enum([
558
+ 'latency',
559
+ 'cost',
560
+ 'tokens'
561
+ ]),
562
+ window: z.object({
563
+ from: z.string(),
564
+ n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
565
+ preset: z.enum([
566
+ 'last_n_hours',
567
+ 'last_n_days',
568
+ 'today',
569
+ 'yesterday',
570
+ 'this_week',
571
+ 'last_week',
572
+ 'this_month',
573
+ 'last_month'
574
+ ]).nullish(),
575
+ timezone: z.string().nullish(),
576
+ to: z.string()
577
+ })
578
+ });
579
+
514
580
  export const zUnauthorizedError = z.object({
515
581
  _tag: z.enum(['UnauthorizedError']),
516
582
  code: z.number(),
@@ -543,6 +609,311 @@ export const zUnprocessableEntityError = z.object({
543
609
  success: z.literal(false)
544
610
  });
545
611
 
612
+ export const zUsageCostsResponse = z.object({
613
+ byProvider: z.array(z.object({
614
+ apiEquivalentUsd: z.number().nullable(),
615
+ billedUsd: z.number().nullable(),
616
+ provider: z.string(),
617
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
618
+ tokens: z.object({
619
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
620
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
621
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
622
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
623
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
624
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
625
+ }),
626
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
627
+ })).nullish(),
628
+ excludedProjects: z.array(z.object({
629
+ projectId: z.string(),
630
+ reason: z.enum(['other_data_center'])
631
+ })),
632
+ groupBy: z.array(z.enum([
633
+ 'principal',
634
+ 'vendor',
635
+ 'provider',
636
+ 'model',
637
+ 'project',
638
+ 'billingMode'
639
+ ])),
640
+ groups: z.array(z.object({
641
+ apiEquivalentUsd: z.number().nullable(),
642
+ billedUsd: z.number().nullable(),
643
+ billingMode: z.enum([
644
+ 'subscription',
645
+ 'api',
646
+ 'unknown'
647
+ ]).nullish(),
648
+ model: z.string().nullish(),
649
+ principal: z.object({
650
+ displayName: z.string().nullable(),
651
+ id: z.string()
652
+ }).nullish(),
653
+ project: z.object({
654
+ id: z.string(),
655
+ name: z.string()
656
+ }).nullish(),
657
+ provider: z.string().nullish(),
658
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
659
+ tokens: z.object({
660
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
661
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
662
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
663
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
664
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
665
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
666
+ }),
667
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991),
668
+ vendor: z.string().nullish()
669
+ })),
670
+ otherGroups: z.int().gte(-9007199254740991).lte(9007199254740991),
671
+ totals: z.object({
672
+ apiEquivalentUsd: z.number().nullable(),
673
+ billedUsd: z.number().nullable(),
674
+ byBillingMode: z.array(z.object({
675
+ apiEquivalentUsd: z.number().nullable(),
676
+ billedUsd: z.number().nullable(),
677
+ billingMode: z.enum([
678
+ 'subscription',
679
+ 'api',
680
+ 'unknown'
681
+ ]),
682
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
683
+ tokens: z.object({
684
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
685
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
686
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
687
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
688
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
689
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
690
+ }),
691
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
692
+ })),
693
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
694
+ tokens: z.object({
695
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
696
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
697
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
698
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
699
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
700
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
701
+ }),
702
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
703
+ }),
704
+ window: z.object({
705
+ from: z.string(),
706
+ n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
707
+ preset: z.enum([
708
+ 'last_n_hours',
709
+ 'last_n_days',
710
+ 'today',
711
+ 'yesterday',
712
+ 'this_week',
713
+ 'last_week',
714
+ 'this_month',
715
+ 'last_month'
716
+ ]).nullish(),
717
+ timezone: z.string().nullish(),
718
+ to: z.string()
719
+ })
720
+ });
721
+
722
+ export const zUsagePrincipalsResponse = z.object({
723
+ excludedProjects: z.array(z.object({
724
+ projectId: z.string(),
725
+ reason: z.enum(['other_data_center'])
726
+ })),
727
+ items: z.array(z.object({
728
+ displayName: z.string(),
729
+ principalId: z.string()
730
+ }))
731
+ });
732
+
733
+ export const zUsageSessionsResponse = z.object({
734
+ excludedProjects: z.array(z.object({
735
+ projectId: z.string(),
736
+ reason: z.enum(['other_data_center'])
737
+ })),
738
+ groupBy: z.enum(['session', 'run']),
739
+ pagination: z.object({
740
+ limit: z.int().gte(1).lte(100),
741
+ nextCursor: z.string().nullable()
742
+ }),
743
+ runs: z.array(z.object({
744
+ apiEquivalentUsd: z.number().nullable(),
745
+ billedUsd: z.number().nullable(),
746
+ byBillingMode: z.array(z.object({
747
+ apiEquivalentUsd: z.number().nullable(),
748
+ billedUsd: z.number().nullable(),
749
+ billingMode: z.enum([
750
+ 'subscription',
751
+ 'api',
752
+ 'unknown'
753
+ ]),
754
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
755
+ tokens: z.object({
756
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
757
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
758
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
759
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
760
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
761
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
762
+ }),
763
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
764
+ })),
765
+ conversationId: z.string(),
766
+ firstSeen: z.string(),
767
+ lastActivity: z.string(),
768
+ models: z.array(z.string()),
769
+ owner: z.object({
770
+ displayName: z.string().nullable(),
771
+ id: z.string()
772
+ }).nullable(),
773
+ projectId: z.string(),
774
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
775
+ startedInWindow: z.boolean(),
776
+ tokens: z.object({
777
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
778
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
779
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
780
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
781
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
782
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
783
+ }),
784
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
785
+ })).nullish(),
786
+ sessions: z.array(z.object({
787
+ apiEquivalentUsd: z.number().nullable(),
788
+ billedUsd: z.number().nullable(),
789
+ byBillingMode: z.array(z.object({
790
+ apiEquivalentUsd: z.number().nullable(),
791
+ billedUsd: z.number().nullable(),
792
+ billingMode: z.enum([
793
+ 'subscription',
794
+ 'api',
795
+ 'unknown'
796
+ ]),
797
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
798
+ tokens: z.object({
799
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
800
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
801
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
802
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
803
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
804
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
805
+ }),
806
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
807
+ })),
808
+ firstSeen: z.string(),
809
+ lastActivity: z.string(),
810
+ link: z.string(),
811
+ models: z.array(z.string()),
812
+ owner: z.object({
813
+ displayName: z.string().nullable(),
814
+ id: z.string()
815
+ }).nullable(),
816
+ projectId: z.string(),
817
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
818
+ sessionId: z.string(),
819
+ startedInWindow: z.boolean(),
820
+ tokens: z.object({
821
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
822
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
823
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
824
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
825
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
826
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
827
+ }),
828
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
829
+ })).nullish(),
830
+ totals: z.object({
831
+ active: z.int().gte(-9007199254740991).lte(9007199254740991),
832
+ apiEquivalentUsd: z.number().nullable(),
833
+ billedUsd: z.number().nullable(),
834
+ byBillingMode: z.array(z.object({
835
+ apiEquivalentUsd: z.number().nullable(),
836
+ billedUsd: z.number().nullable(),
837
+ billingMode: z.enum([
838
+ 'subscription',
839
+ 'api',
840
+ 'unknown'
841
+ ]),
842
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
843
+ tokens: z.object({
844
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
845
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
846
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
847
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
848
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
849
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
850
+ }),
851
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
852
+ })),
853
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
854
+ startedInWindow: z.int().gte(-9007199254740991).lte(9007199254740991),
855
+ tokens: z.object({
856
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
857
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
858
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
859
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
860
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
861
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
862
+ }),
863
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
864
+ }),
865
+ ungrouped: z.object({
866
+ apiEquivalentUsd: z.number().nullable(),
867
+ billedUsd: z.number().nullable(),
868
+ byBillingMode: z.array(z.object({
869
+ apiEquivalentUsd: z.number().nullable(),
870
+ billedUsd: z.number().nullable(),
871
+ billingMode: z.enum([
872
+ 'subscription',
873
+ 'api',
874
+ 'unknown'
875
+ ]),
876
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
877
+ tokens: z.object({
878
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
879
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
880
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
881
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
882
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
883
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
884
+ }),
885
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
886
+ })),
887
+ label: z.string(),
888
+ requests: z.int().gte(-9007199254740991).lte(9007199254740991),
889
+ tokens: z.object({
890
+ cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
891
+ cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
892
+ input: z.int().gte(-9007199254740991).lte(9007199254740991),
893
+ output: z.int().gte(-9007199254740991).lte(9007199254740991),
894
+ reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
895
+ total: z.int().gte(-9007199254740991).lte(9007199254740991)
896
+ }),
897
+ unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
898
+ }),
899
+ window: z.object({
900
+ from: z.string(),
901
+ n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
902
+ preset: z.enum([
903
+ 'last_n_hours',
904
+ 'last_n_days',
905
+ 'today',
906
+ 'yesterday',
907
+ 'this_week',
908
+ 'last_week',
909
+ 'this_month',
910
+ 'last_month'
911
+ ]).nullish(),
912
+ timezone: z.string().nullish(),
913
+ to: z.string()
914
+ })
915
+ });
916
+
546
917
  /**
547
918
  * Success
548
919
  */
@@ -2398,6 +2769,66 @@ export const zOrganizationsUpdateOrganizationResponse = z.object({
2398
2769
  success: z.boolean()
2399
2770
  });
2400
2771
 
2772
+ export const zAssistantRunsRecordAssistantRunBody = z.object({
2773
+ finishedAt: z.string().min(1).max(64),
2774
+ model: z.string().min(1).max(64),
2775
+ outcome: z.enum([
2776
+ 'answered',
2777
+ 'limit_tool_rounds',
2778
+ 'limit_wall_clock',
2779
+ 'limit_output_tokens',
2780
+ 'refused',
2781
+ 'credential_expired',
2782
+ 'model_error',
2783
+ 'disabled',
2784
+ 'superseded'
2785
+ ]),
2786
+ runId: z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/),
2787
+ runType: z.enum(['data_question', 'skill_run']),
2788
+ startedAt: z.string().min(1).max(64),
2789
+ surface: z.enum([
2790
+ 'slack',
2791
+ 'web_chat',
2792
+ 'mcp'
2793
+ ]),
2794
+ toolsCalled: z.array(z.string().min(1).max(64).regex(/^[a-z0-9_]+$/)).max(64)
2795
+ });
2796
+
2797
+ export const zAssistantRunsRecordAssistantRunPath = z.object({
2798
+ orgId: z.string().min(1)
2799
+ });
2800
+
2801
+ /**
2802
+ * Success
2803
+ */
2804
+ export const zAssistantRunsRecordAssistantRunResponse = z.object({
2805
+ code: z.number(),
2806
+ data: z.object({
2807
+ id: z.string()
2808
+ }).nullable(),
2809
+ error: z.object({
2810
+ code: z.string(),
2811
+ details: z.unknown().nullish(),
2812
+ message: z.string(),
2813
+ rowErrors: z.array(z.object({
2814
+ code: z.string(),
2815
+ message: z.string(),
2816
+ path: z.array(z.union([z.string(), z.number()]))
2817
+ })).nullish()
2818
+ }).nullable(),
2819
+ pagination: z.object({
2820
+ limit: z.int().gte(1).lte(100),
2821
+ page: z.int().gte(1).lte(9007199254740991),
2822
+ total: z.int().gte(0).lte(9007199254740991),
2823
+ totalPages: z.int().gte(0).lte(9007199254740991)
2824
+ }).nullable(),
2825
+ sdkBehavior: z.object({
2826
+ flags: z.record(z.string(), z.unknown()),
2827
+ v: z.int().gte(1).lte(9007199254740991)
2828
+ }).nullish(),
2829
+ success: z.boolean()
2830
+ });
2831
+
2401
2832
  export const zOrgAuditListOrgAuditEventsPath = z.object({
2402
2833
  orgId: z.string().min(1)
2403
2834
  });
@@ -2440,7 +2871,8 @@ export const zOrgAuditListOrgAuditEventsResponse = z.object({
2440
2871
  'organization_invitation',
2441
2872
  'workspace',
2442
2873
  'platform_setting',
2443
- 'api_key'
2874
+ 'api_key',
2875
+ 'assistant_run'
2444
2876
  ]),
2445
2877
  scope: z.enum(['organization', 'system']),
2446
2878
  workspaceId: z.string().nullable()
@@ -4057,6 +4489,45 @@ export const zOrganizationsUpsertProjectMemberForOrgResponse = z.object({
4057
4489
  success: z.boolean()
4058
4490
  });
4059
4491
 
4492
+ export const zOrgPromptsListOrgPromptsPath = z.object({
4493
+ orgId: z.string().min(1)
4494
+ });
4495
+
4496
+ export const zOrgPromptsListOrgPromptsQuery = z.object({
4497
+ kind: z.enum(['skill']).nullish(),
4498
+ query: z.string().min(1).max(100).nullish(),
4499
+ limit: z.int().nullish()
4500
+ });
4501
+
4502
+ /**
4503
+ * Success
4504
+ */
4505
+ export const zOrgPromptsListOrgPromptsResponse = z.object({
4506
+ code: z.number(),
4507
+ data: zOrgPromptsResponse.nullable(),
4508
+ error: z.object({
4509
+ code: z.string(),
4510
+ details: z.unknown().nullish(),
4511
+ message: z.string(),
4512
+ rowErrors: z.array(z.object({
4513
+ code: z.string(),
4514
+ message: z.string(),
4515
+ path: z.array(z.union([z.string(), z.number()]))
4516
+ })).nullish()
4517
+ }).nullable(),
4518
+ pagination: z.object({
4519
+ limit: z.int().gte(1).lte(100),
4520
+ page: z.int().gte(1).lte(9007199254740991),
4521
+ total: z.int().gte(0).lte(9007199254740991),
4522
+ totalPages: z.int().gte(0).lte(9007199254740991)
4523
+ }).nullable(),
4524
+ sdkBehavior: z.object({
4525
+ flags: z.record(z.string(), z.unknown()),
4526
+ v: z.int().gte(1).lte(9007199254740991)
4527
+ }).nullish(),
4528
+ success: z.boolean()
4529
+ });
4530
+
4060
4531
  export const zRbacIntrospectEffectivePermissionsPath = z.object({
4061
4532
  orgId: z.string()
4062
4533
  });
@@ -4478,53 +4949,7 @@ export const zUsageListTopTracesQuery = z.object({
4478
4949
  */
4479
4950
  export const zUsageListTopTracesResponse = z.object({
4480
4951
  code: z.number(),
4481
- data: z.object({
4482
- excludedProjects: z.array(z.object({
4483
- projectId: z.string(),
4484
- reason: z.enum(['other_data_center'])
4485
- })),
4486
- items: z.array(z.object({
4487
- apiEquivalentUsd: z.number().nullable(),
4488
- billedUsd: z.number().nullable(),
4489
- durationMs: z.number(),
4490
- inputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
4491
- model: z.string(),
4492
- outputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
4493
- projectId: z.string(),
4494
- provider: z.string(),
4495
- sessionId: z.string().nullable(),
4496
- sessionLink: z.string().nullable(),
4497
- startTime: z.string(),
4498
- status: z.enum([
4499
- 'ok',
4500
- 'error',
4501
- 'timeout'
4502
- ]),
4503
- totalTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
4504
- traceId: z.string()
4505
- })),
4506
- sort: z.enum([
4507
- 'latency',
4508
- 'cost',
4509
- 'tokens'
4510
- ]),
4511
- window: z.object({
4512
- from: z.string(),
4513
- n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
4514
- preset: z.enum([
4515
- 'last_n_hours',
4516
- 'last_n_days',
4517
- 'today',
4518
- 'yesterday',
4519
- 'this_week',
4520
- 'last_week',
4521
- 'this_month',
4522
- 'last_month'
4523
- ]).nullish(),
4524
- timezone: z.string().nullish(),
4525
- to: z.string()
4526
- })
4527
- }).nullable(),
4952
+ data: zTopTracesResponse.nullable(),
4528
4953
  error: z.object({
4529
4954
  code: z.string(),
4530
4955
  details: z.unknown().nullish(),
@@ -4603,115 +5028,7 @@ export const zUsageGetUsageCostsQuery = z.object({
4603
5028
  */
4604
5029
  export const zUsageGetUsageCostsResponse = z.object({
4605
5030
  code: z.number(),
4606
- data: z.object({
4607
- byProvider: z.array(z.object({
4608
- apiEquivalentUsd: z.number().nullable(),
4609
- billedUsd: z.number().nullable(),
4610
- provider: z.string(),
4611
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4612
- tokens: z.object({
4613
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4614
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4615
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4616
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4617
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4618
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4619
- }),
4620
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4621
- })).nullish(),
4622
- excludedProjects: z.array(z.object({
4623
- projectId: z.string(),
4624
- reason: z.enum(['other_data_center'])
4625
- })),
4626
- groupBy: z.array(z.enum([
4627
- 'principal',
4628
- 'vendor',
4629
- 'provider',
4630
- 'model',
4631
- 'project',
4632
- 'billingMode'
4633
- ])),
4634
- groups: z.array(z.object({
4635
- apiEquivalentUsd: z.number().nullable(),
4636
- billedUsd: z.number().nullable(),
4637
- billingMode: z.enum([
4638
- 'subscription',
4639
- 'api',
4640
- 'unknown'
4641
- ]).nullish(),
4642
- model: z.string().nullish(),
4643
- principal: z.object({
4644
- displayName: z.string().nullable(),
4645
- id: z.string()
4646
- }).nullish(),
4647
- project: z.object({
4648
- id: z.string(),
4649
- name: z.string()
4650
- }).nullish(),
4651
- provider: z.string().nullish(),
4652
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4653
- tokens: z.object({
4654
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4655
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4656
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4657
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4658
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4659
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4660
- }),
4661
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991),
4662
- vendor: z.string().nullish()
4663
- })),
4664
- otherGroups: z.int().gte(-9007199254740991).lte(9007199254740991),
4665
- totals: z.object({
4666
- apiEquivalentUsd: z.number().nullable(),
4667
- billedUsd: z.number().nullable(),
4668
- byBillingMode: z.array(z.object({
4669
- apiEquivalentUsd: z.number().nullable(),
4670
- billedUsd: z.number().nullable(),
4671
- billingMode: z.enum([
4672
- 'subscription',
4673
- 'api',
4674
- 'unknown'
4675
- ]),
4676
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4677
- tokens: z.object({
4678
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4679
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4680
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4681
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4682
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4683
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4684
- }),
4685
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4686
- })),
4687
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4688
- tokens: z.object({
4689
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4690
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4691
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4692
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4693
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4694
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4695
- }),
4696
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4697
- }),
4698
- window: z.object({
4699
- from: z.string(),
4700
- n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
4701
- preset: z.enum([
4702
- 'last_n_hours',
4703
- 'last_n_days',
4704
- 'today',
4705
- 'yesterday',
4706
- 'this_week',
4707
- 'last_week',
4708
- 'this_month',
4709
- 'last_month'
4710
- ]).nullish(),
4711
- timezone: z.string().nullish(),
4712
- to: z.string()
4713
- })
4714
- }).nullable(),
5031
+ data: zUsageCostsResponse.nullable(),
4715
5032
  error: z.object({
4716
5033
  code: z.string(),
4717
5034
  details: z.unknown().nullish(),
@@ -4749,16 +5066,7 @@ export const zUsageListUsagePrincipalsQuery = z.object({
4749
5066
  */
4750
5067
  export const zUsageListUsagePrincipalsResponse = z.object({
4751
5068
  code: z.number(),
4752
- data: z.object({
4753
- excludedProjects: z.array(z.object({
4754
- projectId: z.string(),
4755
- reason: z.enum(['other_data_center'])
4756
- })),
4757
- items: z.array(z.object({
4758
- displayName: z.string(),
4759
- principalId: z.string()
4760
- }))
4761
- }).nullable(),
5069
+ data: zUsagePrincipalsResponse.nullable(),
4762
5070
  error: z.object({
4763
5071
  code: z.string(),
4764
5072
  details: z.unknown().nullish(),
@@ -4818,189 +5126,7 @@ export const zUsageListUsageSessionsQuery = z.object({
4818
5126
  */
4819
5127
  export const zUsageListUsageSessionsResponse = z.object({
4820
5128
  code: z.number(),
4821
- data: z.object({
4822
- excludedProjects: z.array(z.object({
4823
- projectId: z.string(),
4824
- reason: z.enum(['other_data_center'])
4825
- })),
4826
- groupBy: z.enum(['session', 'run']),
4827
- pagination: z.object({
4828
- limit: z.int().gte(1).lte(100),
4829
- nextCursor: z.string().nullable()
4830
- }),
4831
- runs: z.array(z.object({
4832
- apiEquivalentUsd: z.number().nullable(),
4833
- billedUsd: z.number().nullable(),
4834
- byBillingMode: z.array(z.object({
4835
- apiEquivalentUsd: z.number().nullable(),
4836
- billedUsd: z.number().nullable(),
4837
- billingMode: z.enum([
4838
- 'subscription',
4839
- 'api',
4840
- 'unknown'
4841
- ]),
4842
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4843
- tokens: z.object({
4844
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4845
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4846
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4847
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4848
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4849
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4850
- }),
4851
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4852
- })),
4853
- conversationId: z.string(),
4854
- firstSeen: z.string(),
4855
- lastActivity: z.string(),
4856
- models: z.array(z.string()),
4857
- owner: z.object({
4858
- displayName: z.string().nullable(),
4859
- id: z.string()
4860
- }).nullable(),
4861
- projectId: z.string(),
4862
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4863
- startedInWindow: z.boolean(),
4864
- tokens: z.object({
4865
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4866
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4867
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4868
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4869
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4870
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4871
- }),
4872
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4873
- })).nullish(),
4874
- sessions: z.array(z.object({
4875
- apiEquivalentUsd: z.number().nullable(),
4876
- billedUsd: z.number().nullable(),
4877
- byBillingMode: z.array(z.object({
4878
- apiEquivalentUsd: z.number().nullable(),
4879
- billedUsd: z.number().nullable(),
4880
- billingMode: z.enum([
4881
- 'subscription',
4882
- 'api',
4883
- 'unknown'
4884
- ]),
4885
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4886
- tokens: z.object({
4887
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4888
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4889
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4890
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4891
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4892
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4893
- }),
4894
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4895
- })),
4896
- firstSeen: z.string(),
4897
- lastActivity: z.string(),
4898
- link: z.string(),
4899
- models: z.array(z.string()),
4900
- owner: z.object({
4901
- displayName: z.string().nullable(),
4902
- id: z.string()
4903
- }).nullable(),
4904
- projectId: z.string(),
4905
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4906
- sessionId: z.string(),
4907
- startedInWindow: z.boolean(),
4908
- tokens: z.object({
4909
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4910
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4911
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4912
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4913
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4914
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4915
- }),
4916
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4917
- })).nullish(),
4918
- totals: z.object({
4919
- active: z.int().gte(-9007199254740991).lte(9007199254740991),
4920
- apiEquivalentUsd: z.number().nullable(),
4921
- billedUsd: z.number().nullable(),
4922
- byBillingMode: z.array(z.object({
4923
- apiEquivalentUsd: z.number().nullable(),
4924
- billedUsd: z.number().nullable(),
4925
- billingMode: z.enum([
4926
- 'subscription',
4927
- 'api',
4928
- 'unknown'
4929
- ]),
4930
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4931
- tokens: z.object({
4932
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4933
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4934
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4935
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4936
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4937
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4938
- }),
4939
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4940
- })),
4941
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4942
- startedInWindow: z.int().gte(-9007199254740991).lte(9007199254740991),
4943
- tokens: z.object({
4944
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4945
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4946
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4947
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4948
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4949
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4950
- }),
4951
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4952
- }),
4953
- ungrouped: z.object({
4954
- apiEquivalentUsd: z.number().nullable(),
4955
- billedUsd: z.number().nullable(),
4956
- byBillingMode: z.array(z.object({
4957
- apiEquivalentUsd: z.number().nullable(),
4958
- billedUsd: z.number().nullable(),
4959
- billingMode: z.enum([
4960
- 'subscription',
4961
- 'api',
4962
- 'unknown'
4963
- ]),
4964
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4965
- tokens: z.object({
4966
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4967
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4968
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4969
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4970
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4971
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4972
- }),
4973
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4974
- })),
4975
- label: z.string(),
4976
- requests: z.int().gte(-9007199254740991).lte(9007199254740991),
4977
- tokens: z.object({
4978
- cacheRead: z.int().gte(-9007199254740991).lte(9007199254740991),
4979
- cacheWrite: z.int().gte(-9007199254740991).lte(9007199254740991),
4980
- input: z.int().gte(-9007199254740991).lte(9007199254740991),
4981
- output: z.int().gte(-9007199254740991).lte(9007199254740991),
4982
- reasoning: z.int().gte(-9007199254740991).lte(9007199254740991),
4983
- total: z.int().gte(-9007199254740991).lte(9007199254740991)
4984
- }),
4985
- unpricedRequests: z.int().gte(-9007199254740991).lte(9007199254740991)
4986
- }),
4987
- window: z.object({
4988
- from: z.string(),
4989
- n: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
4990
- preset: z.enum([
4991
- 'last_n_hours',
4992
- 'last_n_days',
4993
- 'today',
4994
- 'yesterday',
4995
- 'this_week',
4996
- 'last_week',
4997
- 'this_month',
4998
- 'last_month'
4999
- ]).nullish(),
5000
- timezone: z.string().nullish(),
5001
- to: z.string()
5002
- })
5003
- }).nullable(),
5129
+ data: zUsageSessionsResponse.nullable(),
5004
5130
  error: z.object({
5005
5131
  code: z.string(),
5006
5132
  details: z.unknown().nullish(),