@openrouter/sdk 0.0.0-beta.37 → 0.0.0-beta.38

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.
Files changed (113) hide show
  1. package/dist/commonjs/funcs/betaResponsesSend.d.ts +2 -2
  2. package/dist/commonjs/funcs/betaResponsesSend.d.ts.map +1 -1
  3. package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -1
  4. package/dist/commonjs/lib/config.d.ts +3 -3
  5. package/dist/commonjs/lib/config.js +3 -3
  6. package/dist/commonjs/models/createapikeydata.d.ts +120 -0
  7. package/dist/commonjs/models/createapikeydata.d.ts.map +1 -0
  8. package/dist/commonjs/models/createapikeydata.js +134 -0
  9. package/dist/commonjs/models/createapikeydata.js.map +1 -0
  10. package/dist/commonjs/models/getapikeydata.d.ts +120 -0
  11. package/dist/commonjs/models/getapikeydata.d.ts.map +1 -0
  12. package/dist/commonjs/models/getapikeydata.js +134 -0
  13. package/dist/commonjs/models/getapikeydata.js.map +1 -0
  14. package/dist/commonjs/models/index.d.ts +4 -0
  15. package/dist/commonjs/models/index.d.ts.map +1 -1
  16. package/dist/commonjs/models/index.js +4 -0
  17. package/dist/commonjs/models/index.js.map +1 -1
  18. package/dist/commonjs/models/keyinfo.d.ts +8 -8
  19. package/dist/commonjs/models/listapikeysdata.d.ts +117 -0
  20. package/dist/commonjs/models/listapikeysdata.d.ts.map +1 -0
  21. package/dist/commonjs/models/listapikeysdata.js +134 -0
  22. package/dist/commonjs/models/listapikeysdata.js.map +1 -0
  23. package/dist/commonjs/models/operations/create.d.ts +43 -68
  24. package/dist/commonjs/models/operations/create.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/create.js +31 -54
  26. package/dist/commonjs/models/operations/create.js.map +1 -1
  27. package/dist/commonjs/models/operations/getapikey.d.ts +3 -68
  28. package/dist/commonjs/models/operations/getapikey.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/getapikey.js +4 -55
  30. package/dist/commonjs/models/operations/getapikey.js.map +1 -1
  31. package/dist/commonjs/models/operations/listapikeys.d.ts +3 -65
  32. package/dist/commonjs/models/operations/listapikeys.d.ts.map +1 -1
  33. package/dist/commonjs/models/operations/listapikeys.js +4 -54
  34. package/dist/commonjs/models/operations/listapikeys.js.map +1 -1
  35. package/dist/commonjs/models/operations/update.d.ts +43 -68
  36. package/dist/commonjs/models/operations/update.d.ts.map +1 -1
  37. package/dist/commonjs/models/operations/update.js +31 -54
  38. package/dist/commonjs/models/operations/update.js.map +1 -1
  39. package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +3 -0
  40. package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
  41. package/dist/commonjs/models/responsesoutputitemreasoning.js +1 -0
  42. package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
  43. package/dist/commonjs/models/updateapikeydata.d.ts +120 -0
  44. package/dist/commonjs/models/updateapikeydata.d.ts.map +1 -0
  45. package/dist/commonjs/models/updateapikeydata.js +134 -0
  46. package/dist/commonjs/models/updateapikeydata.js.map +1 -0
  47. package/dist/commonjs/sdk/responses.d.ts +2 -2
  48. package/dist/commonjs/sdk/responses.d.ts.map +1 -1
  49. package/dist/esm/funcs/betaResponsesSend.d.ts +2 -2
  50. package/dist/esm/funcs/betaResponsesSend.d.ts.map +1 -1
  51. package/dist/esm/funcs/betaResponsesSend.js.map +1 -1
  52. package/dist/esm/lib/config.d.ts +3 -3
  53. package/dist/esm/lib/config.js +3 -3
  54. package/dist/esm/models/createapikeydata.d.ts +120 -0
  55. package/dist/esm/models/createapikeydata.d.ts.map +1 -0
  56. package/dist/esm/models/createapikeydata.js +96 -0
  57. package/dist/esm/models/createapikeydata.js.map +1 -0
  58. package/dist/esm/models/getapikeydata.d.ts +120 -0
  59. package/dist/esm/models/getapikeydata.d.ts.map +1 -0
  60. package/dist/esm/models/getapikeydata.js +96 -0
  61. package/dist/esm/models/getapikeydata.js.map +1 -0
  62. package/dist/esm/models/index.d.ts +4 -0
  63. package/dist/esm/models/index.d.ts.map +1 -1
  64. package/dist/esm/models/index.js +4 -0
  65. package/dist/esm/models/index.js.map +1 -1
  66. package/dist/esm/models/keyinfo.d.ts +8 -8
  67. package/dist/esm/models/listapikeysdata.d.ts +117 -0
  68. package/dist/esm/models/listapikeysdata.d.ts.map +1 -0
  69. package/dist/esm/models/listapikeysdata.js +96 -0
  70. package/dist/esm/models/listapikeysdata.js.map +1 -0
  71. package/dist/esm/models/operations/create.d.ts +43 -68
  72. package/dist/esm/models/operations/create.d.ts.map +1 -1
  73. package/dist/esm/models/operations/create.js +30 -51
  74. package/dist/esm/models/operations/create.js.map +1 -1
  75. package/dist/esm/models/operations/getapikey.d.ts +3 -68
  76. package/dist/esm/models/operations/getapikey.d.ts.map +1 -1
  77. package/dist/esm/models/operations/getapikey.js +3 -52
  78. package/dist/esm/models/operations/getapikey.js.map +1 -1
  79. package/dist/esm/models/operations/listapikeys.d.ts +3 -65
  80. package/dist/esm/models/operations/listapikeys.d.ts.map +1 -1
  81. package/dist/esm/models/operations/listapikeys.js +3 -51
  82. package/dist/esm/models/operations/listapikeys.js.map +1 -1
  83. package/dist/esm/models/operations/update.d.ts +43 -68
  84. package/dist/esm/models/operations/update.d.ts.map +1 -1
  85. package/dist/esm/models/operations/update.js +30 -51
  86. package/dist/esm/models/operations/update.js.map +1 -1
  87. package/dist/esm/models/responsesoutputitemreasoning.d.ts +3 -0
  88. package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
  89. package/dist/esm/models/responsesoutputitemreasoning.js +1 -0
  90. package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
  91. package/dist/esm/models/updateapikeydata.d.ts +120 -0
  92. package/dist/esm/models/updateapikeydata.d.ts.map +1 -0
  93. package/dist/esm/models/updateapikeydata.js +96 -0
  94. package/dist/esm/models/updateapikeydata.js.map +1 -0
  95. package/dist/esm/sdk/responses.d.ts +2 -2
  96. package/dist/esm/sdk/responses.d.ts.map +1 -1
  97. package/docs/sdks/apikeys/README.md +4 -0
  98. package/jsr.json +1 -1
  99. package/package.json +1 -1
  100. package/src/funcs/betaResponsesSend.ts +2 -2
  101. package/src/lib/config.ts +3 -3
  102. package/src/models/createapikeydata.ts +222 -0
  103. package/src/models/getapikeydata.ts +218 -0
  104. package/src/models/index.ts +4 -0
  105. package/src/models/keyinfo.ts +8 -8
  106. package/src/models/listapikeysdata.ts +217 -0
  107. package/src/models/operations/create.ts +49 -123
  108. package/src/models/operations/getapikey.ts +5 -124
  109. package/src/models/operations/listapikeys.ts +5 -122
  110. package/src/models/operations/update.ts +49 -123
  111. package/src/models/responsesoutputitemreasoning.ts +1 -0
  112. package/src/models/updateapikeydata.ts +222 -0
  113. package/src/sdk/responses.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"responsesoutputitemreasoning.js","sourceRoot":"","sources":["../../../src/models/responsesoutputitemreasoning.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAEL,2CAA2C,EAE3C,4CAA4C,GAC7C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,2CAA2C,EAE3C,4CAA4C,GAC7C,MAAM,oCAAoC,CAAC;AAE5C,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,SAAS,EAAE,WAAW;CACd,CAAC;AAKX,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,qBAAqB;IACxC,iBAAiB,EAAE,qBAAqB;CAChC,CAAC;AAkBX,gBAAgB;AAChB,MAAM,CAAC,MAAM,8CAA8C,GAEvD,CAAC,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;AAEnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,+CAA+C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EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"responsesoutputitemreasoning.js","sourceRoot":"","sources":["../../../src/models/responsesoutputitemreasoning.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAEL,2CAA2C,EAE3C,4CAA4C,GAC7C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,2CAA2C,EAE3C,4CAA4C,GAC7C,MAAM,oCAAoC,CAAC;AAE5C,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,SAAS,EAAE,WAAW;CACd,CAAC;AAKX,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,qBAAqB;IACxC,cAAc,EAAE,kBAAkB;IAClC,iBAAiB,EAAE,qBAAqB;CAChC,CAAC;AAkBX,gBAAgB;AAChB,MAAM,CAAC,MAAM,8CAA8C,GAEvD,CAAC,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;AAEnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,+CAA+C,GAExD,8CAA8C,CAAC;AAEnD;;;GAGG;AACH,MAAM,KAAW,iCAAiC,CAKjD;AALD,WAAiB,iCAAiC;IAChD,gFAAgF;IACnE,+CAAa,GAAG,8CAA8C,CAAC;IAC5E,iFAAiF;IACpE,gDAAc,GAAG,+CAA+C,CAAC;AAChF,CAAC,EALgB,iCAAiC,KAAjC,iCAAiC,QAKjD;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,gDAAgD,GAEzD,CAAC,CAAC,UAAU,CAAC,kCAA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AE,CAAC,CAAC,KAAK,CAAC,4CAA4C,CAAC;IAC9D,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;SAClE,QAAQ,EAAE;CACd,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,gBAAgB,EAAE,mBAAmB;KACtC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,KAAW,6BAA6B,CAO7C;AAPD,WAAiB,6BAA6B;IAC5C,4EAA4E;IAC/D,2CAAa,GAAG,0CAA0C,CAAC;IACxE,6EAA6E;IAChE,4CAAc,GAAG,2CAA2C,CAAC;AAG5E,CAAC,EAPgB,6BAA6B,KAA7B,6BAA6B,QAO7C;AAED,MAAM,UAAU,kCAAkC,CAChD,4BAA0D;IAE1D,OAAO,IAAI,CAAC,SAAS,CACnB,2CAA2C,CAAC,KAAK,CAC/C,4BAA4B,CAC7B,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,120 @@
1
+ import * as z from "zod";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * The updated API key information
6
+ */
7
+ export type UpdateAPIKeyData = {
8
+ /**
9
+ * Unique hash identifier for the API key
10
+ */
11
+ hash: string;
12
+ /**
13
+ * Name of the API key
14
+ */
15
+ name: string;
16
+ /**
17
+ * Human-readable label for the API key
18
+ */
19
+ label: string;
20
+ /**
21
+ * Whether the API key is disabled
22
+ */
23
+ disabled: boolean;
24
+ /**
25
+ * Spending limit for the API key in USD
26
+ */
27
+ limit: number | null;
28
+ /**
29
+ * Remaining spending limit in USD
30
+ */
31
+ limitRemaining: number | null;
32
+ /**
33
+ * Type of limit reset for the API key
34
+ */
35
+ limitReset: string | null;
36
+ /**
37
+ * Whether to include external BYOK usage in the credit limit
38
+ */
39
+ includeByokInLimit: boolean;
40
+ /**
41
+ * Total OpenRouter credit usage (in USD) for the API key
42
+ */
43
+ usage: number;
44
+ /**
45
+ * OpenRouter credit usage (in USD) for the current UTC day
46
+ */
47
+ usageDaily: number;
48
+ /**
49
+ * OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
50
+ */
51
+ usageWeekly: number;
52
+ /**
53
+ * OpenRouter credit usage (in USD) for the current UTC month
54
+ */
55
+ usageMonthly: number;
56
+ /**
57
+ * Total external BYOK usage (in USD) for the API key
58
+ */
59
+ byokUsage: number;
60
+ /**
61
+ * External BYOK usage (in USD) for the current UTC day
62
+ */
63
+ byokUsageDaily: number;
64
+ /**
65
+ * External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
66
+ */
67
+ byokUsageWeekly: number;
68
+ /**
69
+ * External BYOK usage (in USD) for current UTC month
70
+ */
71
+ byokUsageMonthly: number;
72
+ /**
73
+ * ISO 8601 timestamp of when the API key was created
74
+ */
75
+ createdAt: string;
76
+ /**
77
+ * ISO 8601 timestamp of when the API key was last updated
78
+ */
79
+ updatedAt: string | null;
80
+ };
81
+ /** @internal */
82
+ export declare const UpdateAPIKeyData$inboundSchema: z.ZodType<UpdateAPIKeyData, z.ZodTypeDef, unknown>;
83
+ /** @internal */
84
+ export type UpdateAPIKeyData$Outbound = {
85
+ hash: string;
86
+ name: string;
87
+ label: string;
88
+ disabled: boolean;
89
+ limit: number | null;
90
+ limit_remaining: number | null;
91
+ limit_reset: string | null;
92
+ include_byok_in_limit: boolean;
93
+ usage: number;
94
+ usage_daily: number;
95
+ usage_weekly: number;
96
+ usage_monthly: number;
97
+ byok_usage: number;
98
+ byok_usage_daily: number;
99
+ byok_usage_weekly: number;
100
+ byok_usage_monthly: number;
101
+ created_at: string;
102
+ updated_at: string | null;
103
+ };
104
+ /** @internal */
105
+ export declare const UpdateAPIKeyData$outboundSchema: z.ZodType<UpdateAPIKeyData$Outbound, z.ZodTypeDef, UpdateAPIKeyData>;
106
+ /**
107
+ * @internal
108
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
109
+ */
110
+ export declare namespace UpdateAPIKeyData$ {
111
+ /** @deprecated use `UpdateAPIKeyData$inboundSchema` instead. */
112
+ const inboundSchema: z.ZodType<UpdateAPIKeyData, z.ZodTypeDef, unknown>;
113
+ /** @deprecated use `UpdateAPIKeyData$outboundSchema` instead. */
114
+ const outboundSchema: z.ZodType<UpdateAPIKeyData$Outbound, z.ZodTypeDef, UpdateAPIKeyData>;
115
+ /** @deprecated use `UpdateAPIKeyData$Outbound` instead. */
116
+ type Outbound = UpdateAPIKeyData$Outbound;
117
+ }
118
+ export declare function updateAPIKeyDataToJSON(updateAPIKeyData: UpdateAPIKeyData): string;
119
+ export declare function updateAPIKeyDataFromJSON(jsonString: string): SafeParseResult<UpdateAPIKeyData, SDKValidationError>;
120
+ //# sourceMappingURL=updateapikeydata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateapikeydata.d.ts","sourceRoot":"","sources":["../../../src/models/updateapikeydata.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,gBAA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MAAM,GAAG,IAAI,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,yBAAyB,EACzB,CAAC,CAAC,UAAU,EACZ,gBAAgB,CAmChB,CAAC;AAEH;;;GAGG;AACH,yBAAiB,iBAAiB,CAAC;IACjC,gEAAgE;IACzD,MAAM,aAAa,oDAAiC,CAAC;IAC5D,iEAAiE;IAC1D,MAAM,cAAc,sEAAkC,CAAC;IAC9D,2DAA2D;IAC3D,KAAY,QAAQ,GAAG,yBAAyB,CAAC;CAClD;AAED,wBAAgB,sBAAsB,CACpC,gBAAgB,EAAE,gBAAgB,GACjC,MAAM,CAIR;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAMvD"}
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod";
5
+ import { remap as remap$ } from "../lib/primitives.js";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const UpdateAPIKeyData$inboundSchema = z.object({
9
+ hash: z.string(),
10
+ name: z.string(),
11
+ label: z.string(),
12
+ disabled: z.boolean(),
13
+ limit: z.nullable(z.number()),
14
+ limit_remaining: z.nullable(z.number()),
15
+ limit_reset: z.nullable(z.string()),
16
+ include_byok_in_limit: z.boolean(),
17
+ usage: z.number(),
18
+ usage_daily: z.number(),
19
+ usage_weekly: z.number(),
20
+ usage_monthly: z.number(),
21
+ byok_usage: z.number(),
22
+ byok_usage_daily: z.number(),
23
+ byok_usage_weekly: z.number(),
24
+ byok_usage_monthly: z.number(),
25
+ created_at: z.string(),
26
+ updated_at: z.nullable(z.string()),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "limit_remaining": "limitRemaining",
30
+ "limit_reset": "limitReset",
31
+ "include_byok_in_limit": "includeByokInLimit",
32
+ "usage_daily": "usageDaily",
33
+ "usage_weekly": "usageWeekly",
34
+ "usage_monthly": "usageMonthly",
35
+ "byok_usage": "byokUsage",
36
+ "byok_usage_daily": "byokUsageDaily",
37
+ "byok_usage_weekly": "byokUsageWeekly",
38
+ "byok_usage_monthly": "byokUsageMonthly",
39
+ "created_at": "createdAt",
40
+ "updated_at": "updatedAt",
41
+ });
42
+ });
43
+ /** @internal */
44
+ export const UpdateAPIKeyData$outboundSchema = z.object({
45
+ hash: z.string(),
46
+ name: z.string(),
47
+ label: z.string(),
48
+ disabled: z.boolean(),
49
+ limit: z.nullable(z.number()),
50
+ limitRemaining: z.nullable(z.number()),
51
+ limitReset: z.nullable(z.string()),
52
+ includeByokInLimit: z.boolean(),
53
+ usage: z.number(),
54
+ usageDaily: z.number(),
55
+ usageWeekly: z.number(),
56
+ usageMonthly: z.number(),
57
+ byokUsage: z.number(),
58
+ byokUsageDaily: z.number(),
59
+ byokUsageWeekly: z.number(),
60
+ byokUsageMonthly: z.number(),
61
+ createdAt: z.string(),
62
+ updatedAt: z.nullable(z.string()),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ limitRemaining: "limit_remaining",
66
+ limitReset: "limit_reset",
67
+ includeByokInLimit: "include_byok_in_limit",
68
+ usageDaily: "usage_daily",
69
+ usageWeekly: "usage_weekly",
70
+ usageMonthly: "usage_monthly",
71
+ byokUsage: "byok_usage",
72
+ byokUsageDaily: "byok_usage_daily",
73
+ byokUsageWeekly: "byok_usage_weekly",
74
+ byokUsageMonthly: "byok_usage_monthly",
75
+ createdAt: "created_at",
76
+ updatedAt: "updated_at",
77
+ });
78
+ });
79
+ /**
80
+ * @internal
81
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
82
+ */
83
+ export var UpdateAPIKeyData$;
84
+ (function (UpdateAPIKeyData$) {
85
+ /** @deprecated use `UpdateAPIKeyData$inboundSchema` instead. */
86
+ UpdateAPIKeyData$.inboundSchema = UpdateAPIKeyData$inboundSchema;
87
+ /** @deprecated use `UpdateAPIKeyData$outboundSchema` instead. */
88
+ UpdateAPIKeyData$.outboundSchema = UpdateAPIKeyData$outboundSchema;
89
+ })(UpdateAPIKeyData$ || (UpdateAPIKeyData$ = {}));
90
+ export function updateAPIKeyDataToJSON(updateAPIKeyData) {
91
+ return JSON.stringify(UpdateAPIKeyData$outboundSchema.parse(updateAPIKeyData));
92
+ }
93
+ export function updateAPIKeyDataFromJSON(jsonString) {
94
+ return safeParse(jsonString, (x) => UpdateAPIKeyData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateAPIKeyData' from JSON`);
95
+ }
96
+ //# sourceMappingURL=updateapikeydata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateapikeydata.js","sourceRoot":"","sources":["../../../src/models/updateapikeydata.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkF9C,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAIvC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAA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B,SAAS,EAAE,YAAY;QACvB,cAAc,EAAE,kBAAkB;QAClC,eAAe,EAAE,mBAAmB;QACpC,gBAAgB,EAAE,oBAAoB;QACtC,SAAS,EAAE,YAAY;QACvB,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,KAAW,iBAAiB,CAOjC;AAPD,WAAiB,iBAAiB;IAChC,gEAAgE;IACnD,+BAAa,GAAG,8BAA8B,CAAC;IAC5D,iEAAiE;IACpD,gCAAc,GAAG,+BAA+B,CAAC;AAGhE,CAAC,EAPgB,iBAAiB,KAAjB,iBAAiB,QAOjC;AAED,MAAM,UAAU,sBAAsB,CACpC,gBAAkC;IAElC,OAAO,IAAI,CAAC,SAAS,CACnB,+BAA+B,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC1D,8CAA8C,CAC/C,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { EventStream } from "../lib/event-streams.js";
2
2
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
3
+ import * as models from "../models/index.js";
3
4
  import * as operations from "../models/operations/index.js";
4
- import type { ResponsesNonStreamingResponse } from "../models/responsesnonstreamingresponse.js";
5
5
  export declare class Responses extends ClientSDK {
6
6
  /**
7
7
  * Submit a response request
@@ -11,7 +11,7 @@ export declare class Responses extends ClientSDK {
11
11
  */
12
12
  send(request: operations.SendResponsesRequestRequest & {
13
13
  stream?: false | undefined;
14
- }, options?: RequestOptions): Promise<ResponsesNonStreamingResponse>;
14
+ }, options?: RequestOptions): Promise<models.ResponsesNonStreamingResponse>;
15
15
  send(request: operations.SendResponsesRequestRequest & {
16
16
  stream: true;
17
17
  }, options?: RequestOptions): Promise<EventStream<operations.SendResponsesRequestResponseBody>>;
