@leaflow/sdk 0.0.0-dev.449.gb0894d4 → 0.0.0-dev.451.gfd4baf5

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.
@@ -712,11 +712,31 @@ export interface CursorPageRequestResource {
712
712
  }
713
713
  export interface APIKeyUsageResource {
714
714
  api_key_id: string;
715
- cache_read_tokens: number;
716
- cache_write_tokens: number;
717
- input_tokens: number;
718
- output_tokens: number;
719
- reasoning_tokens: number;
715
+ /**
716
+ * Null when this range has no token usage.
717
+ * @nullable
718
+ */
719
+ cache_read_tokens: number | null;
720
+ /**
721
+ * Null when this range has no token usage.
722
+ * @nullable
723
+ */
724
+ cache_write_tokens: number | null;
725
+ /**
726
+ * Null when this range has no token usage.
727
+ * @nullable
728
+ */
729
+ input_tokens: number | null;
730
+ /**
731
+ * Null when this range has no token usage.
732
+ * @nullable
733
+ */
734
+ output_tokens: number | null;
735
+ /**
736
+ * Null when this range has no token usage.
737
+ * @nullable
738
+ */
739
+ reasoning_tokens: number | null;
720
740
  /** Media quantities and their rate dimensions. Null when this range has no media usage. */
721
741
  media?: MediaUsage | null;
722
742
  requests: number;
@@ -725,12 +745,32 @@ export interface APIKeyUsageListResponseBody {
725
745
  items: APIKeyUsageResource[];
726
746
  }
727
747
  export interface ModelUsageResource {
728
- cache_read_tokens: number;
729
- cache_write_tokens: number;
730
- input_tokens: number;
748
+ /**
749
+ * Null when this range has no token usage.
750
+ * @nullable
751
+ */
752
+ cache_read_tokens: number | null;
753
+ /**
754
+ * Null when this range has no token usage.
755
+ * @nullable
756
+ */
757
+ cache_write_tokens: number | null;
758
+ /**
759
+ * Null when this range has no token usage.
760
+ * @nullable
761
+ */
762
+ input_tokens: number | null;
731
763
  model_id: string;
732
- output_tokens: number;
733
- reasoning_tokens: number;
764
+ /**
765
+ * Null when this range has no token usage.
766
+ * @nullable
767
+ */
768
+ output_tokens: number | null;
769
+ /**
770
+ * Null when this range has no token usage.
771
+ * @nullable
772
+ */
773
+ reasoning_tokens: number | null;
734
774
  /** Media quantities and their rate dimensions. Null when this range has no media usage. */
735
775
  media?: MediaUsage | null;
736
776
  requests: number;
@@ -739,23 +779,63 @@ export interface ModelUsageListResponseBody {
739
779
  items: ModelUsageResource[];
740
780
  }
741
781
  export interface TotalsResource {
742
- cache_read_tokens: number;
743
- cache_write_tokens: number;
744
- input_tokens: number;
745
- output_tokens: number;
746
- reasoning_tokens: number;
782
+ /**
783
+ * Null when this range has no token usage.
784
+ * @nullable
785
+ */
786
+ cache_read_tokens: number | null;
787
+ /**
788
+ * Null when this range has no token usage.
789
+ * @nullable
790
+ */
791
+ cache_write_tokens: number | null;
792
+ /**
793
+ * Null when this range has no token usage.
794
+ * @nullable
795
+ */
796
+ input_tokens: number | null;
797
+ /**
798
+ * Null when this range has no token usage.
799
+ * @nullable
800
+ */
801
+ output_tokens: number | null;
802
+ /**
803
+ * Null when this range has no token usage.
804
+ * @nullable
805
+ */
806
+ reasoning_tokens: number | null;
747
807
  /** Media quantities and their rate dimensions. Null when this range has no media usage. */
748
808
  media?: MediaUsage | null;
749
809
  requests: number;
750
810
  }
751
811
  export interface UsageBucketResource {
752
- cache_read_tokens: number;
753
- cache_write_tokens: number;
812
+ /**
813
+ * Null when this range has no token usage.
814
+ * @nullable
815
+ */
816
+ cache_read_tokens: number | null;
817
+ /**
818
+ * Null when this range has no token usage.
819
+ * @nullable
820
+ */
821
+ cache_write_tokens: number | null;
754
822
  /** Start of the bucket, inclusive */
755
823
  from: string;
756
- input_tokens: number;
757
- output_tokens: number;
758
- reasoning_tokens: number;
824
+ /**
825
+ * Null when this range has no token usage.
826
+ * @nullable
827
+ */
828
+ input_tokens: number | null;
829
+ /**
830
+ * Null when this range has no token usage.
831
+ * @nullable
832
+ */
833
+ output_tokens: number | null;
834
+ /**
835
+ * Null when this range has no token usage.
836
+ * @nullable
837
+ */
838
+ reasoning_tokens: number | null;
759
839
  /** Media quantities and their rate dimensions. Null when this range has no media usage. */
760
840
  media?: MediaUsage | null;
761
841
  requests: number;
@@ -42,11 +42,11 @@ import * as zod from "zod";
42
42
  export declare const APIKeyUsageListResponseBody: zod.ZodObject<{
43
43
  items: zod.ZodArray<zod.ZodObject<{
44
44
  api_key_id: zod.ZodUUID;
45
- cache_read_tokens: zod.ZodInt;
46
- cache_write_tokens: zod.ZodInt;
47
- input_tokens: zod.ZodInt;
48
- output_tokens: zod.ZodInt;
49
- reasoning_tokens: zod.ZodInt;
45
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
46
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
47
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
48
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
49
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
50
50
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
51
51
  images: zod.ZodInt;
52
52
  audio_characters: zod.ZodInt;
@@ -41,11 +41,11 @@
41
41
  import * as zod from "zod";
42
42
  export declare const APIKeyUsageResource: zod.ZodObject<{
43
43
  api_key_id: zod.ZodUUID;
44
- cache_read_tokens: zod.ZodInt;
45
- cache_write_tokens: zod.ZodInt;
46
- input_tokens: zod.ZodInt;
47
- output_tokens: zod.ZodInt;
48
- reasoning_tokens: zod.ZodInt;
44
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
45
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
46
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
47
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
48
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
49
49
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
50
50
  images: zod.ZodInt;
51
51
  audio_characters: zod.ZodInt;
@@ -42,11 +42,11 @@ import * as zod from "zod";
42
42
  import { MediaUsage } from "./mediaUsage.zod.js";
43
43
  export const APIKeyUsageResource = zod.strictObject({
44
44
  api_key_id: zod.uuid(),
45
- cache_read_tokens: zod.int(),
46
- cache_write_tokens: zod.int(),
47
- input_tokens: zod.int(),
48
- output_tokens: zod.int(),
49
- reasoning_tokens: zod.int(),
45
+ cache_read_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
46
+ cache_write_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
47
+ input_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
48
+ output_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
49
+ reasoning_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
50
50
  media: zod
51
51
  .union([MediaUsage, zod.null()])
52
52
  .optional()
@@ -41,12 +41,12 @@
41
41
  import * as zod from "zod";
42
42
  export declare const ModelUsageListResponseBody: zod.ZodObject<{
43
43
  items: zod.ZodArray<zod.ZodObject<{
44
- cache_read_tokens: zod.ZodInt;
45
- cache_write_tokens: zod.ZodInt;
46
- input_tokens: zod.ZodInt;
44
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
45
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
46
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
47
47
  model_id: zod.ZodString;
48
- output_tokens: zod.ZodInt;
49
- reasoning_tokens: zod.ZodInt;
48
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
49
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
50
50
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
51
51
  images: zod.ZodInt;
52
52
  audio_characters: zod.ZodInt;
@@ -40,12 +40,12 @@
40
40
  */
41
41
  import * as zod from "zod";
42
42
  export declare const ModelUsageResource: zod.ZodObject<{
43
- cache_read_tokens: zod.ZodInt;
44
- cache_write_tokens: zod.ZodInt;
45
- input_tokens: zod.ZodInt;
43
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
44
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
45
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
46
46
  model_id: zod.ZodString;
47
- output_tokens: zod.ZodInt;
48
- reasoning_tokens: zod.ZodInt;
47
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
48
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
49
49
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
50
50
  images: zod.ZodInt;
51
51
  audio_characters: zod.ZodInt;
@@ -41,12 +41,12 @@
41
41
  import * as zod from "zod";
42
42
  import { MediaUsage } from "./mediaUsage.zod.js";
43
43
  export const ModelUsageResource = zod.strictObject({
44
- cache_read_tokens: zod.int(),
45
- cache_write_tokens: zod.int(),
46
- input_tokens: zod.int(),
44
+ cache_read_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
45
+ cache_write_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
46
+ input_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
47
47
  model_id: zod.string(),
48
- output_tokens: zod.int(),
49
- reasoning_tokens: zod.int(),
48
+ output_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
49
+ reasoning_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
50
50
  media: zod
51
51
  .union([MediaUsage, zod.null()])
52
52
  .optional()
@@ -40,11 +40,11 @@
40
40
  */
41
41
  import * as zod from "zod";
42
42
  export declare const TotalsResource: zod.ZodObject<{
43
- cache_read_tokens: zod.ZodInt;
44
- cache_write_tokens: zod.ZodInt;
45
- input_tokens: zod.ZodInt;
46
- output_tokens: zod.ZodInt;
47
- reasoning_tokens: zod.ZodInt;
43
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
44
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
45
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
46
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
47
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
48
48
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
49
49
  images: zod.ZodInt;
50
50
  audio_characters: zod.ZodInt;
@@ -41,11 +41,11 @@
41
41
  import * as zod from "zod";
42
42
  import { MediaUsage } from "./mediaUsage.zod.js";
43
43
  export const TotalsResource = zod.strictObject({
44
- cache_read_tokens: zod.int(),
45
- cache_write_tokens: zod.int(),
46
- input_tokens: zod.int(),
47
- output_tokens: zod.int(),
48
- reasoning_tokens: zod.int(),
44
+ cache_read_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
45
+ cache_write_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
46
+ input_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
47
+ output_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
48
+ reasoning_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
49
49
  media: zod
50
50
  .union([MediaUsage, zod.null()])
51
51
  .optional()
@@ -40,12 +40,12 @@
40
40
  */
41
41
  import * as zod from "zod";
42
42
  export declare const UsageBucketResource: zod.ZodObject<{
43
- cache_read_tokens: zod.ZodInt;
44
- cache_write_tokens: zod.ZodInt;
43
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
44
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
45
45
  from: zod.z.ZodISODateTime;
46
- input_tokens: zod.ZodInt;
47
- output_tokens: zod.ZodInt;
48
- reasoning_tokens: zod.ZodInt;
46
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
47
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
48
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
49
49
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
50
50
  images: zod.ZodInt;
51
51
  audio_characters: zod.ZodInt;
@@ -41,12 +41,12 @@
41
41
  import * as zod from "zod";
42
42
  import { MediaUsage } from "./mediaUsage.zod.js";
43
43
  export const UsageBucketResource = zod.strictObject({
44
- cache_read_tokens: zod.int(),
45
- cache_write_tokens: zod.int(),
44
+ cache_read_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
45
+ cache_write_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
46
46
  from: zod.iso.datetime({ offset: true }).describe("Start of the bucket, inclusive"),
47
- input_tokens: zod.int(),
48
- output_tokens: zod.int(),
49
- reasoning_tokens: zod.int(),
47
+ input_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
48
+ output_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
49
+ reasoning_tokens: zod.int().nullable().describe("Null when this range has no token usage."),
50
50
  media: zod
51
51
  .union([MediaUsage, zod.null()])
52
52
  .optional()
@@ -41,12 +41,12 @@
41
41
  import * as zod from "zod";
42
42
  export declare const UsageTimelineResponseBody: zod.ZodObject<{
43
43
  items: zod.ZodArray<zod.ZodObject<{
44
- cache_read_tokens: zod.ZodInt;
45
- cache_write_tokens: zod.ZodInt;
44
+ cache_read_tokens: zod.ZodNullable<zod.ZodInt>;
45
+ cache_write_tokens: zod.ZodNullable<zod.ZodInt>;
46
46
  from: zod.z.ZodISODateTime;
47
- input_tokens: zod.ZodInt;
48
- output_tokens: zod.ZodInt;
49
- reasoning_tokens: zod.ZodInt;
47
+ input_tokens: zod.ZodNullable<zod.ZodInt>;
48
+ output_tokens: zod.ZodNullable<zod.ZodInt>;
49
+ reasoning_tokens: zod.ZodNullable<zod.ZodInt>;
50
50
  media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
51
51
  images: zod.ZodInt;
52
52
  audio_characters: zod.ZodInt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.449.gb0894d4",
3
+ "version": "0.0.0-dev.451.gfd4baf5",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {