@openrouter/sdk 0.0.1-beta.11 → 0.0.1-beta.12

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 (197) hide show
  1. package/FUNCTIONS.md +110 -1
  2. package/REACT_QUERY.md +110 -1
  3. package/README.md +682 -14
  4. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  5. package/esm/funcs/analyticsGetUserActivity.js +2 -2
  6. package/esm/funcs/apiKeysCreate.d.ts +1 -1
  7. package/esm/funcs/apiKeysCreate.js +2 -2
  8. package/esm/funcs/apiKeysDelete.d.ts +1 -1
  9. package/esm/funcs/apiKeysDelete.js +2 -2
  10. package/esm/funcs/apiKeysGet.d.ts +1 -1
  11. package/esm/funcs/apiKeysGet.js +2 -2
  12. package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
  13. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -2
  14. package/esm/funcs/apiKeysList.d.ts +1 -1
  15. package/esm/funcs/apiKeysList.js +2 -2
  16. package/esm/funcs/apiKeysUpdate.d.ts +1 -1
  17. package/esm/funcs/apiKeysUpdate.js +2 -2
  18. package/esm/funcs/betaResponsesSend.d.ts +9 -1
  19. package/esm/funcs/betaResponsesSend.js +36 -12
  20. package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
  21. package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
  22. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  23. package/esm/funcs/creditsGetCredits.js +2 -2
  24. package/esm/funcs/endpointsList.d.ts +1 -1
  25. package/esm/funcs/endpointsList.js +2 -2
  26. package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
  27. package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
  28. package/esm/funcs/generationsGetGeneration.d.ts +1 -1
  29. package/esm/funcs/generationsGetGeneration.js +13 -2
  30. package/esm/funcs/modelsCount.d.ts +3 -2
  31. package/esm/funcs/modelsCount.js +7 -3
  32. package/esm/funcs/modelsList.d.ts +2 -1
  33. package/esm/funcs/modelsList.js +6 -2
  34. package/esm/funcs/modelsListForUser.d.ts +3 -1
  35. package/esm/funcs/modelsListForUser.js +7 -3
  36. package/esm/funcs/parametersGetParameters.d.ts +1 -1
  37. package/esm/funcs/parametersGetParameters.js +2 -2
  38. package/esm/funcs/providersList.d.ts +1 -1
  39. package/esm/funcs/providersList.js +1 -1
  40. package/esm/lib/config.d.ts +2 -2
  41. package/esm/lib/config.js +2 -2
  42. package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
  43. package/esm/models/badgatewayresponseerrordata.js +35 -0
  44. package/esm/models/badrequestresponseerrordata.d.ts +40 -0
  45. package/esm/models/badrequestresponseerrordata.js +35 -0
  46. package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
  47. package/esm/models/chatmessagecontentitemaudio.js +14 -14
  48. package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
  49. package/esm/models/chatstreamingresponsechunk.js +15 -15
  50. package/esm/models/createchargerequest.d.ts +31 -2
  51. package/esm/models/createchargerequest.js +47 -2
  52. package/esm/models/defaultparameters.d.ts +36 -0
  53. package/esm/models/defaultparameters.js +46 -0
  54. package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
  55. package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
  56. package/esm/models/endpointstatus.d.ts +26 -0
  57. package/esm/models/endpointstatus.js +36 -0
  58. package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
  59. package/esm/models/errors/badgatewayresponseerror.js +63 -0
  60. package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
  61. package/esm/models/errors/badrequestresponseerror.js +63 -0
  62. package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
  63. package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
  64. package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
  65. package/esm/models/errors/forbiddenresponseerror.js +63 -0
  66. package/esm/models/errors/index.d.ts +14 -2
  67. package/esm/models/errors/index.js +14 -2
  68. package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
  69. package/esm/models/errors/internalserverresponseerror.js +63 -0
  70. package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
  71. package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
  72. package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
  73. package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
  74. package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
  75. package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
  76. package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
  77. package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
  78. package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
  79. package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
  80. package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
  81. package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
  82. package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
  83. package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
  84. package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
  85. package/esm/models/errors/unauthorizedresponseerror.js +63 -0
  86. package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
  87. package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
  88. package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
  89. package/esm/models/forbiddenresponseerrordata.js +35 -0
  90. package/esm/models/index.d.ts +37 -1
  91. package/esm/models/index.js +37 -1
  92. package/esm/models/inputmodality.d.ts +24 -0
  93. package/esm/models/inputmodality.js +34 -0
  94. package/esm/models/instructtype.d.ts +48 -0
  95. package/esm/models/instructtype.js +55 -0
  96. package/esm/models/internalserverresponseerrordata.d.ts +40 -0
  97. package/esm/models/internalserverresponseerrordata.js +35 -0
  98. package/esm/models/listendpointsresponse.d.ts +126 -2
  99. package/esm/models/listendpointsresponse.js +115 -2
  100. package/esm/models/model.d.ts +101 -0
  101. package/esm/models/model.js +82 -0
  102. package/esm/models/modelarchitecture.d.ts +104 -0
  103. package/esm/models/modelarchitecture.js +107 -0
  104. package/esm/models/modelgroup.d.ts +45 -0
  105. package/esm/models/modelgroup.js +53 -0
  106. package/esm/models/modelscountresponse.d.ts +40 -2
  107. package/esm/models/modelscountresponse.js +31 -2
  108. package/esm/models/modelslistresponse.d.ts +10 -2
  109. package/esm/models/modelslistresponse.js +7 -2
  110. package/esm/models/notfoundresponseerrordata.d.ts +40 -0
  111. package/esm/models/notfoundresponseerrordata.js +35 -0
  112. package/esm/models/openairesponsesincludable.d.ts +25 -0
  113. package/esm/models/openairesponsesincludable.js +35 -0
  114. package/esm/models/openairesponsesinputunion.d.ts +78 -78
  115. package/esm/models/openairesponsesinputunion.js +124 -126
  116. package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
  117. package/esm/models/openresponseseasyinputmessage.js +283 -0
  118. package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
  119. package/esm/models/openresponsesfunctioncalloutput.js +67 -0
  120. package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
  121. package/esm/models/openresponsesfunctiontoolcall.js +69 -0
  122. package/esm/models/openresponsesinput.d.ts +60 -0
  123. package/esm/models/openresponsesinput.js +113 -0
  124. package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
  125. package/esm/models/openresponsesinputmessageitem.js +210 -0
  126. package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
  127. package/esm/models/openresponsesnonstreamingresponse.js +13 -13
  128. package/esm/models/openresponsesreasoning.d.ts +179 -0
  129. package/esm/models/openresponsesreasoning.js +194 -0
  130. package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
  131. package/esm/models/openresponsesreasoningconfig.js +48 -0
  132. package/esm/models/openresponsesrequest.d.ts +736 -2
  133. package/esm/models/openresponsesrequest.js +789 -2
  134. package/esm/models/openresponsesresponsetext.d.ts +59 -0
  135. package/esm/models/openresponsesresponsetext.js +64 -0
  136. package/esm/models/operations/createapialpharesponses.d.ts +3 -3
  137. package/esm/models/operations/createapialpharesponses.js +0 -2
  138. package/esm/models/operations/getmodels.d.ts +2 -2
  139. package/esm/models/operations/getmodels.js +2 -10
  140. package/esm/models/operations/index.d.ts +0 -1
  141. package/esm/models/operations/index.js +0 -1
  142. package/esm/models/operations/listendpointszdr.d.ts +3 -24
  143. package/esm/models/operations/listendpointszdr.js +2 -29
  144. package/esm/models/operations/listmodelsuser.d.ts +0 -22
  145. package/esm/models/operations/listmodelsuser.js +0 -28
  146. package/esm/models/operations/listproviders.d.ts +0 -36
  147. package/esm/models/operations/listproviders.js +0 -28
  148. package/esm/models/outputmodality.d.ts +23 -0
  149. package/esm/models/outputmodality.js +33 -0
  150. package/esm/models/parameter.d.ts +43 -0
  151. package/esm/models/parameter.js +54 -0
  152. package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
  153. package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
  154. package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
  155. package/esm/models/paymentrequiredresponseerrordata.js +35 -0
  156. package/esm/models/perrequestlimits.d.ts +40 -0
  157. package/esm/models/perrequestlimits.js +44 -0
  158. package/esm/models/providername.d.ts +106 -0
  159. package/esm/models/providername.js +116 -0
  160. package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
  161. package/esm/models/provideroverloadedresponseerrordata.js +35 -0
  162. package/esm/models/publicendpoint.d.ts +140 -2
  163. package/esm/models/publicendpoint.js +156 -2
  164. package/esm/models/publicpricing.d.ts +87 -0
  165. package/esm/models/publicpricing.js +73 -0
  166. package/esm/models/quantization.d.ts +29 -0
  167. package/esm/models/quantization.js +39 -0
  168. package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
  169. package/esm/models/requesttimeoutresponseerrordata.js +35 -0
  170. package/esm/models/responseserrorfield.d.ts +10 -10
  171. package/esm/models/responseserrorfield.js +14 -14
  172. package/esm/models/responsetextconfig.d.ts +10 -10
  173. package/esm/models/responsetextconfig.js +14 -15
  174. package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
  175. package/esm/models/serviceunavailableresponseerrordata.js +35 -0
  176. package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
  177. package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
  178. package/esm/models/topproviderinfo.d.ts +45 -0
  179. package/esm/models/topproviderinfo.js +48 -0
  180. package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
  181. package/esm/models/unauthorizedresponseerrordata.js +35 -0
  182. package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
  183. package/esm/models/unprocessableentityresponseerrordata.js +35 -0
  184. package/esm/react-query/modelsCount.d.ts +2 -2
  185. package/esm/react-query/modelsListForUser.d.ts +2 -1
  186. package/esm/sdk/models.d.ts +3 -2
  187. package/esm/sdk/responses.d.ts +7 -0
  188. package/esm/sdk/responses.js +0 -6
  189. package/jsr.json +1 -1
  190. package/package.json +1 -1
  191. package/esm/models/errorresponse.d.ts +0 -155
  192. package/esm/models/errorresponse.js +0 -167
  193. package/esm/models/errors/errorresponse.d.ts +0 -46
  194. package/esm/models/errors/listproviders.d.ts +0 -49
  195. package/esm/models/errors/listproviders.js +0 -51
  196. package/esm/models/operations/listmodelscount.d.ts +0 -26
  197. package/esm/models/operations/listmodelscount.js +0 -34