@@ -1 +1 @@
1
- {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/sdk/responses.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAGhG,qBAAa,SAAU,SAAQ,SAAS;IACtC;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,GAAG;QAChD,MAAM,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;KAC5B,EACD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,6BAA6B,CAAC;IACnC,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,GAAG;QAAE,MAAM,EAAE,IAAI,CAAA;KAAE,EAClE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;IAC9D,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,4BAA4B,CAAC;CAWpD"}
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/sdk/responses.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,SAAU,SAAQ,SAAS;IACtC;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,GAAG;QAChD,MAAM,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;KAC5B,EACD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC;IAC1C,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,GAAG;QAAE,MAAM,EAAE,IAAI,CAAA;KAAE,EAClE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;IAC9D,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,4BAA4B,CAAC;CAWpD"}
@@ -136,6 +136,7 @@ async function run() {
136
136
  const result = await openRouter.apiKeys.create({
137
137
  name: "My New API Key",
138
138
  limit: 50,
139
+ limitReset: "monthly",
139
140
  includeByokInLimit: true,
140
141
  });
141
142
 
@@ -163,6 +164,7 @@ async function run() {
163
164
  const res = await apiKeysCreate(openRouter, {
164
165
  name: "My New API Key",
165
166
  limit: 50,
167
+ limitReset: "monthly",
166
168
  includeByokInLimit: true,
167
169
  });
168
170
  if (res.ok) {
@@ -234,6 +236,7 @@ async function run() {
234
236
  name: "Updated API Key Name",
235
237
  disabled: false,
236
238
  limit: 75,
239
+ limitReset: "daily",
237
240
  includeByokInLimit: true,
238
241
  },
239
242
  });
@@ -265,6 +268,7 @@ async function run() {
265
268
  name: "Updated API Key Name",
266
269
  disabled: false,
267
270
  limit: 75,
271
+ limitReset: "daily",
268
272
  includeByokInLimit: true,
269
273
  },
270
274
  });
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.0.0-beta.37",
5
+ "version": "0.0.0-beta.38",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.0.0-beta.37",
3
+ "version": "0.0.0-beta.38",
4
4
  "author": "OpenRouter",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -22,8 +22,8 @@ import * as errors from "../models/errors/index.js";
