@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
@@ -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
@@ -0,0 +1,104 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { InputModality } from "./inputmodality.js";
6
+ import { ModelGroup } from "./modelgroup.js";
7
+ import { OutputModality } from "./outputmodality.js";
8
+ /**
9
+ * Instruction format type
10
+ */
11
+ export declare const ModelArchitectureInstructType: {
12
+ readonly None: "none";
13
+ readonly Airoboros: "airoboros";
14
+ readonly Alpaca: "alpaca";
15
+ readonly AlpacaModif: "alpaca-modif";
16
+ readonly Chatml: "chatml";
17
+ readonly Claude: "claude";
18
+ readonly CodeLlama: "code-llama";
19
+ readonly Gemma: "gemma";
20
+ readonly Llama2: "llama2";
21
+ readonly Llama3: "llama3";
22
+ readonly Mistral: "mistral";
23
+ readonly Nemotron: "nemotron";
24
+ readonly Neural: "neural";
25
+ readonly Openchat: "openchat";
26
+ readonly Phi3: "phi3";
27
+ readonly Rwkv: "rwkv";
28
+ readonly Vicuna: "vicuna";
29
+ readonly Zephyr: "zephyr";
30
+ readonly DeepseekR1: "deepseek-r1";
31
+ readonly DeepseekV31: "deepseek-v3.1";
32
+ readonly Qwq: "qwq";
33
+ readonly Qwen3: "qwen3";
34
+ };
35
+ /**
36
+ * Instruction format type
37
+ */
38
+ export type ModelArchitectureInstructType = OpenEnum<typeof ModelArchitectureInstructType>;
39
+ /**
40
+ * Model architecture information
41
+ */
42
+ export type ModelArchitecture = {
43
+ /**
44
+ * Tokenizer type used by the model
45
+ */
46
+ tokenizer?: ModelGroup | undefined;
47
+ /**
48
+ * Instruction format type
49
+ */
50
+ instructType?: ModelArchitectureInstructType | null | undefined;
51
+ /**
52
+ * Primary modality of the model
53
+ */
54
+ modality: string | null;
55
+ /**
56
+ * Supported input modalities
57
+ */
58
+ inputModalities: Array<InputModality>;
59
+ /**
60
+ * Supported output modalities
61
+ */
62
+ outputModalities: Array<OutputModality>;
63
+ };
64
+ /** @internal */
65
+ export declare const ModelArchitectureInstructType$inboundSchema: z.ZodType<ModelArchitectureInstructType, unknown>;
66
+ /** @internal */
67
+ export declare const ModelArchitectureInstructType$outboundSchema: z.ZodType<ModelArchitectureInstructType, ModelArchitectureInstructType>;
68
+ /**
69
+ * @internal
70
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
71
+ */
72
+ export declare namespace ModelArchitectureInstructType$ {
73
+ /** @deprecated use `ModelArchitectureInstructType$inboundSchema` instead. */
74
+ const inboundSchema: z.ZodType<ModelArchitectureInstructType, unknown, z.core.$ZodTypeInternals<ModelArchitectureInstructType, unknown>>;
75
+ /** @deprecated use `ModelArchitectureInstructType$outboundSchema` instead. */
76
+ const outboundSchema: z.ZodType<ModelArchitectureInstructType, ModelArchitectureInstructType, z.core.$ZodTypeInternals<ModelArchitectureInstructType, ModelArchitectureInstructType>>;
77
+ }
78
+ /** @internal */
79
+ export declare const ModelArchitecture$inboundSchema: z.ZodType<ModelArchitecture, unknown>;
80
+ /** @internal */
81
+ export type ModelArchitecture$Outbound = {
82
+ tokenizer?: string | undefined;
83
+ instruct_type?: string | null | undefined;
84
+ modality: string | null;
85
+ input_modalities: Array<string>;
86
+ output_modalities: Array<string>;
87
+ };
88
+ /** @internal */
89
+ export declare const ModelArchitecture$outboundSchema: z.ZodType<ModelArchitecture$Outbound, ModelArchitecture>;
90
+ /**
91
+ * @internal
92
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
93
+ */
94
+ export declare namespace ModelArchitecture$ {
95
+ /** @deprecated use `ModelArchitecture$inboundSchema` instead. */
96
+ const inboundSchema: z.ZodType<ModelArchitecture, unknown, z.core.$ZodTypeInternals<ModelArchitecture, unknown>>;
97
+ /** @deprecated use `ModelArchitecture$outboundSchema` instead. */
98
+ const outboundSchema: z.ZodType<ModelArchitecture$Outbound, ModelArchitecture, z.core.$ZodTypeInternals<ModelArchitecture$Outbound, ModelArchitecture>>;
99
+ /** @deprecated use `ModelArchitecture$Outbound` instead. */
100
+ type Outbound = ModelArchitecture$Outbound;
101
+ }
102
+ export declare function modelArchitectureToJSON(modelArchitecture: ModelArchitecture): string;
103
+ export declare function modelArchitectureFromJSON(jsonString: string): SafeParseResult<ModelArchitecture, SDKValidationError>;
104
+ //# sourceMappingURL=modelarchitecture.d.ts.map
@@ -0,0 +1,107 @@
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 { catchUnrecognizedEnum, } from "../types/enums.js";
8
+ import { InputModality$inboundSchema, InputModality$outboundSchema, } from "./inputmodality.js";
9
+ import { ModelGroup$inboundSchema, ModelGroup$outboundSchema, } from "./modelgroup.js";
10
+ import { OutputModality$inboundSchema, OutputModality$outboundSchema, } from "./outputmodality.js";
11
+ /**
12
+ * Instruction format type
13
+ */
14
+ export const ModelArchitectureInstructType = {
15
+ None: "none",
16
+ Airoboros: "airoboros",
17
+ Alpaca: "alpaca",
18
+ AlpacaModif: "alpaca-modif",
19
+ Chatml: "chatml",
20
+ Claude: "claude",
21
+ CodeLlama: "code-llama",
22
+ Gemma: "gemma",
23
+ Llama2: "llama2",
24
+ Llama3: "llama3",
25
+ Mistral: "mistral",
26
+ Nemotron: "nemotron",
27
+ Neural: "neural",
28
+ Openchat: "openchat",
29
+ Phi3: "phi3",
30
+ Rwkv: "rwkv",
31
+ Vicuna: "vicuna",
32
+ Zephyr: "zephyr",
33
+ DeepseekR1: "deepseek-r1",
34
+ DeepseekV31: "deepseek-v3.1",
35
+ Qwq: "qwq",
36
+ Qwen3: "qwen3",
37
+ };
38
+ /** @internal */
39
+ export const ModelArchitectureInstructType$inboundSchema = z
40
+ .union([
41
+ z.enum(ModelArchitectureInstructType),
42
+ z.string().transform(catchUnrecognizedEnum),
43
+ ]);
44
+ /** @internal */
45
+ export const ModelArchitectureInstructType$outboundSchema = z.union([
46
+ z.enum(ModelArchitectureInstructType),
47
+ z.string().and(z.custom()),
48
+ ]);
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export var ModelArchitectureInstructType$;
54
+ (function (ModelArchitectureInstructType$) {
55
+ /** @deprecated use `ModelArchitectureInstructType$inboundSchema` instead. */
56
+ ModelArchitectureInstructType$.inboundSchema = ModelArchitectureInstructType$inboundSchema;
57
+ /** @deprecated use `ModelArchitectureInstructType$outboundSchema` instead. */
58
+ ModelArchitectureInstructType$.outboundSchema = ModelArchitectureInstructType$outboundSchema;
59
+ })(ModelArchitectureInstructType$ || (ModelArchitectureInstructType$ = {}));
60
+ /** @internal */
61
+ export const ModelArchitecture$inboundSchema = z.object({
62
+ tokenizer: ModelGroup$inboundSchema.optional(),
63
+ instruct_type: z.nullable(ModelArchitectureInstructType$inboundSchema)
64
+ .optional(),
65
+ modality: z.nullable(z.string()),
66
+ input_modalities: z.array(InputModality$inboundSchema),
67
+ output_modalities: z.array(OutputModality$inboundSchema),
68
+ }).transform((v) => {
69
+ return remap$(v, {
70
+ "instruct_type": "instructType",
71
+ "input_modalities": "inputModalities",
72
+ "output_modalities": "outputModalities",
73
+ });
74
+ });
75
+ /** @internal */
76
+ export const ModelArchitecture$outboundSchema = z.object({
77
+ tokenizer: ModelGroup$outboundSchema.optional(),
78
+ instructType: z.nullable(ModelArchitectureInstructType$outboundSchema)
79
+ .optional(),
80
+ modality: z.nullable(z.string()),
81
+ inputModalities: z.array(InputModality$outboundSchema),
82
+ outputModalities: z.array(OutputModality$outboundSchema),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ instructType: "instruct_type",
86
+ inputModalities: "input_modalities",
87
+ outputModalities: "output_modalities",
88
+ });
89
+ });
90
+ /**
91
+ * @internal
92
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
93
+ */
94
+ export var ModelArchitecture$;
95
+ (function (ModelArchitecture$) {
96
+ /** @deprecated use `ModelArchitecture$inboundSchema` instead. */
97
+ ModelArchitecture$.inboundSchema = ModelArchitecture$inboundSchema;
98
+ /** @deprecated use `ModelArchitecture$outboundSchema` instead. */
99
+ ModelArchitecture$.outboundSchema = ModelArchitecture$outboundSchema;
100
+ })(ModelArchitecture$ || (ModelArchitecture$ = {}));
101
+ export function modelArchitectureToJSON(modelArchitecture) {
102
+ return JSON.stringify(ModelArchitecture$outboundSchema.parse(modelArchitecture));
103
+ }
104
+ export function modelArchitectureFromJSON(jsonString) {
105
+ return safeParse(jsonString, (x) => ModelArchitecture$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ModelArchitecture' from JSON`);
106
+ }
107
+ //# sourceMappingURL=modelarchitecture.js.map