@@ -2,11 +2,56 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../lib/primitives.js";
5
6
  import { safeParse } from "../lib/schemas.js";
7
+ import { catchUnrecognizedEnum, } from "../types/enums.js";
8
+ export const ChainId = {
9
+ One: 1,
10
+ OneHundredAndThirtySeven: 137,
11
+ EightThousandFourHundredAndFiftyThree: 8453,
12
+ };
6
13
  /** @internal */
7
- export const CreateChargeRequest$inboundSchema = z.object({});
14
+ export const ChainId$inboundSchema = z
15
+ .union([
16
+ z.enum(ChainId),
17
+ z.number().transform(catchUnrecognizedEnum),
18
+ ]);
8
19
  /** @internal */
9
- export const CreateChargeRequest$outboundSchema = z.object({});
20
+ export const ChainId$outboundSchema = z.union([
21
+ z.enum(ChainId),
22
+ z.number().and(z.custom()),
23
+ ]);
24
+ /**
25
+ * @internal
26
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
27
+ */
28
+ export var ChainId$;
29
+ (function (ChainId$) {
30
+ /** @deprecated use `ChainId$inboundSchema` instead. */
31
+ ChainId$.inboundSchema = ChainId$inboundSchema;
32
+ /** @deprecated use `ChainId$outboundSchema` instead. */
33
+ ChainId$.outboundSchema = ChainId$outboundSchema;
34
+ })(ChainId$ || (ChainId$ = {}));
35
+ /** @internal */
36
+ export const CreateChargeRequest$inboundSchema = z.object({
37
+ amount: z.number(),
38
+ sender: z.string(),
39
+ chain_id: ChainId$inboundSchema,
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "chain_id": "chainId",
43
+ });
44
+ });
45
+ /** @internal */
46
+ export const CreateChargeRequest$outboundSchema = z.object({
47
+ amount: z.number(),
48
+ sender: z.string(),
49
+ chainId: ChainId$outboundSchema,
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ chainId: "chain_id",
53
+ });
54
+ });
10
55
  /**
11
56
  * @internal
12
57
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
@@ -0,0 +1,36 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Default parameters for this model
6
+ */
7
+ export type DefaultParameters = {
8
+ temperature?: number | null | undefined;
9
+ topP?: number | null | undefined;
10
+ frequencyPenalty?: number | null | undefined;
11
+ };
12
+ /** @internal */
13
+ export declare const DefaultParameters$inboundSchema: z.ZodType<DefaultParameters, unknown>;
14
+ /** @internal */
15
+ export type DefaultParameters$Outbound = {
16
+ temperature?: number | null | undefined;
17
+ top_p?: number | null | undefined;
18
+ frequency_penalty?: number | null | undefined;
19
+ };
20
+ /** @internal */
21
+ export declare const DefaultParameters$outboundSchema: z.ZodType<DefaultParameters$Outbound, DefaultParameters>;
22
+ /**
23
+ * @internal
24
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
25
+ */
26
+ export declare namespace DefaultParameters$ {
27
+ /** @deprecated use `DefaultParameters$inboundSchema` instead. */
28
+ const inboundSchema: z.ZodType<DefaultParameters, unknown, z.core.$ZodTypeInternals<DefaultParameters, unknown>>;
29
+ /** @deprecated use `DefaultParameters$outboundSchema` instead. */
30
+ const outboundSchema: z.ZodType<DefaultParameters$Outbound, DefaultParameters, z.core.$ZodTypeInternals<DefaultParameters$Outbound, DefaultParameters>>;
31
+ /** @deprecated use `DefaultParameters$Outbound` instead. */
32
+ type Outbound = DefaultParameters$Outbound;
33
+ }
34
+ export declare function defaultParametersToJSON(defaultParameters: DefaultParameters): string;
35
+ export declare function defaultParametersFromJSON(jsonString: string): SafeParseResult<DefaultParameters, SDKValidationError>;
36
+ //# sourceMappingURL=defaultparameters.d.ts.map
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../lib/primitives.js";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const DefaultParameters$inboundSchema = z.object({
9
+ temperature: z.nullable(z.number()).optional(),
10
+ top_p: z.nullable(z.number()).optional(),
11
+ frequency_penalty: z.nullable(z.number()).optional(),
12
+ }).transform((v) => {
13
+ return remap$(v, {
14
+ "top_p": "topP",
15
+ "frequency_penalty": "frequencyPenalty",
16
+ });
17
+ });
18
+ /** @internal */
19
+ export const DefaultParameters$outboundSchema = z.object({
20
+ temperature: z.nullable(z.number()).optional(),
21
+ topP: z.nullable(z.number()).optional(),
22
+ frequencyPenalty: z.nullable(z.number()).optional(),
23
+ }).transform((v) => {
24
+ return remap$(v, {
25
+ topP: "top_p",
26
+ frequencyPenalty: "frequency_penalty",
27
+ });
28
+ });
29
+ /**
30
+ * @internal
31
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
32
+ */
33
+ export var DefaultParameters$;
34
+ (function (DefaultParameters$) {
35
+ /** @deprecated use `DefaultParameters$inboundSchema` instead. */
36
+ DefaultParameters$.inboundSchema = DefaultParameters$inboundSchema;
37
+ /** @deprecated use `DefaultParameters$outboundSchema` instead. */
38
+ DefaultParameters$.outboundSchema = DefaultParameters$outboundSchema;
39
+ })(DefaultParameters$ || (DefaultParameters$ = {}));
40
+ export function defaultParametersToJSON(defaultParameters) {
41
+ return JSON.stringify(DefaultParameters$outboundSchema.parse(defaultParameters));
42
+ }
43
+ export function defaultParametersFromJSON(jsonString) {
44
+ return safeParse(jsonString, (x) => DefaultParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultParameters' from JSON`);
45
+ }
46
+ //# sourceMappingURL=defaultparameters.js.map
@@ -0,0 +1,40 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Error data for EdgeNetworkTimeoutResponse
6
+ */
7
+ export type EdgeNetworkTimeoutResponseErrorData = {
8
+ code: number;
9
+ message: string;
10
+ metadata?: {
11
+ [k: string]: any | null;
12
+ } | null | undefined;
13
+ };
14
+ /** @internal */
15
+ export declare const EdgeNetworkTimeoutResponseErrorData$inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData, unknown>;
16
+ /** @internal */
17
+ export type EdgeNetworkTimeoutResponseErrorData$Outbound = {
18
+ code: number;
19
+ message: string;
20
+ metadata?: {
21
+ [k: string]: any | null;
22
+ } | null | undefined;
23
+ };
24
+ /** @internal */
25
+ export declare const EdgeNetworkTimeoutResponseErrorData$outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData>;
26
+ /**
27
+ * @internal
28
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
29
+ */
30
+ export declare namespace EdgeNetworkTimeoutResponseErrorData$ {
31
+ /** @deprecated use `EdgeNetworkTimeoutResponseErrorData$inboundSchema` instead. */
32
+ const inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData, unknown, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseErrorData, unknown>>;
33
+ /** @deprecated use `EdgeNetworkTimeoutResponseErrorData$outboundSchema` instead. */
34
+ const outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData>>;
35
+ /** @deprecated use `EdgeNetworkTimeoutResponseErrorData$Outbound` instead. */
36
+ type Outbound = EdgeNetworkTimeoutResponseErrorData$Outbound;
37
+ }
38
+ export declare function edgeNetworkTimeoutResponseErrorDataToJSON(edgeNetworkTimeoutResponseErrorData: EdgeNetworkTimeoutResponseErrorData): string;
39
+ export declare function edgeNetworkTimeoutResponseErrorDataFromJSON(jsonString: string): SafeParseResult<EdgeNetworkTimeoutResponseErrorData, SDKValidationError>;
40
+ //# sourceMappingURL=edgenetworktimeoutresponseerrordata.d.ts.map
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { safeParse } from "../lib/schemas.js";
6
+ /** @internal */
7
+ export const EdgeNetworkTimeoutResponseErrorData$inboundSchema = z.object({
8
+ code: z.number().int(),
9
+ message: z.string(),
10
+ metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
11
+ });
12
+ /** @internal */
13
+ export const EdgeNetworkTimeoutResponseErrorData$outboundSchema = z.object({
14
+ code: z.number().int(),
15
+ message: z.string(),
16
+ metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
17
+ });
18
+ /**
19
+ * @internal
20
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
21
+ */
22
+ export var EdgeNetworkTimeoutResponseErrorData$;
23
+ (function (EdgeNetworkTimeoutResponseErrorData$) {
24
+ /** @deprecated use `EdgeNetworkTimeoutResponseErrorData$inboundSchema` instead. */
25
+ EdgeNetworkTimeoutResponseErrorData$.inboundSchema = EdgeNetworkTimeoutResponseErrorData$inboundSchema;
26
+ /** @deprecated use `EdgeNetworkTimeoutResponseErrorData$outboundSchema` instead. */
27
+ EdgeNetworkTimeoutResponseErrorData$.outboundSchema = EdgeNetworkTimeoutResponseErrorData$outboundSchema;
28
+ })(EdgeNetworkTimeoutResponseErrorData$ || (EdgeNetworkTimeoutResponseErrorData$ = {}));
29
+ export function edgeNetworkTimeoutResponseErrorDataToJSON(edgeNetworkTimeoutResponseErrorData) {
30
+ return JSON.stringify(EdgeNetworkTimeoutResponseErrorData$outboundSchema.parse(edgeNetworkTimeoutResponseErrorData));
31
+ }
32
+ export function edgeNetworkTimeoutResponseErrorDataFromJSON(jsonString) {
33
+ return safeParse(jsonString, (x) => EdgeNetworkTimeoutResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EdgeNetworkTimeoutResponseErrorData' from JSON`);
34
+ }
35
+ //# sourceMappingURL=edgenetworktimeoutresponseerrordata.js.map
@@ -0,0 +1,26 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const EndpointStatus: {
4
+ readonly Zero: 0;
5
+ readonly Minus1: -1;
6
+ readonly Minus2: -2;
7
+ readonly Minus3: -3;
8
+ readonly Minus5: -5;
9
+ readonly Minus10: -10;
10
+ };
11
+ export type EndpointStatus = OpenEnum<typeof EndpointStatus>;
12
+ /** @internal */
13
+ export declare const EndpointStatus$inboundSchema: z.ZodType<EndpointStatus, unknown>;
14
+ /** @internal */
15
+ export declare const EndpointStatus$outboundSchema: z.ZodType<EndpointStatus, EndpointStatus>;
16
+ /**
17
+ * @internal
18
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
19
+ */
20
+ export declare namespace EndpointStatus$ {
21
+ /** @deprecated use `EndpointStatus$inboundSchema` instead. */
22
+ const inboundSchema: z.ZodType<EndpointStatus, unknown, z.core.$ZodTypeInternals<EndpointStatus, unknown>>;
23
+ /** @deprecated use `EndpointStatus$outboundSchema` instead. */
24
+ const outboundSchema: z.ZodType<EndpointStatus, EndpointStatus, z.core.$ZodTypeInternals<EndpointStatus, EndpointStatus>>;
25
+ }
26
+ //# sourceMappingURL=endpointstatus.d.ts.map
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { catchUnrecognizedEnum, } from "../types/enums.js";
6
+ export const EndpointStatus = {
7
+ Zero: 0,
8
+ Minus1: -1,
9
+ Minus2: -2,
10
+ Minus3: -3,
11
+ Minus5: -5,
12
+ Minus10: -10,
13
+ };
14
+ /** @internal */
15
+ export const EndpointStatus$inboundSchema = z
16
+ .union([
17
+ z.enum(EndpointStatus),
18
+ z.number().transform(catchUnrecognizedEnum),
19
+ ]);
20
+ /** @internal */
21
+ export const EndpointStatus$outboundSchema = z.union([
22
+ z.enum(EndpointStatus),
23
+ z.number().and(z.custom()),
24
+ ]);
25
+ /**
26
+ * @internal
27
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
28
+ */
29
+ export var EndpointStatus$;
30
+ (function (EndpointStatus$) {
31
+ /** @deprecated use `EndpointStatus$inboundSchema` instead. */
32
+ EndpointStatus$.inboundSchema = EndpointStatus$inboundSchema;
33
+ /** @deprecated use `EndpointStatus$outboundSchema` instead. */
34
+ EndpointStatus$.outboundSchema = EndpointStatus$outboundSchema;
35
+ })(EndpointStatus$ || (EndpointStatus$ = {}));
36
+ //# sourceMappingURL=endpointstatus.js.map
@@ -0,0 +1,52 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ import { OpenRouterError } from "./openroutererror.js";
4
+ /**
5
+ * Bad Gateway - Provider/upstream API failure
6
+ */
7
+ export type BadGatewayResponseErrorData = {
8
+ /**
9
+ * Error data for BadGatewayResponse
10
+ */
11
+ error: models.BadGatewayResponseErrorData;
12
+ userId?: string | null | undefined;
13
+ };
14
+ /**
15
+ * Bad Gateway - Provider/upstream API failure
16
+ */
17
+ export declare class BadGatewayResponseError extends OpenRouterError {
18
+ /**
19
+ * Error data for BadGatewayResponse
20
+ */
21
+ error: models.BadGatewayResponseErrorData;
22
+ userId?: string | null | undefined;
23
+ /** The original data that was passed to this error instance. */
24
+ data$: BadGatewayResponseErrorData;
25
+ constructor(err: BadGatewayResponseErrorData, httpMeta: {
26
+ response: Response;
27
+ request: Request;
28
+ body: string;
29
+ });
30
+ }
31
+ /** @internal */
32
+ export declare const BadGatewayResponseError$inboundSchema: z.ZodType<BadGatewayResponseError, unknown>;
33
+ /** @internal */
34
+ export type BadGatewayResponseError$Outbound = {
35
+ error: models.BadGatewayResponseErrorData$Outbound;
36
+ user_id?: string | null | undefined;
37
+ };
38
+ /** @internal */
39
+ export declare const BadGatewayResponseError$outboundSchema: z.ZodType<BadGatewayResponseError$Outbound, BadGatewayResponseError>;
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export declare namespace BadGatewayResponseError$ {
45
+ /** @deprecated use `BadGatewayResponseError$inboundSchema` instead. */
46
+ const inboundSchema: z.ZodType<BadGatewayResponseError, unknown, z.core.$ZodTypeInternals<BadGatewayResponseError, unknown>>;
47
+ /** @deprecated use `BadGatewayResponseError$outboundSchema` instead. */
48
+ const outboundSchema: z.ZodType<BadGatewayResponseError$Outbound, BadGatewayResponseError, z.core.$ZodTypeInternals<BadGatewayResponseError$Outbound, BadGatewayResponseError>>;
49
+ /** @deprecated use `BadGatewayResponseError$Outbound` instead. */
50
+ type Outbound = BadGatewayResponseError$Outbound;
51
+ }
52
+ //# sourceMappingURL=badgatewayresponseerror.d.ts.map
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../../lib/primitives.js";
6
+ import * as models from "../index.js";
7
+ import { OpenRouterError } from "./openroutererror.js";
8
+ /**
9
+ * Bad Gateway - Provider/upstream API failure
10
+ */
11
+ export class BadGatewayResponseError extends OpenRouterError {
12
+ constructor(err, httpMeta) {
13
+ const message = err.error?.message
14
+ || `API error occurred: ${JSON.stringify(err)}`;
15
+ super(message, httpMeta);
16
+ this.data$ = err;
17
+ this.error = err.error;
18
+ if (err.userId != null)
19
+ this.userId = err.userId;
20
+ this.name = "BadGatewayResponseError";
21
+ }
22
+ }
23
+ /** @internal */
24
+ export const BadGatewayResponseError$inboundSchema = z.object({
25
+ error: models.BadGatewayResponseErrorData$inboundSchema,
26
+ user_id: z.nullable(z.string()).optional(),
27
+ request$: z.custom(x => x instanceof Request),
28
+ response$: z.custom(x => x instanceof Response),
29
+ body$: z.string(),
30
+ })
31
+ .transform((v) => {
32
+ const remapped = remap$(v, {
33
+ "user_id": "userId",
34
+ });
35
+ return new BadGatewayResponseError(remapped, {
36
+ request: v.request$,
37
+ response: v.response$,
38
+ body: v.body$,
39
+ });
40
+ });
41
+ /** @internal */
42
+ export const BadGatewayResponseError$outboundSchema = z.custom(x => x instanceof BadGatewayResponseError)
43
+ .transform(v => v.data$)
44
+ .pipe(z.object({
45
+ error: models.BadGatewayResponseErrorData$outboundSchema,
46
+ userId: z.nullable(z.string()).optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ userId: "user_id",
50
+ });
51
+ }));
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export var BadGatewayResponseError$;
57
+ (function (BadGatewayResponseError$) {
58
+ /** @deprecated use `BadGatewayResponseError$inboundSchema` instead. */
59
+ BadGatewayResponseError$.inboundSchema = BadGatewayResponseError$inboundSchema;
60
+ /** @deprecated use `BadGatewayResponseError$outboundSchema` instead. */
61
+ BadGatewayResponseError$.outboundSchema = BadGatewayResponseError$outboundSchema;
62
+ })(BadGatewayResponseError$ || (BadGatewayResponseError$ = {}));
63
+ //# sourceMappingURL=badgatewayresponseerror.js.map
@@ -0,0 +1,52 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ import { OpenRouterError } from "./openroutererror.js";
4
+ /**
5
+ * Bad Request - Invalid request parameters or malformed input
6
+ */
7
+ export type BadRequestResponseErrorData = {
8
+ /**
9
+ * Error data for BadRequestResponse
10
+ */
11
+ error: models.BadRequestResponseErrorData;
12
+ userId?: string | null | undefined;
13
+ };
14
+ /**
15
+ * Bad Request - Invalid request parameters or malformed input
16
+ */
17
+ export declare class BadRequestResponseError extends OpenRouterError {
18
+ /**
19
+ * Error data for BadRequestResponse
20
+ */
21
+ error: models.BadRequestResponseErrorData;
22
+ userId?: string | null | undefined;
23
+ /** The original data that was passed to this error instance. */
24
+ data$: BadRequestResponseErrorData;
25
+ constructor(err: BadRequestResponseErrorData, httpMeta: {
26
+ response: Response;
27
+ request: Request;
28
+ body: string;
29
+ });
30
+ }
31
+ /** @internal */
32
+ export declare const BadRequestResponseError$inboundSchema: z.ZodType<BadRequestResponseError, unknown>;
33
+ /** @internal */
34
+ export type BadRequestResponseError$Outbound = {
35
+ error: models.BadRequestResponseErrorData$Outbound;
36
+ user_id?: string | null | undefined;
37
+ };
38
+ /** @internal */
39
+ export declare const BadRequestResponseError$outboundSchema: z.ZodType<BadRequestResponseError$Outbound, BadRequestResponseError>;
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export declare namespace BadRequestResponseError$ {
45
+ /** @deprecated use `BadRequestResponseError$inboundSchema` instead. */
46
+ const inboundSchema: z.ZodType<BadRequestResponseError, unknown, z.core.$ZodTypeInternals<BadRequestResponseError, unknown>>;
47
+ /** @deprecated use `BadRequestResponseError$outboundSchema` instead. */
48
+ const outboundSchema: z.ZodType<BadRequestResponseError$Outbound, BadRequestResponseError, z.core.$ZodTypeInternals<BadRequestResponseError$Outbound, BadRequestResponseError>>;
49
+ /** @deprecated use `BadRequestResponseError$Outbound` instead. */
50
+ type Outbound = BadRequestResponseError$Outbound;
51
+ }
52
+ //# sourceMappingURL=badrequestresponseerror.d.ts.map
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../../lib/primitives.js";
6
+ import * as models from "../index.js";
7
+ import { OpenRouterError } from "./openroutererror.js";
8
+ /**
9
+ * Bad Request - Invalid request parameters or malformed input
10
+ */
11
+ export class BadRequestResponseError extends OpenRouterError {
12
+ constructor(err, httpMeta) {
13
+ const message = err.error?.message
14
+ || `API error occurred: ${JSON.stringify(err)}`;
15
+ super(message, httpMeta);
16
+ this.data$ = err;
17
+ this.error = err.error;
18
+ if (err.userId != null)
19
+ this.userId = err.userId;
20
+ this.name = "BadRequestResponseError";
21
+ }
22
+ }
23
+ /** @internal */
24
+ export const BadRequestResponseError$inboundSchema = z.object({
25
+ error: models.BadRequestResponseErrorData$inboundSchema,
26
+ user_id: z.nullable(z.string()).optional(),
27
+ request$: z.custom(x => x instanceof Request),
28
+ response$: z.custom(x => x instanceof Response),
29
+ body$: z.string(),
30
+ })
31
+ .transform((v) => {
32
+ const remapped = remap$(v, {
33
+ "user_id": "userId",
34
+ });
35
+ return new BadRequestResponseError(remapped, {
36
+ request: v.request$,
37
+ response: v.response$,
38
+ body: v.body$,
39
+ });
40
+ });
41
+ /** @internal */
42
+ export const BadRequestResponseError$outboundSchema = z.custom(x => x instanceof BadRequestResponseError)
43
+ .transform(v => v.data$)
44
+ .pipe(z.object({
45
+ error: models.BadRequestResponseErrorData$outboundSchema,
46
+ userId: z.nullable(z.string()).optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ userId: "user_id",
50
+ });
51
+ }));
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export var BadRequestResponseError$;
57
+ (function (BadRequestResponseError$) {
58
+ /** @deprecated use `BadRequestResponseError$inboundSchema` instead. */
59
+ BadRequestResponseError$.inboundSchema = BadRequestResponseError$inboundSchema;
60
+ /** @deprecated use `BadRequestResponseError$outboundSchema` instead. */
61
+ BadRequestResponseError$.outboundSchema = BadRequestResponseError$outboundSchema;
62
+ })(BadRequestResponseError$ || (BadRequestResponseError$ = {}));
63
+ //# sourceMappingURL=badrequestresponseerror.js.map
@@ -0,0 +1,52 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ import { OpenRouterError } from "./openroutererror.js";
4
+ /**
5
+ * Infrastructure Timeout - Provider request timed out at edge network
6
+ */
7
+ export type EdgeNetworkTimeoutResponseErrorData = {
8
+ /**
9
+ * Error data for EdgeNetworkTimeoutResponse
10
+ */
11
+ error: models.EdgeNetworkTimeoutResponseErrorData;
12
+ userId?: string | null | undefined;
13
+ };
14
+ /**
15
+ * Infrastructure Timeout - Provider request timed out at edge network
16
+ */
17
+ export declare class EdgeNetworkTimeoutResponseError extends OpenRouterError {
18
+ /**
19
+ * Error data for EdgeNetworkTimeoutResponse
20
+ */
21
+ error: models.EdgeNetworkTimeoutResponseErrorData;
22
+ userId?: string | null | undefined;
23
+ /** The original data that was passed to this error instance. */
24
+ data$: EdgeNetworkTimeoutResponseErrorData;
25
+ constructor(err: EdgeNetworkTimeoutResponseErrorData, httpMeta: {
26
+ response: Response;
27
+ request: Request;
28
+ body: string;
29
+ });
30
+ }
31
+ /** @internal */
32
+ export declare const EdgeNetworkTimeoutResponseError$inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseError, unknown>;
33
+ /** @internal */
34
+ export type EdgeNetworkTimeoutResponseError$Outbound = {
35
+ error: models.EdgeNetworkTimeoutResponseErrorData$Outbound;
36
+ user_id?: string | null | undefined;
37
+ };
38
+ /** @internal */
39
+ export declare const EdgeNetworkTimeoutResponseError$outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseError$Outbound, EdgeNetworkTimeoutResponseError>;
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export declare namespace EdgeNetworkTimeoutResponseError$ {
45
+ /** @deprecated use `EdgeNetworkTimeoutResponseError$inboundSchema` instead. */
46
+ const inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseError, unknown, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseError, unknown>>;
47
+ /** @deprecated use `EdgeNetworkTimeoutResponseError$outboundSchema` instead. */
48
+ const outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseError$Outbound, EdgeNetworkTimeoutResponseError, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseError$Outbound, EdgeNetworkTimeoutResponseError>>;
49
+ /** @deprecated use `EdgeNetworkTimeoutResponseError$Outbound` instead. */
50
+ type Outbound = EdgeNetworkTimeoutResponseError$Outbound;
51
+ }
52
+ //# sourceMappingURL=edgenetworktimeoutresponseerror.d.ts.map
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../../lib/primitives.js";
6
+ import * as models from "../index.js";
7
+ import { OpenRouterError } from "./openroutererror.js";
8
+ /**
9
+ * Infrastructure Timeout - Provider request timed out at edge network
10
+ */
11
+ export class EdgeNetworkTimeoutResponseError extends OpenRouterError {
12
+ constructor(err, httpMeta) {
13
+ const message = err.error?.message
14
+ || `API error occurred: ${JSON.stringify(err)}`;
15
+ super(message, httpMeta);
16
+ this.data$ = err;
17
+ this.error = err.error;
18
+ if (err.userId != null)
19
+ this.userId = err.userId;
20
+ this.name = "EdgeNetworkTimeoutResponseError";
21
+ }
22
+ }
23
+ /** @internal */
24
+ export const EdgeNetworkTimeoutResponseError$inboundSchema = z.object({
25
+ error: models.EdgeNetworkTimeoutResponseErrorData$inboundSchema,
26
+ user_id: z.nullable(z.string()).optional(),
27
+ request$: z.custom(x => x instanceof Request),
28
+ response$: z.custom(x => x instanceof Response),
29
+ body$: z.string(),
30
+ })
31
+ .transform((v) => {
32
+ const remapped = remap$(v, {
33
+ "user_id": "userId",
34
+ });
35
+ return new EdgeNetworkTimeoutResponseError(remapped, {
36
+ request: v.request$,
37
+ response: v.response$,
38
+ body: v.body$,
39
+ });
40
+ });
41
+ /** @internal */
42
+ export const EdgeNetworkTimeoutResponseError$outboundSchema = z.custom(x => x instanceof EdgeNetworkTimeoutResponseError)
43
+ .transform(v => v.data$)
44
+ .pipe(z.object({
45
+ error: models.EdgeNetworkTimeoutResponseErrorData$outboundSchema,
46
+ userId: z.nullable(z.string()).optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ userId: "user_id",
50
+ });
51
+ }));
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export var EdgeNetworkTimeoutResponseError$;
57
+ (function (EdgeNetworkTimeoutResponseError$) {
58
+ /** @deprecated use `EdgeNetworkTimeoutResponseError$inboundSchema` instead. */
59
+ EdgeNetworkTimeoutResponseError$.inboundSchema = EdgeNetworkTimeoutResponseError$inboundSchema;
60
+ /** @deprecated use `EdgeNetworkTimeoutResponseError$outboundSchema` instead. */
61
+ EdgeNetworkTimeoutResponseError$.outboundSchema = EdgeNetworkTimeoutResponseError$outboundSchema;
62
+ })(EdgeNetworkTimeoutResponseError$ || (EdgeNetworkTimeoutResponseError$ = {}));
63
+ //# sourceMappingURL=edgenetworktimeoutresponseerror.js.map