22
22
  import { OpenRouterError } from "../models/errors/openroutererror.js";
23
23
  import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
24
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as models from "../models/index.js";
25
26
  import * as operations from "../models/operations/index.js";
26
- import type { ResponsesNonStreamingResponse } from "../models/responsesnonstreamingresponse.js";
27
27
  import { APICall, APIPromise } from "../types/async.js";
28
28
  import { Result } from "../types/fp.js";
29
29
 
@@ -39,7 +39,7 @@ export function betaResponsesSend(
39
39
  options?: RequestOptions,
40
40
  ): APIPromise<
41
41
  Result<
42
- ResponsesNonStreamingResponse,
42
+ models.ResponsesNonStreamingResponse,
43
43
  | errors.ErrorResponse
44
44
  | OpenRouterError
45
45
  | ResponseValidationError
package/src/lib/config.ts CHANGED
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
59
59
  export const SDK_METADATA = {
60
60
  language: "typescript",
61
61
  openapiDocVersion: "1.0.0",
62
- sdkVersion: "0.0.0-beta.37",
63
- genVersion: "2.723.2",
62
+ sdkVersion: "0.0.0-beta.38",
63
+ genVersion: "2.723.8",
64
64
  userAgent:
65
- "speakeasy-sdk/typescript 0.0.0-beta.37 2.723.2 1.0.0 @openrouter/sdk",
65
+ "speakeasy-sdk/typescript 0.0.0-beta.38 2.723.8 1.0.0 @openrouter/sdk",
66
66
  } as const;
