@to11ai/sdk 3.0.0-rc.16 → 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
  });
@@ -4436,6 +4907,249 @@ export const zRbacSetRolePermissionsResponse = z.object({
4436
4907
  success: z.boolean()
4437
4908
  });
4438
4909
 
4910
+ export const zUsageListTopTracesPath = z.object({
4911
+ orgId: z.string().min(1)
4912
+ });
4913
+
4914
+ export const zUsageListTopTracesQuery = z.object({
4915
+ from: z.string().max(64).nullish(),
4916
+ to: z.string().max(64).nullish(),
4917
+ preset: z.enum([
4918
+ 'last_n_hours',
4919
+ 'last_n_days',
4920
+ 'today',
4921
+ 'yesterday',
4922
+ 'this_week',
4923
+ 'last_week',
4924
+ 'this_month',
4925
+ 'last_month'
4926
+ ]).nullish(),
4927
+ n: z.int().nullish(),
4928
+ timezone: z.string().min(1).max(64).nullish(),
4929
+ sort: z.enum([
4930
+ 'latency',
4931
+ 'cost',
4932
+ 'tokens'
4933
+ ]),
4934
+ principalId: z.string().min(1).max(256).nullish(),
4935
+ projectId: z.string().min(1).max(256).nullish(),
4936
+ vendor: z.string().min(1).max(64).nullish(),
4937
+ provider: z.string().min(1).max(64).nullish(),
4938
+ model: z.string().min(1).max(256).nullish(),
4939
+ status: z.enum([
4940
+ 'ok',
4941
+ 'error',
4942
+ 'timeout'
4943
+ ]).nullish(),
4944
+ limit: z.int().nullish()
4945
+ });
4946
+
4947
+ /**
4948
+ * Success
4949
+ */
4950
+ export const zUsageListTopTracesResponse = z.object({
4951
+ code: z.number(),
4952
+ data: zTopTracesResponse.nullable(),
4953
+ error: z.object({
4954
+ code: z.string(),
4955
+ details: z.unknown().nullish(),
4956
+ message: z.string(),
4957
+ rowErrors: z.array(z.object({
4958
+ code: z.string(),
4959
+ message: z.string(),
4960
+ path: z.array(z.union([z.string(), z.number()]))
4961
+ })).nullish()
4962
+ }).nullable(),
4963
+ pagination: z.object({
4964
+ limit: z.int().gte(1).lte(100),
4965
+ page: z.int().gte(1).lte(9007199254740991),
4966
+ total: z.int().gte(0).lte(9007199254740991),
4967
+ totalPages: z.int().gte(0).lte(9007199254740991)
4968
+ }).nullable(),
4969
+ sdkBehavior: z.object({
4970
+ flags: z.record(z.string(), z.unknown()),
4971
+ v: z.int().gte(1).lte(9007199254740991)
4972
+ }).nullish(),
4973
+ success: z.boolean()
4974
+ });
4975
+
4976
+ export const zUsageGetUsageCostsPath = z.object({
4977
+ orgId: z.string().min(1)
4978
+ });
4979
+
4980
+ export const zUsageGetUsageCostsQuery = z.object({
4981
+ from: z.string().max(64).nullish(),
4982
+ to: z.string().max(64).nullish(),
4983
+ preset: z.enum([
4984
+ 'last_n_hours',
4985
+ 'last_n_days',
4986
+ 'today',
4987
+ 'yesterday',
4988
+ 'this_week',
4989
+ 'last_week',
4990
+ 'this_month',
4991
+ 'last_month'
4992
+ ]).nullish(),
4993
+ n: z.int().nullish(),
4994
+ timezone: z.string().min(1).max(64).nullish(),
4995
+ groupBy: z.union([
4996
+ z.enum([
4997
+ 'principal',
4998
+ 'vendor',
4999
+ 'provider',
5000
+ 'model',
5001
+ 'project',
5002
+ 'billingMode'
5003
+ ]),
5004
+ z.array(z.enum([
5005
+ 'principal',
5006
+ 'vendor',
5007
+ 'provider',
5008
+ 'model',
5009
+ 'project',
5010
+ 'billingMode'
5011
+ ])).max(6)
5012
+ ]).nullish(),
5013
+ principalId: z.string().min(1).max(256).nullish(),
5014
+ vendor: z.string().min(1).max(64).nullish(),
5015
+ provider: z.string().min(1).max(64).nullish(),
5016
+ model: z.string().min(1).max(256).nullish(),
5017
+ projectId: z.string().min(1).max(256).nullish(),
5018
+ billingMode: z.enum([
5019
+ 'subscription',
5020
+ 'api',
5021
+ 'unknown'
5022
+ ]).nullish(),
5023
+ limit: z.int().nullish()
5024
+ });
5025
+
5026
+ /**
5027
+ * Success
5028
+ */
5029
+ export const zUsageGetUsageCostsResponse = z.object({
5030
+ code: z.number(),
5031
+ data: zUsageCostsResponse.nullable(),
5032
+ error: z.object({
5033
+ code: z.string(),
5034
+ details: z.unknown().nullish(),
5035
+ message: z.string(),
5036
+ rowErrors: z.array(z.object({
5037
+ code: z.string(),
5038
+ message: z.string(),
5039
+ path: z.array(z.union([z.string(), z.number()]))
5040
+ })).nullish()
5041
+ }).nullable(),
5042
+ pagination: z.object({
5043
+ limit: z.int().gte(1).lte(100),
5044
+ page: z.int().gte(1).lte(9007199254740991),
5045
+ total: z.int().gte(0).lte(9007199254740991),
5046
+ totalPages: z.int().gte(0).lte(9007199254740991)
5047
+ }).nullable(),
5048
+ sdkBehavior: z.object({
5049
+ flags: z.record(z.string(), z.unknown()),
5050
+ v: z.int().gte(1).lte(9007199254740991)
5051
+ }).nullish(),
5052
+ success: z.boolean()
5053
+ });
5054
+
5055
+ export const zUsageListUsagePrincipalsPath = z.object({
5056
+ orgId: z.string().min(1)
5057
+ });
5058
+
5059
+ export const zUsageListUsagePrincipalsQuery = z.object({
5060
+ query: z.string().min(1).max(100).nullish(),
5061
+ email: z.string().min(2).max(320).nullish()
5062
+ });
5063
+
5064
+ /**
5065
+ * Success
5066
+ */
5067
+ export const zUsageListUsagePrincipalsResponse = z.object({
5068
+ code: z.number(),
5069
+ data: zUsagePrincipalsResponse.nullable(),
5070
+ error: z.object({
5071
+ code: z.string(),
5072
+ details: z.unknown().nullish(),
5073
+ message: z.string(),
5074
+ rowErrors: z.array(z.object({
5075
+ code: z.string(),
5076
+ message: z.string(),
5077
+ path: z.array(z.union([z.string(), z.number()]))
5078
+ })).nullish()
5079
+ }).nullable(),
5080
+ pagination: z.object({
5081
+ limit: z.int().gte(1).lte(100),
5082
+ page: z.int().gte(1).lte(9007199254740991),
5083
+ total: z.int().gte(0).lte(9007199254740991),
5084
+ totalPages: z.int().gte(0).lte(9007199254740991)
5085
+ }).nullable(),
5086
+ sdkBehavior: z.object({
5087
+ flags: z.record(z.string(), z.unknown()),
5088
+ v: z.int().gte(1).lte(9007199254740991)
5089
+ }).nullish(),
5090
+ success: z.boolean()
5091
+ });
5092
+
5093
+ export const zUsageListUsageSessionsPath = z.object({
5094
+ orgId: z.string().min(1)
5095
+ });
5096
+
5097
+ export const zUsageListUsageSessionsQuery = z.object({
5098
+ from: z.string().max(64).nullish(),
5099
+ to: z.string().max(64).nullish(),
5100
+ preset: z.enum([
5101
+ 'last_n_hours',
5102
+ 'last_n_days',
5103
+ 'today',
5104
+ 'yesterday',
5105
+ 'this_week',
5106
+ 'last_week',
5107
+ 'this_month',
5108
+ 'last_month'
5109
+ ]).nullish(),
5110
+ n: z.int().nullish(),
5111
+ timezone: z.string().min(1).max(64).nullish(),
5112
+ groupBy: z.enum(['session', 'run']).nullish(),
5113
+ principalId: z.string().min(1).max(256).nullish(),
5114
+ projectId: z.string().min(1).max(256).nullish(),
5115
+ billingMode: z.enum([
5116
+ 'subscription',
5117
+ 'api',
5118
+ 'unknown'
5119
+ ]).nullish(),
5120
+ cursor: z.string().max(2048).nullish(),
5121
+ limit: z.int().nullish()
5122
+ });
5123
+
5124
+ /**
5125
+ * Success
5126
+ */
5127
+ export const zUsageListUsageSessionsResponse = z.object({
5128
+ code: z.number(),
5129
+ data: zUsageSessionsResponse.nullable(),
5130
+ error: z.object({
5131
+ code: z.string(),
5132
+ details: z.unknown().nullish(),
5133
+ message: z.string(),
5134
+ rowErrors: z.array(z.object({
5135
+ code: z.string(),
5136
+ message: z.string(),
5137
+ path: z.array(z.union([z.string(), z.number()]))
5138
+ })).nullish()
5139
+ }).nullable(),
5140
+ pagination: z.object({
5141
+ limit: z.int().gte(1).lte(100),
5142
+ page: z.int().gte(1).lte(9007199254740991),
5143
+ total: z.int().gte(0).lte(9007199254740991),
5144
+ totalPages: z.int().gte(0).lte(9007199254740991)
5145
+ }).nullable(),
5146
+ sdkBehavior: z.object({
5147
+ flags: z.record(z.string(), z.unknown()),
5148
+ v: z.int().gte(1).lte(9007199254740991)
5149
+ }).nullish(),
5150
+ success: z.boolean()
5151
+ });
5152
+
4439
5153
  export const zRbacSetUserPermissionOverridesBody = z.object({
4440
5154
  overrides: z.array(z.object({
4441
5155
  effect: z.enum(['ALLOW', 'DENY']),
@@ -12452,7 +13166,9 @@ export const zTracesListTracesQuery = z.object({
12452
13166
  'model',
12453
13167
  'provider',
12454
13168
  'toolCalls',
12455
- 'costUsd'
13169
+ 'costUsd',
13170
+ 'totalTokens',
13171
+ 'apiEquivalentUsd'
12456
13172
  ]).nullish(),
12457
13173
  order: z.enum(['asc', 'desc']).nullish(),
12458
13174
  status: z.enum([
@@ -12488,6 +13204,8 @@ export const zTracesListTracesQuery = z.object({
12488
13204
  'unknown'
12489
13205
  ]))
12490
13206
  ]).nullish(),
13207
+ principalId: z.string().min(1).max(256).nullish(),
13208
+ vendor: z.string().min(1).max(64).nullish(),
12491
13209
  minTokens: z.string().nullish(),
12492
13210
  maxTokens: z.string().nullish(),
12493
13211
  minCost: z.string().nullish(),
@@ -12719,7 +13437,9 @@ export const zTracesListTracePromptFacetsQuery = z.object({
12719
13437
  'model',
12720
13438
  'provider',
12721
13439
  'toolCalls',
12722
- 'costUsd'
13440
+ 'costUsd',
13441
+ 'totalTokens',
13442
+ 'apiEquivalentUsd'
12723
13443
  ]).nullish(),
12724
13444
  order: z.enum(['asc', 'desc']).nullish(),
12725
13445
  status: z.enum([
@@ -12755,6 +13475,8 @@ export const zTracesListTracePromptFacetsQuery = z.object({
12755
13475
  'unknown'
12756
13476
  ]))
12757
13477
  ]).nullish(),
13478
+ principalId: z.string().min(1).max(256).nullish(),
13479
+ vendor: z.string().min(1).max(64).nullish(),
12758
13480
  minTokens: z.string().nullish(),
12759
13481
  maxTokens: z.string().nullish(),
12760
13482
  minCost: z.string().nullish(),