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

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 (227) hide show
  1. package/FUNCTIONS.md +109 -1
  2. package/REACT_QUERY.md +109 -1
  3. package/README.md +686 -15
  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 +38 -14
  20. package/esm/funcs/chatSend.d.ts +1 -1
  21. package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
  22. package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
  23. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  24. package/esm/funcs/creditsGetCredits.js +2 -2
  25. package/esm/funcs/endpointsList.d.ts +1 -1
  26. package/esm/funcs/endpointsList.js +2 -2
  27. package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
  28. package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
  29. package/esm/funcs/generationsGetGeneration.d.ts +1 -1
  30. package/esm/funcs/generationsGetGeneration.js +13 -2
  31. package/esm/funcs/modelsCount.d.ts +3 -2
  32. package/esm/funcs/modelsCount.js +7 -3
  33. package/esm/funcs/modelsList.d.ts +3 -1
  34. package/esm/funcs/modelsList.js +8 -7
  35. package/esm/funcs/modelsListForUser.d.ts +3 -1
  36. package/esm/funcs/modelsListForUser.js +7 -3
  37. package/esm/funcs/oAuthCreateAuthCode.d.ts +18 -0
  38. package/esm/funcs/oAuthCreateAuthCode.js +82 -0
  39. package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +2 -2
  40. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.d.ts +18 -0
  41. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +82 -0
  42. package/esm/funcs/parametersGetParameters.d.ts +1 -1
  43. package/esm/funcs/parametersGetParameters.js +2 -2
  44. package/esm/funcs/providersList.d.ts +1 -1
  45. package/esm/funcs/providersList.js +1 -1
  46. package/esm/lib/config.d.ts +2 -2
  47. package/esm/lib/config.js +2 -2
  48. package/esm/lib/event-streams.d.ts +1 -1
  49. package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
  50. package/esm/models/badgatewayresponseerrordata.js +35 -0
  51. package/esm/models/badrequestresponseerrordata.d.ts +40 -0
  52. package/esm/models/badrequestresponseerrordata.js +35 -0
  53. package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
  54. package/esm/models/chatmessagecontentitemaudio.js +14 -14
  55. package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
  56. package/esm/models/chatstreamingresponsechunk.js +15 -15
  57. package/esm/models/createchargerequest.d.ts +31 -2
  58. package/esm/models/createchargerequest.js +47 -2
  59. package/esm/models/defaultparameters.d.ts +36 -0
  60. package/esm/models/defaultparameters.js +46 -0
  61. package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
  62. package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
  63. package/esm/models/endpointstatus.d.ts +26 -0
  64. package/esm/models/endpointstatus.js +36 -0
  65. package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
  66. package/esm/models/errors/badgatewayresponseerror.js +63 -0
  67. package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
  68. package/esm/models/errors/badrequestresponseerror.js +63 -0
  69. package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
  70. package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
  71. package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
  72. package/esm/models/errors/forbiddenresponseerror.js +63 -0
  73. package/esm/models/errors/index.d.ts +14 -2
  74. package/esm/models/errors/index.js +14 -2
  75. package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
  76. package/esm/models/errors/internalserverresponseerror.js +63 -0
  77. package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
  78. package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
  79. package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
  80. package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
  81. package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
  82. package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
  83. package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
  84. package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
  85. package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
  86. package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
  87. package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
  88. package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
  89. package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
  90. package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
  91. package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
  92. package/esm/models/errors/unauthorizedresponseerror.js +63 -0
  93. package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
  94. package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
  95. package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
  96. package/esm/models/forbiddenresponseerrordata.js +35 -0
  97. package/esm/models/index.d.ts +37 -1
  98. package/esm/models/index.js +37 -1
  99. package/esm/models/inputmodality.d.ts +24 -0
  100. package/esm/models/inputmodality.js +34 -0
  101. package/esm/models/instructtype.d.ts +48 -0
  102. package/esm/models/instructtype.js +55 -0
  103. package/esm/models/internalserverresponseerrordata.d.ts +40 -0
  104. package/esm/models/internalserverresponseerrordata.js +35 -0
  105. package/esm/models/listendpointsresponse.d.ts +126 -2
  106. package/esm/models/listendpointsresponse.js +115 -2
  107. package/esm/models/model.d.ts +101 -0
  108. package/esm/models/model.js +82 -0
  109. package/esm/models/modelarchitecture.d.ts +104 -0
  110. package/esm/models/modelarchitecture.js +107 -0
  111. package/esm/models/modelgroup.d.ts +45 -0
  112. package/esm/models/modelgroup.js +53 -0
  113. package/esm/models/modelscountresponse.d.ts +40 -2
  114. package/esm/models/modelscountresponse.js +31 -2
  115. package/esm/models/modelslistresponse.d.ts +10 -2
  116. package/esm/models/modelslistresponse.js +7 -2
  117. package/esm/models/notfoundresponseerrordata.d.ts +40 -0
  118. package/esm/models/notfoundresponseerrordata.js +35 -0
  119. package/esm/models/openairesponsesincludable.d.ts +25 -0
  120. package/esm/models/openairesponsesincludable.js +35 -0
  121. package/esm/models/openairesponsesinputunion.d.ts +78 -78
  122. package/esm/models/openairesponsesinputunion.js +124 -126
  123. package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
  124. package/esm/models/openresponseseasyinputmessage.js +283 -0
  125. package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
  126. package/esm/models/openresponsesfunctioncalloutput.js +67 -0
  127. package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
  128. package/esm/models/openresponsesfunctiontoolcall.js +69 -0
  129. package/esm/models/openresponsesinput.d.ts +60 -0
  130. package/esm/models/openresponsesinput.js +113 -0
  131. package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
  132. package/esm/models/openresponsesinputmessageitem.js +210 -0
  133. package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
  134. package/esm/models/openresponsesnonstreamingresponse.js +13 -13
  135. package/esm/models/openresponsesreasoning.d.ts +179 -0
  136. package/esm/models/openresponsesreasoning.js +194 -0
  137. package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
  138. package/esm/models/openresponsesreasoningconfig.js +48 -0
  139. package/esm/models/openresponsesrequest.d.ts +736 -2
  140. package/esm/models/openresponsesrequest.js +789 -2
  141. package/esm/models/openresponsesresponsetext.d.ts +59 -0
  142. package/esm/models/openresponsesresponsetext.js +64 -0
  143. package/esm/models/operations/createauthkeyscode.d.ts +145 -0
  144. package/esm/models/operations/createauthkeyscode.js +146 -0
  145. package/esm/models/operations/createresponses.d.ts +58 -0
  146. package/esm/models/operations/createresponses.js +80 -0
  147. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +104 -0
  148. package/esm/models/operations/exchangeauthcodeforapikey.js +111 -0
  149. package/esm/models/operations/getmodels.d.ts +0 -26
  150. package/esm/models/operations/getmodels.js +0 -38
  151. package/esm/models/operations/index.d.ts +3 -2
  152. package/esm/models/operations/index.js +3 -2
  153. package/esm/models/operations/listendpointszdr.d.ts +3 -24
  154. package/esm/models/operations/listendpointszdr.js +2 -29
  155. package/esm/models/operations/listmodelsuser.d.ts +0 -22
  156. package/esm/models/operations/listmodelsuser.js +0 -28
  157. package/esm/models/operations/listproviders.d.ts +0 -36
  158. package/esm/models/operations/listproviders.js +0 -28
  159. package/esm/models/operations/sendchatcompletionrequest.d.ts +1 -1
  160. package/esm/models/operations/sendchatcompletionrequest.js +2 -1
  161. package/esm/models/outputmodality.d.ts +23 -0
  162. package/esm/models/outputmodality.js +33 -0
  163. package/esm/models/parameter.d.ts +43 -0
  164. package/esm/models/parameter.js +54 -0
  165. package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
  166. package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
  167. package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
  168. package/esm/models/paymentrequiredresponseerrordata.js +35 -0
  169. package/esm/models/perrequestlimits.d.ts +40 -0
  170. package/esm/models/perrequestlimits.js +44 -0
  171. package/esm/models/providername.d.ts +106 -0
  172. package/esm/models/providername.js +116 -0
  173. package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
  174. package/esm/models/provideroverloadedresponseerrordata.js +35 -0
  175. package/esm/models/publicendpoint.d.ts +140 -2
  176. package/esm/models/publicendpoint.js +156 -2
  177. package/esm/models/publicpricing.d.ts +87 -0
  178. package/esm/models/publicpricing.js +73 -0
  179. package/esm/models/quantization.d.ts +29 -0
  180. package/esm/models/quantization.js +39 -0
  181. package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
  182. package/esm/models/requesttimeoutresponseerrordata.js +35 -0
  183. package/esm/models/responseserrorfield.d.ts +10 -10
  184. package/esm/models/responseserrorfield.js +14 -14
  185. package/esm/models/responsetextconfig.d.ts +10 -10
  186. package/esm/models/responsetextconfig.js +14 -15
  187. package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
  188. package/esm/models/serviceunavailableresponseerrordata.js +35 -0
  189. package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
  190. package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
  191. package/esm/models/topproviderinfo.d.ts +45 -0
  192. package/esm/models/topproviderinfo.js +48 -0
  193. package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
  194. package/esm/models/unauthorizedresponseerrordata.js +35 -0
  195. package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
  196. package/esm/models/unprocessableentityresponseerrordata.js +35 -0
  197. package/esm/react-query/betaResponsesSend.d.ts +1 -1
  198. package/esm/react-query/index.d.ts +2 -0
  199. package/esm/react-query/index.js +2 -0
  200. package/esm/react-query/modelsCount.d.ts +2 -2
  201. package/esm/react-query/modelsList.d.ts +2 -7
  202. package/esm/react-query/modelsList.js +0 -2
  203. package/esm/react-query/modelsListForUser.d.ts +2 -1
  204. package/esm/react-query/oAuthCreateAuthCode.d.ts +23 -0
  205. package/esm/react-query/oAuthCreateAuthCode.js +42 -0
  206. package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.d.ts +23 -0
  207. package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.js +42 -0
  208. package/esm/sdk/chat.d.ts +1 -1
  209. package/esm/sdk/models.d.ts +4 -3
  210. package/esm/sdk/oauth.d.ts +46 -0
  211. package/esm/sdk/oauth.js +67 -0
  212. package/esm/sdk/responses.d.ts +8 -1
  213. package/esm/sdk/responses.js +0 -6
  214. package/esm/sdk/sdk.d.ts +3 -0
  215. package/esm/sdk/sdk.js +4 -0
  216. package/jsr.json +1 -1
  217. package/package.json +3 -1
  218. package/vitest.config.ts +8 -1
  219. package/esm/models/errorresponse.d.ts +0 -155
  220. package/esm/models/errorresponse.js +0 -167
  221. package/esm/models/errors/errorresponse.d.ts +0 -46
  222. package/esm/models/errors/listproviders.d.ts +0 -49
  223. package/esm/models/errors/listproviders.js +0 -51
  224. package/esm/models/operations/createapialpharesponses.d.ts +0 -58
  225. package/esm/models/operations/createapialpharesponses.js +0 -83
  226. package/esm/models/operations/listmodelscount.d.ts +0 -26
  227. package/esm/models/operations/listmodelscount.js +0 -34