@@ -0,0 +1,222 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The created API key information
13
+ */
14
+ export type CreateAPIKeyData = {
15
+ /**
16
+ * Unique hash identifier for the API key
17
+ */
18
+ hash: string;
19
+ /**
20
+ * Name of the API key
21
+ */
22
+ name: string;
23
+ /**
24
+ * Human-readable label for the API key
25
+ */
26
+ label: string;
27
+ /**
28
+ * Whether the API key is disabled
29
+ */
30
+ disabled: boolean;
31
+ /**
32
+ * Spending limit for the API key in USD
33
+ */
34
+ limit: number | null;
35
+ /**
36
+ * Remaining spending limit in USD
37
+ */
38
+ limitRemaining: number | null;
39
+ /**
40
+ * Type of limit reset for the API key
41
+ */
42
+ limitReset: string | null;
43
+ /**
44
+ * Whether to include external BYOK usage in the credit limit
45
+ */
46
+ includeByokInLimit: boolean;
47
+ /**
48
+ * Total OpenRouter credit usage (in USD) for the API key
49
+ */
50
+ usage: number;
51
+ /**
52
+ * OpenRouter credit usage (in USD) for the current UTC day
53
+ */
54
+ usageDaily: number;
55
+ /**
56
+ * OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
57
+ */
58
+ usageWeekly: number;
59
+ /**
60
+ * OpenRouter credit usage (in USD) for the current UTC month
61
+ */
62
+ usageMonthly: number;
63
+ /**
64
+ * Total external BYOK usage (in USD) for the API key
65
+ */
66
+ byokUsage: number;
67
+ /**
68
+ * External BYOK usage (in USD) for the current UTC day
69
+ */
70
+ byokUsageDaily: number;
71
+ /**
72
+ * External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
73
+ */
74
+ byokUsageWeekly: number;
75
+ /**
76
+ * External BYOK usage (in USD) for current UTC month
77
+ */
78
+ byokUsageMonthly: number;
79
+ /**
80
+ * ISO 8601 timestamp of when the API key was created
81
+ */
82
+ createdAt: string;
83
+ /**
84
+ * ISO 8601 timestamp of when the API key was last updated
85
+ */
86
+ updatedAt: string | null;
87
+ };
88
+
89
+ /** @internal */
90
+ export const CreateAPIKeyData$inboundSchema: z.ZodType<
91
+ CreateAPIKeyData,
92
+ z.ZodTypeDef,
93
+ unknown
94
+ > = z.object({
95
+ hash: z.string(),
96
+ name: z.string(),
97
+ label: z.string(),
98
+ disabled: z.boolean(),
99
+ limit: z.nullable(z.number()),
100
+ limit_remaining: z.nullable(z.number()),
101
+ limit_reset: z.nullable(z.string()),
102
+ include_byok_in_limit: z.boolean(),
103
+ usage: z.number(),
104
+ usage_daily: z.number(),
105
+ usage_weekly: z.number(),
106
+ usage_monthly: z.number(),
107
+ byok_usage: z.number(),
108
+ byok_usage_daily: z.number(),
109
+ byok_usage_weekly: z.number(),
110
+ byok_usage_monthly: z.number(),
111
+ created_at: z.string(),
112
+ updated_at: z.nullable(z.string()),
113
+ }).transform((v) => {
114
+ return remap$(v, {
115
+ "limit_remaining": "limitRemaining",
116
+ "limit_reset": "limitReset",
117
+ "include_byok_in_limit": "includeByokInLimit",
118
+ "usage_daily": "usageDaily",
119
+ "usage_weekly": "usageWeekly",
120
+ "usage_monthly": "usageMonthly",
121
+ "byok_usage": "byokUsage",
122
+ "byok_usage_daily": "byokUsageDaily",
123
+ "byok_usage_weekly": "byokUsageWeekly",
124
+ "byok_usage_monthly": "byokUsageMonthly",
125
+ "created_at": "createdAt",
126
+ "updated_at": "updatedAt",
127
+ });
128
+ });
129
+
130
+ /** @internal */
131
+ export type CreateAPIKeyData$Outbound = {
132
+ hash: string;
133
+ name: string;
134
+ label: string;
135
+ disabled: boolean;
136
+ limit: number | null;
137
+ limit_remaining: number | null;
138
+ limit_reset: string | null;
139
+ include_byok_in_limit: boolean;
140
+ usage: number;
141
+ usage_daily: number;
142
+ usage_weekly: number;
143
+ usage_monthly: number;
144
+ byok_usage: number;
145
+ byok_usage_daily: number;
146
+ byok_usage_weekly: number;
147
+ byok_usage_monthly: number;
148
+ created_at: string;
149
+ updated_at: string | null;
150
+ };
151
+
152
+ /** @internal */
153
+ export const CreateAPIKeyData$outboundSchema: z.ZodType<
154
+ CreateAPIKeyData$Outbound,
155
+ z.ZodTypeDef,
156
+ CreateAPIKeyData
157
+ > = z.object({
158
+ hash: z.string(),
159
+ name: z.string(),
160
+ label: z.string(),
161
+ disabled: z.boolean(),
162
+ limit: z.nullable(z.number()),
163
+ limitRemaining: z.nullable(z.number()),
164
+ limitReset: z.nullable(z.string()),
165
+ includeByokInLimit: z.boolean(),
166
+ usage: z.number(),
167
+ usageDaily: z.number(),
168
+ usageWeekly: z.number(),
169
+ usageMonthly: z.number(),
170
+ byokUsage: z.number(),
171
+ byokUsageDaily: z.number(),
172
+ byokUsageWeekly: z.number(),
173
+ byokUsageMonthly: z.number(),
174
+ createdAt: z.string(),
175
+ updatedAt: z.nullable(z.string()),
176
+ }).transform((v) => {
177
+ return remap$(v, {
178
+ limitRemaining: "limit_remaining",
179
+ limitReset: "limit_reset",
180
+ includeByokInLimit: "include_byok_in_limit",
181
+ usageDaily: "usage_daily",
182
+ usageWeekly: "usage_weekly",
183
+ usageMonthly: "usage_monthly",
184
+ byokUsage: "byok_usage",
185
+ byokUsageDaily: "byok_usage_daily",
186
+ byokUsageWeekly: "byok_usage_weekly",
187
+ byokUsageMonthly: "byok_usage_monthly",
188
+ createdAt: "created_at",
189
+ updatedAt: "updated_at",
190
+ });
191
+ });
192
+
193
+ /**
194
+ * @internal
195
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
196
+ */
197
+ export namespace CreateAPIKeyData$ {
198
+ /** @deprecated use `CreateAPIKeyData$inboundSchema` instead. */
199
+ export const inboundSchema = CreateAPIKeyData$inboundSchema;
200
+ /** @deprecated use `CreateAPIKeyData$outboundSchema` instead. */
201
+ export const outboundSchema = CreateAPIKeyData$outboundSchema;
202
+ /** @deprecated use `CreateAPIKeyData$Outbound` instead. */
203
+ export type Outbound = CreateAPIKeyData$Outbound;
204
+ }
205
+
206
+ export function createAPIKeyDataToJSON(
207
+ createAPIKeyData: CreateAPIKeyData,
208
+ ): string {
209
+ return JSON.stringify(
210
+ CreateAPIKeyData$outboundSchema.parse(createAPIKeyData),
211
+ );
212
+ }
213
+
214
+ export function createAPIKeyDataFromJSON(
215
+ jsonString: string,
216
+ ): SafeParseResult<CreateAPIKeyData, SDKValidationError> {
217
+ return safeParse(
218
+ jsonString,
219
+ (x) => CreateAPIKeyData$inboundSchema.parse(JSON.parse(x)),
220
+ `Failed to parse 'CreateAPIKeyData' from JSON`,
221
+ );
222
+ }