@@ -0,0 +1,48 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Instruction format type
5
+ */
6
+ export declare const InstructType: {
7
+ readonly None: "none";
8
+ readonly Airoboros: "airoboros";
9
+ readonly Alpaca: "alpaca";
10
+ readonly AlpacaModif: "alpaca-modif";
11
+ readonly Chatml: "chatml";
12
+ readonly Claude: "claude";
13
+ readonly CodeLlama: "code-llama";
14
+ readonly Gemma: "gemma";
15
+ readonly Llama2: "llama2";
16
+ readonly Llama3: "llama3";
17
+ readonly Mistral: "mistral";
18
+ readonly Nemotron: "nemotron";
19
+ readonly Neural: "neural";
20
+ readonly Openchat: "openchat";
21
+ readonly Phi3: "phi3";
22
+ readonly Rwkv: "rwkv";
23
+ readonly Vicuna: "vicuna";
24
+ readonly Zephyr: "zephyr";
25
+ readonly DeepseekR1: "deepseek-r1";
26
+ readonly DeepseekV31: "deepseek-v3.1";
27
+ readonly Qwq: "qwq";
28
+ readonly Qwen3: "qwen3";
29
+ };
30
+ /**
31
+ * Instruction format type
32
+ */
33
+ export type InstructType = OpenEnum<typeof InstructType>;
34
+ /** @internal */
35
+ export declare const InstructType$inboundSchema: z.ZodType<InstructType, unknown>;
36
+ /** @internal */
37
+ export declare const InstructType$outboundSchema: z.ZodType<InstructType, InstructType>;
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export declare namespace InstructType$ {
43
+ /** @deprecated use `InstructType$inboundSchema` instead. */
44
+ const inboundSchema: z.ZodType<InstructType, unknown, z.core.$ZodTypeInternals<InstructType, unknown>>;
45
+ /** @deprecated use `InstructType$outboundSchema` instead. */
46
+ const outboundSchema: z.ZodType<InstructType, InstructType, z.core.$ZodTypeInternals<InstructType, InstructType>>;
47
+ }
48
+ //# sourceMappingURL=instructtype.d.ts.map
@@ -0,0 +1,55 @@
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
+ /**
7
+ * Instruction format type
8
+ */
9
+ export const InstructType = {
10
+ None: "none",
11
+ Airoboros: "airoboros",
12
+ Alpaca: "alpaca",
13
+ AlpacaModif: "alpaca-modif",
14
+ Chatml: "chatml",
15
+ Claude: "claude",
16
+ CodeLlama: "code-llama",
17
+ Gemma: "gemma",
18
+ Llama2: "llama2",
19
+ Llama3: "llama3",
20
+ Mistral: "mistral",
21
+ Nemotron: "nemotron",
22
+ Neural: "neural",
23
+ Openchat: "openchat",
24
+ Phi3: "phi3",
25
+ Rwkv: "rwkv",
26
+ Vicuna: "vicuna",
27
+ Zephyr: "zephyr",
28
+ DeepseekR1: "deepseek-r1",
29
+ DeepseekV31: "deepseek-v3.1",
30
+ Qwq: "qwq",
31
+ Qwen3: "qwen3",
32
+ };
33
+ /** @internal */
34
+ export const InstructType$inboundSchema = z
35
+ .union([
36
+ z.enum(InstructType),
37
+ z.string().transform(catchUnrecognizedEnum),
38
+ ]);
39
+ /** @internal */
40
+ export const InstructType$outboundSchema = z.union([
41
+ z.enum(InstructType),
42
+ z.string().and(z.custom()),
43
+ ]);
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export var InstructType$;
49
+ (function (InstructType$) {
50
+ /** @deprecated use `InstructType$inboundSchema` instead. */
51
+ InstructType$.inboundSchema = InstructType$inboundSchema;
52
+ /** @deprecated use `InstructType$outboundSchema` instead. */
53
+ InstructType$.outboundSchema = InstructType$outboundSchema;
54
+ })(InstructType$ || (InstructType$ = {}));
55
+ //# sourceMappingURL=instructtype.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 InternalServerResponse
6
+ */
7
+ export type InternalServerResponseErrorData = {
8
+ code: number;
9
+ message: string;
10
+ metadata?: {
11
+ [k: string]: any | null;
12
+ } | null | undefined;
13
+ };
14
+ /** @internal */
15
+ export declare const InternalServerResponseErrorData$inboundSchema: z.ZodType<InternalServerResponseErrorData, unknown>;
16
+ /** @internal */
17
+ export type InternalServerResponseErrorData$Outbound = {
18
+ code: number;
19
+ message: string;
20
+ metadata?: {
21
+ [k: string]: any | null;
22
+ } | null | undefined;
23
+ };
24
+ /** @internal */
25
+ export declare const InternalServerResponseErrorData$outboundSchema: z.ZodType<InternalServerResponseErrorData$Outbound, InternalServerResponseErrorData>;
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 InternalServerResponseErrorData$ {
31
+ /** @deprecated use `InternalServerResponseErrorData$inboundSchema` instead. */
32
+ const inboundSchema: z.ZodType<InternalServerResponseErrorData, unknown, z.core.$ZodTypeInternals<InternalServerResponseErrorData, unknown>>;
33
+ /** @deprecated use `InternalServerResponseErrorData$outboundSchema` instead. */
34
+ const outboundSchema: z.ZodType<InternalServerResponseErrorData$Outbound, InternalServerResponseErrorData, z.core.$ZodTypeInternals<InternalServerResponseErrorData$Outbound, InternalServerResponseErrorData>>;
35
+ /** @deprecated use `InternalServerResponseErrorData$Outbound` instead. */
36
+ type Outbound = InternalServerResponseErrorData$Outbound;
37
+ }
38
+ export declare function internalServerResponseErrorDataToJSON(internalServerResponseErrorData: InternalServerResponseErrorData): string;
39
+ export declare function internalServerResponseErrorDataFromJSON(jsonString: string): SafeParseResult<InternalServerResponseErrorData, SDKValidationError>;
40
+ //# sourceMappingURL=internalserverresponseerrordata.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 InternalServerResponseErrorData$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 InternalServerResponseErrorData$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 InternalServerResponseErrorData$;
23
+ (function (InternalServerResponseErrorData$) {
24
+ /** @deprecated use `InternalServerResponseErrorData$inboundSchema` instead. */
25
+ InternalServerResponseErrorData$.inboundSchema = InternalServerResponseErrorData$inboundSchema;
26
+ /** @deprecated use `InternalServerResponseErrorData$outboundSchema` instead. */
27
+ InternalServerResponseErrorData$.outboundSchema = InternalServerResponseErrorData$outboundSchema;
28
+ })(InternalServerResponseErrorData$ || (InternalServerResponseErrorData$ = {}));
29
+ export function internalServerResponseErrorDataToJSON(internalServerResponseErrorData) {
30
+ return JSON.stringify(InternalServerResponseErrorData$outboundSchema.parse(internalServerResponseErrorData));
31
+ }
32
+ export function internalServerResponseErrorDataFromJSON(jsonString) {
33
+ return safeParse(jsonString, (x) => InternalServerResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternalServerResponseErrorData' from JSON`);
34
+ }
35
+ //# sourceMappingURL=internalserverresponseerrordata.js.map
@@ -1,14 +1,138 @@
1
1
  import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { InputModality } from "./inputmodality.js";
6
+ import { InstructType } from "./instructtype.js";
7
+ import { OutputModality } from "./outputmodality.js";
8
+ import { PublicEndpoint, PublicEndpoint$Outbound } from "./publicendpoint.js";
9
+ /**
10
+ * Tokenizer type used by the model
11
+ */
12
+ export declare const Tokenizer: {
13
+ readonly Router: "Router";
14
+ readonly Media: "Media";
15
+ readonly Other: "Other";
16
+ readonly Gpt: "GPT";
17
+ readonly Claude: "Claude";
18
+ readonly Gemini: "Gemini";
19
+ readonly Grok: "Grok";
20
+ readonly Cohere: "Cohere";
21
+ readonly Nova: "Nova";
22
+ readonly Qwen: "Qwen";
23
+ readonly Yi: "Yi";
24
+ readonly DeepSeek: "DeepSeek";
25
+ readonly Mistral: "Mistral";
26
+ readonly Llama2: "Llama2";
27
+ readonly Llama3: "Llama3";
28
+ readonly Llama4: "Llama4";
29
+ readonly PaLM: "PaLM";
30
+ readonly Rwkv: "RWKV";
31
+ readonly Qwen3: "Qwen3";
32
+ };
33
+ /**
34
+ * Tokenizer type used by the model
35
+ */
36
+ export type Tokenizer = OpenEnum<typeof Tokenizer>;
37
+ /**
38
+ * Model architecture information
39
+ */
40
+ export type Architecture = {
41
+ tokenizer: Tokenizer | null;
42
+ /**
43
+ * Instruction format type
44
+ */
45
+ instructType: InstructType | null;
46
+ /**
47
+ * Primary modality of the model
48
+ */
49
+ modality: string | null;
50
+ /**
51
+ * Supported input modalities
52
+ */
53
+ inputModalities: Array<InputModality>;
54
+ /**
55
+ * Supported output modalities
56
+ */
57
+ outputModalities: Array<OutputModality>;
58
+ };
4
59
  /**
5
60
  * List of available endpoints for a model
6
61
  */
7
- export type ListEndpointsResponse = {};
62
+ export type ListEndpointsResponse = {
63
+ /**
64
+ * Unique identifier for the model
65
+ */
66
+ id: string;
67
+ /**
68
+ * Display name of the model
69
+ */
70
+ name: string;
71
+ /**
72
+ * Unix timestamp of when the model was created
73
+ */
74
+ created: number;
75
+ /**
76
+ * Description of the model
77
+ */
78
+ description: string;
79
+ architecture: Architecture;
80
+ /**
81
+ * List of available endpoints for this model
82
+ */
83
+ endpoints: Array<PublicEndpoint>;
84
+ };
85
+ /** @internal */
86
+ export declare const Tokenizer$inboundSchema: z.ZodType<Tokenizer, unknown>;
87
+ /** @internal */
88
+ export declare const Tokenizer$outboundSchema: z.ZodType<Tokenizer, Tokenizer>;
89
+ /**
90
+ * @internal
91
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
92
+ */
93
+ export declare namespace Tokenizer$ {
94
+ /** @deprecated use `Tokenizer$inboundSchema` instead. */
95
+ const inboundSchema: z.ZodType<Tokenizer, unknown, z.core.$ZodTypeInternals<Tokenizer, unknown>>;
96
+ /** @deprecated use `Tokenizer$outboundSchema` instead. */
97
+ const outboundSchema: z.ZodType<Tokenizer, Tokenizer, z.core.$ZodTypeInternals<Tokenizer, Tokenizer>>;
98
+ }
99
+ /** @internal */
100
+ export declare const Architecture$inboundSchema: z.ZodType<Architecture, unknown>;
101
+ /** @internal */
102
+ export type Architecture$Outbound = {
103
+ tokenizer: string | null;
104
+ instruct_type: string | null;
105
+ modality: string | null;
106
+ input_modalities: Array<string>;
107
+ output_modalities: Array<string>;
108
+ };
109
+ /** @internal */
110
+ export declare const Architecture$outboundSchema: z.ZodType<Architecture$Outbound, Architecture>;
111
+ /**
112
+ * @internal
113
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
114
+ */
115
+ export declare namespace Architecture$ {
116
+ /** @deprecated use `Architecture$inboundSchema` instead. */
117
+ const inboundSchema: z.ZodType<Architecture, unknown, z.core.$ZodTypeInternals<Architecture, unknown>>;
118
+ /** @deprecated use `Architecture$outboundSchema` instead. */
119
+ const outboundSchema: z.ZodType<Architecture$Outbound, Architecture, z.core.$ZodTypeInternals<Architecture$Outbound, Architecture>>;
120
+ /** @deprecated use `Architecture$Outbound` instead. */
121
+ type Outbound = Architecture$Outbound;
122
+ }
123
+ export declare function architectureToJSON(architecture: Architecture): string;
124
+ export declare function architectureFromJSON(jsonString: string): SafeParseResult<Architecture, SDKValidationError>;
8
125
  /** @internal */
9
126
  export declare const ListEndpointsResponse$inboundSchema: z.ZodType<ListEndpointsResponse, unknown>;
10
127
  /** @internal */
11
- export type ListEndpointsResponse$Outbound = {};
128
+ export type ListEndpointsResponse$Outbound = {
129
+ id: string;
130
+ name: string;
131
+ created: number;
132
+ description: string;
133
+ architecture: Architecture$Outbound;
134
+ endpoints: Array<PublicEndpoint$Outbound>;
135
+ };
12
136
  /** @internal */
13
137
  export declare const ListEndpointsResponse$outboundSchema: z.ZodType<ListEndpointsResponse$Outbound, ListEndpointsResponse>;
14
138
  /**
@@ -2,11 +2,124 @@
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
+ import { InputModality$inboundSchema, InputModality$outboundSchema, } from "./inputmodality.js";
9
+ import { InstructType$inboundSchema, InstructType$outboundSchema, } from "./instructtype.js";
10
+ import { OutputModality$inboundSchema, OutputModality$outboundSchema, } from "./outputmodality.js";
11
+ import { PublicEndpoint$inboundSchema, PublicEndpoint$outboundSchema, } from "./publicendpoint.js";
12
+ /**
13
+ * Tokenizer type used by the model
14
+ */
15
+ export const Tokenizer = {
16
+ Router: "Router",
17
+ Media: "Media",
18
+ Other: "Other",
19
+ Gpt: "GPT",
20
+ Claude: "Claude",
21
+ Gemini: "Gemini",
22
+ Grok: "Grok",
23
+ Cohere: "Cohere",
24
+ Nova: "Nova",
25
+ Qwen: "Qwen",
26
+ Yi: "Yi",
27
+ DeepSeek: "DeepSeek",
28
+ Mistral: "Mistral",
29
+ Llama2: "Llama2",
30
+ Llama3: "Llama3",
31
+ Llama4: "Llama4",
32
+ PaLM: "PaLM",
33
+ Rwkv: "RWKV",
34
+ Qwen3: "Qwen3",
35
+ };
36
+ /** @internal */
37
+ export const Tokenizer$inboundSchema = z
38
+ .union([
39
+ z.enum(Tokenizer),
40
+ z.string().transform(catchUnrecognizedEnum),
41
+ ]);
42
+ /** @internal */
43
+ export const Tokenizer$outboundSchema = z
44
+ .union([
45
+ z.enum(Tokenizer),
46
+ z.string().and(z.custom()),
47
+ ]);
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export var Tokenizer$;
53
+ (function (Tokenizer$) {
54
+ /** @deprecated use `Tokenizer$inboundSchema` instead. */
55
+ Tokenizer$.inboundSchema = Tokenizer$inboundSchema;
56
+ /** @deprecated use `Tokenizer$outboundSchema` instead. */
57
+ Tokenizer$.outboundSchema = Tokenizer$outboundSchema;
58
+ })(Tokenizer$ || (Tokenizer$ = {}));
59
+ /** @internal */
60
+ export const Architecture$inboundSchema = z
61
+ .object({
62
+ tokenizer: z.nullable(Tokenizer$inboundSchema),
63
+ instruct_type: z.nullable(InstructType$inboundSchema),
64
+ modality: z.nullable(z.string()),
65
+ input_modalities: z.array(InputModality$inboundSchema),
66
+ output_modalities: z.array(OutputModality$inboundSchema),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ "instruct_type": "instructType",
70
+ "input_modalities": "inputModalities",
71
+ "output_modalities": "outputModalities",
72
+ });
73
+ });
74
+ /** @internal */
75
+ export const Architecture$outboundSchema = z.object({
76
+ tokenizer: z.nullable(Tokenizer$outboundSchema),
77
+ instructType: z.nullable(InstructType$outboundSchema),
78
+ modality: z.nullable(z.string()),
79
+ inputModalities: z.array(InputModality$outboundSchema),
80
+ outputModalities: z.array(OutputModality$outboundSchema),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ instructType: "instruct_type",
84
+ inputModalities: "input_modalities",
85
+ outputModalities: "output_modalities",
86
+ });
87
+ });
88
+ /**
89
+ * @internal
90
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
91
+ */
92
+ export var Architecture$;
93
+ (function (Architecture$) {
94
+ /** @deprecated use `Architecture$inboundSchema` instead. */
95
+ Architecture$.inboundSchema = Architecture$inboundSchema;
96
+ /** @deprecated use `Architecture$outboundSchema` instead. */
97
+ Architecture$.outboundSchema = Architecture$outboundSchema;
98
+ })(Architecture$ || (Architecture$ = {}));
99
+ export function architectureToJSON(architecture) {
100
+ return JSON.stringify(Architecture$outboundSchema.parse(architecture));
101
+ }
102
+ export function architectureFromJSON(jsonString) {
103
+ return safeParse(jsonString, (x) => Architecture$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Architecture' from JSON`);
104
+ }
6
105
  /** @internal */
7
- export const ListEndpointsResponse$inboundSchema = z.object({});
106
+ export const ListEndpointsResponse$inboundSchema = z.object({
107
+ id: z.string(),
108
+ name: z.string(),
109
+ created: z.number(),
110
+ description: z.string(),
111
+ architecture: z.lazy(() => Architecture$inboundSchema),
112
+ endpoints: z.array(PublicEndpoint$inboundSchema),
113
+ });
8
114
  /** @internal */
9
- export const ListEndpointsResponse$outboundSchema = z.object({});
115
+ export const ListEndpointsResponse$outboundSchema = z.object({
116
+ id: z.string(),
117
+ name: z.string(),
118
+ created: z.number(),
119
+ description: z.string(),
120
+ architecture: z.lazy(() => Architecture$outboundSchema),
121
+ endpoints: z.array(PublicEndpoint$outboundSchema),
122
+ });
10
123
  /**
11
124
  * @internal
12
125
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
@@ -0,0 +1,101 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { DefaultParameters, DefaultParameters$Outbound } from "./defaultparameters.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { ModelArchitecture, ModelArchitecture$Outbound } from "./modelarchitecture.js";
6
+ import { Parameter } from "./parameter.js";
7
+ import { PerRequestLimits, PerRequestLimits$Outbound } from "./perrequestlimits.js";
8
+ import { PublicPricing, PublicPricing$Outbound } from "./publicpricing.js";
9
+ import { TopProviderInfo, TopProviderInfo$Outbound } from "./topproviderinfo.js";
10
+ /**
11
+ * Information about an AI model available on OpenRouter
12
+ */
13
+ export type Model = {
14
+ /**
15
+ * Unique identifier for the model
16
+ */
17
+ id: string;
18
+ /**
19
+ * Canonical slug for the model
20
+ */
21
+ canonicalSlug: string;
22
+ /**
23
+ * Hugging Face model identifier, if applicable
24
+ */
25
+ huggingFaceId?: string | null | undefined;
26
+ /**
27
+ * Display name of the model
28
+ */
29
+ name: string;
30
+ /**
31
+ * Unix timestamp of when the model was created
32
+ */
33
+ created: number;
34
+ /**
35
+ * Description of the model
36
+ */
37
+ description?: string | undefined;
38
+ /**
39
+ * Pricing information for the model
40
+ */
41
+ pricing: PublicPricing;
42
+ /**
43
+ * Maximum context length in tokens
44
+ */
45
+ contextLength: number | null;
46
+ /**
47
+ * Model architecture information
48
+ */
49
+ architecture: ModelArchitecture;
50
+ /**
51
+ * Information about the top provider for this model
52
+ */
53
+ topProvider: TopProviderInfo;
54
+ /**
55
+ * Per-request token limits
56
+ */
57
+ perRequestLimits: PerRequestLimits | null;
58
+ /**
59
+ * List of supported parameters for this model
60
+ */
61
+ supportedParameters: Array<Parameter>;
62
+ /**
63
+ * Default parameters for this model
64
+ */
65
+ defaultParameters: DefaultParameters | null;
66
+ };
67
+ /** @internal */
68
+ export declare const Model$inboundSchema: z.ZodType<Model, unknown>;
69
+ /** @internal */
70
+ export type Model$Outbound = {
71
+ id: string;
72
+ canonical_slug: string;
73
+ hugging_face_id?: string | null | undefined;
74
+ name: string;
75
+ created: number;
76
+ description?: string | undefined;
77
+ pricing: PublicPricing$Outbound;
78
+ context_length: number | null;
79
+ architecture: ModelArchitecture$Outbound;
80
+ top_provider: TopProviderInfo$Outbound;
81
+ per_request_limits: PerRequestLimits$Outbound | null;
82
+ supported_parameters: Array<string>;
83
+ default_parameters: DefaultParameters$Outbound | null;
84
+ };
85
+ /** @internal */
86
+ export declare const Model$outboundSchema: z.ZodType<Model$Outbound, Model>;
87
+ /**
88
+ * @internal
89
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
90
+ */
91
+ export declare namespace Model$ {
92
+ /** @deprecated use `Model$inboundSchema` instead. */
93
+ const inboundSchema: z.ZodType<Model, unknown, z.core.$ZodTypeInternals<Model, unknown>>;
94
+ /** @deprecated use `Model$outboundSchema` instead. */
95
+ const outboundSchema: z.ZodType<Model$Outbound, Model, z.core.$ZodTypeInternals<Model$Outbound, Model>>;
96
+ /** @deprecated use `Model$Outbound` instead. */
97
+ type Outbound = Model$Outbound;
98
+ }
99
+ export declare function modelToJSON(model: Model): string;
100
+ export declare function modelFromJSON(jsonString: string): SafeParseResult<Model, SDKValidationError>;
101
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1,82 @@
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
+ import { DefaultParameters$inboundSchema, DefaultParameters$outboundSchema, } from "./defaultparameters.js";
8
+ import { ModelArchitecture$inboundSchema, ModelArchitecture$outboundSchema, } from "./modelarchitecture.js";
9
+ import { Parameter$inboundSchema, Parameter$outboundSchema, } from "./parameter.js";
10
+ import { PerRequestLimits$inboundSchema, PerRequestLimits$outboundSchema, } from "./perrequestlimits.js";
11
+ import { PublicPricing$inboundSchema, PublicPricing$outboundSchema, } from "./publicpricing.js";
12
+ import { TopProviderInfo$inboundSchema, TopProviderInfo$outboundSchema, } from "./topproviderinfo.js";
13
+ /** @internal */
14
+ export const Model$inboundSchema = z.object({
15
+ id: z.string(),
16
+ canonical_slug: z.string(),
17
+ hugging_face_id: z.nullable(z.string()).optional(),
18
+ name: z.string(),
19
+ created: z.number(),
20
+ description: z.string().optional(),
21
+ pricing: PublicPricing$inboundSchema,
22
+ context_length: z.nullable(z.number()),
23
+ architecture: ModelArchitecture$inboundSchema,
24
+ top_provider: TopProviderInfo$inboundSchema,
25
+ per_request_limits: z.nullable(PerRequestLimits$inboundSchema),
26
+ supported_parameters: z.array(Parameter$inboundSchema),
27
+ default_parameters: z.nullable(DefaultParameters$inboundSchema),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "canonical_slug": "canonicalSlug",
31
+ "hugging_face_id": "huggingFaceId",
32
+ "context_length": "contextLength",
33
+ "top_provider": "topProvider",
34
+ "per_request_limits": "perRequestLimits",
35
+ "supported_parameters": "supportedParameters",
36
+ "default_parameters": "defaultParameters",
37
+ });
38
+ });
39
+ /** @internal */
40
+ export const Model$outboundSchema = z.object({
41
+ id: z.string(),
42
+ canonicalSlug: z.string(),
43
+ huggingFaceId: z.nullable(z.string()).optional(),
44
+ name: z.string(),
45
+ created: z.number(),
46
+ description: z.string().optional(),
47
+ pricing: PublicPricing$outboundSchema,
48
+ contextLength: z.nullable(z.number()),
49
+ architecture: ModelArchitecture$outboundSchema,
50
+ topProvider: TopProviderInfo$outboundSchema,
51
+ perRequestLimits: z.nullable(PerRequestLimits$outboundSchema),
52
+ supportedParameters: z.array(Parameter$outboundSchema),
53
+ defaultParameters: z.nullable(DefaultParameters$outboundSchema),
54
+ }).transform((v) => {
55
+ return remap$(v, {
56
+ canonicalSlug: "canonical_slug",
57
+ huggingFaceId: "hugging_face_id",
58
+ contextLength: "context_length",
59
+ topProvider: "top_provider",
60
+ perRequestLimits: "per_request_limits",
61
+ supportedParameters: "supported_parameters",
62
+ defaultParameters: "default_parameters",
63
+ });
64
+ });
65
+ /**
66
+ * @internal
67
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
68
+ */
69
+ export var Model$;
70
+ (function (Model$) {
71
+ /** @deprecated use `Model$inboundSchema` instead. */
72
+ Model$.inboundSchema = Model$inboundSchema;
73
+ /** @deprecated use `Model$outboundSchema` instead. */
74
+ Model$.outboundSchema = Model$outboundSchema;
75
+ })(Model$ || (Model$ = {}));
76
+ export function modelToJSON(model) {
77
+ return JSON.stringify(Model$outboundSchema.parse(model));
78
+ }
79
+ export function modelFromJSON(jsonString) {
80
+ return safeParse(jsonString, (x) => Model$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Model' from JSON`);
81
+ }
82
+ //# sourceMappingURL=model.js.map