@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,59 @@
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 { ResponseFormatTextConfig, ResponseFormatTextConfig$Outbound } from "./responseformattextconfig.js";
6
+ export declare const OpenResponsesResponseTextVerbosity: {
7
+ readonly High: "high";
8
+ readonly Low: "low";
9
+ readonly Medium: "medium";
10
+ };
11
+ export type OpenResponsesResponseTextVerbosity = OpenEnum<typeof OpenResponsesResponseTextVerbosity>;
12
+ /**
13
+ * Text output configuration including format and verbosity
14
+ */
15
+ export type OpenResponsesResponseText = {
16
+ /**
17
+ * Text response format configuration
18
+ */
19
+ format?: ResponseFormatTextConfig | undefined;
20
+ verbosity?: OpenResponsesResponseTextVerbosity | null | undefined;
21
+ };
22
+ /** @internal */
23
+ export declare const OpenResponsesResponseTextVerbosity$inboundSchema: z.ZodType<OpenResponsesResponseTextVerbosity, unknown>;
24
+ /** @internal */
25
+ export declare const OpenResponsesResponseTextVerbosity$outboundSchema: z.ZodType<OpenResponsesResponseTextVerbosity, OpenResponsesResponseTextVerbosity>;
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 OpenResponsesResponseTextVerbosity$ {
31
+ /** @deprecated use `OpenResponsesResponseTextVerbosity$inboundSchema` instead. */
32
+ const inboundSchema: z.ZodType<OpenResponsesResponseTextVerbosity, unknown, z.core.$ZodTypeInternals<OpenResponsesResponseTextVerbosity, unknown>>;
33
+ /** @deprecated use `OpenResponsesResponseTextVerbosity$outboundSchema` instead. */
34
+ const outboundSchema: z.ZodType<OpenResponsesResponseTextVerbosity, OpenResponsesResponseTextVerbosity, z.core.$ZodTypeInternals<OpenResponsesResponseTextVerbosity, OpenResponsesResponseTextVerbosity>>;
35
+ }
36
+ /** @internal */
37
+ export declare const OpenResponsesResponseText$inboundSchema: z.ZodType<OpenResponsesResponseText, unknown>;
38
+ /** @internal */
39
+ export type OpenResponsesResponseText$Outbound = {
40
+ format?: ResponseFormatTextConfig$Outbound | undefined;
41
+ verbosity?: string | null | undefined;
42
+ };
43
+ /** @internal */
44
+ export declare const OpenResponsesResponseText$outboundSchema: z.ZodType<OpenResponsesResponseText$Outbound, OpenResponsesResponseText>;
45
+ /**
46
+ * @internal
47
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
48
+ */
49
+ export declare namespace OpenResponsesResponseText$ {
50
+ /** @deprecated use `OpenResponsesResponseText$inboundSchema` instead. */
51
+ const inboundSchema: z.ZodType<OpenResponsesResponseText, unknown, z.core.$ZodTypeInternals<OpenResponsesResponseText, unknown>>;
52
+ /** @deprecated use `OpenResponsesResponseText$outboundSchema` instead. */
53
+ const outboundSchema: z.ZodType<OpenResponsesResponseText$Outbound, OpenResponsesResponseText, z.core.$ZodTypeInternals<OpenResponsesResponseText$Outbound, OpenResponsesResponseText>>;
54
+ /** @deprecated use `OpenResponsesResponseText$Outbound` instead. */
55
+ type Outbound = OpenResponsesResponseText$Outbound;
56
+ }
57
+ export declare function openResponsesResponseTextToJSON(openResponsesResponseText: OpenResponsesResponseText): string;
58
+ export declare function openResponsesResponseTextFromJSON(jsonString: string): SafeParseResult<OpenResponsesResponseText, SDKValidationError>;
59
+ //# sourceMappingURL=openresponsesresponsetext.d.ts.map
@@ -0,0 +1,64 @@
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
+ import { catchUnrecognizedEnum, } from "../types/enums.js";
7
+ import { ResponseFormatTextConfig$inboundSchema, ResponseFormatTextConfig$outboundSchema, } from "./responseformattextconfig.js";
8
+ export const OpenResponsesResponseTextVerbosity = {
9
+ High: "high",
10
+ Low: "low",
11
+ Medium: "medium",
12
+ };
13
+ /** @internal */
14
+ export const OpenResponsesResponseTextVerbosity$inboundSchema = z
15
+ .union([
16
+ z.enum(OpenResponsesResponseTextVerbosity),
17
+ z.string().transform(catchUnrecognizedEnum),
18
+ ]);
19
+ /** @internal */
20
+ export const OpenResponsesResponseTextVerbosity$outboundSchema = z.union([
21
+ z.enum(OpenResponsesResponseTextVerbosity),
22
+ z.string().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 OpenResponsesResponseTextVerbosity$;
29
+ (function (OpenResponsesResponseTextVerbosity$) {
30
+ /** @deprecated use `OpenResponsesResponseTextVerbosity$inboundSchema` instead. */
31
+ OpenResponsesResponseTextVerbosity$.inboundSchema = OpenResponsesResponseTextVerbosity$inboundSchema;
32
+ /** @deprecated use `OpenResponsesResponseTextVerbosity$outboundSchema` instead. */
33
+ OpenResponsesResponseTextVerbosity$.outboundSchema = OpenResponsesResponseTextVerbosity$outboundSchema;
34
+ })(OpenResponsesResponseTextVerbosity$ || (OpenResponsesResponseTextVerbosity$ = {}));
35
+ /** @internal */
36
+ export const OpenResponsesResponseText$inboundSchema = z.object({
37
+ format: ResponseFormatTextConfig$inboundSchema.optional(),
38
+ verbosity: z.nullable(OpenResponsesResponseTextVerbosity$inboundSchema)
39
+ .optional(),
40
+ });
41
+ /** @internal */
42
+ export const OpenResponsesResponseText$outboundSchema = z.object({
43
+ format: ResponseFormatTextConfig$outboundSchema.optional(),
44
+ verbosity: z.nullable(OpenResponsesResponseTextVerbosity$outboundSchema)
45
+ .optional(),
46
+ });
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export var OpenResponsesResponseText$;
52
+ (function (OpenResponsesResponseText$) {
53
+ /** @deprecated use `OpenResponsesResponseText$inboundSchema` instead. */
54
+ OpenResponsesResponseText$.inboundSchema = OpenResponsesResponseText$inboundSchema;
55
+ /** @deprecated use `OpenResponsesResponseText$outboundSchema` instead. */
56
+ OpenResponsesResponseText$.outboundSchema = OpenResponsesResponseText$outboundSchema;
57
+ })(OpenResponsesResponseText$ || (OpenResponsesResponseText$ = {}));
58
+ export function openResponsesResponseTextToJSON(openResponsesResponseText) {
59
+ return JSON.stringify(OpenResponsesResponseText$outboundSchema.parse(openResponsesResponseText));
60
+ }
61
+ export function openResponsesResponseTextFromJSON(jsonString) {
62
+ return safeParse(jsonString, (x) => OpenResponsesResponseText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesResponseText' from JSON`);
63
+ }
64
+ //# sourceMappingURL=openresponsesresponsetext.js.map
@@ -0,0 +1,145 @@
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
+ /**
6
+ * The method used to generate the code challenge
7
+ */
8
+ export declare const CreateAuthKeysCodeCodeChallengeMethod: {
9
+ readonly S256: "S256";
10
+ readonly Plain: "plain";
11
+ };
12
+ /**
13
+ * The method used to generate the code challenge
14
+ */
15
+ export type CreateAuthKeysCodeCodeChallengeMethod = OpenEnum<typeof CreateAuthKeysCodeCodeChallengeMethod>;
16
+ export type CreateAuthKeysCodeRequest = {
17
+ /**
18
+ * The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.
19
+ */
20
+ callbackUrl: string;
21
+ /**
22
+ * PKCE code challenge for enhanced security
23
+ */
24
+ codeChallenge?: string | undefined;
25
+ /**
26
+ * The method used to generate the code challenge
27
+ */
28
+ codeChallengeMethod?: CreateAuthKeysCodeCodeChallengeMethod | undefined;
29
+ /**
30
+ * Credit limit for the API key to be created
31
+ */
32
+ limit?: number | undefined;
33
+ };
34
+ /**
35
+ * Auth code data
36
+ */
37
+ export type CreateAuthKeysCodeData = {
38
+ /**
39
+ * The authorization code ID to use in the exchange request
40
+ */
41
+ id: string;
42
+ /**
43
+ * The application ID associated with this auth code
44
+ */
45
+ appId: number;
46
+ /**
47
+ * ISO 8601 timestamp of when the auth code was created
48
+ */
49
+ createdAt: string;
50
+ };
51
+ /**
52
+ * Successfully created authorization code
53
+ */
54
+ export type CreateAuthKeysCodeResponse = {
55
+ /**
56
+ * Auth code data
57
+ */
58
+ data: CreateAuthKeysCodeData;
59
+ };
60
+ /** @internal */
61
+ export declare const CreateAuthKeysCodeCodeChallengeMethod$inboundSchema: z.ZodType<CreateAuthKeysCodeCodeChallengeMethod, unknown>;
62
+ /** @internal */
63
+ export declare const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema: z.ZodType<CreateAuthKeysCodeCodeChallengeMethod, CreateAuthKeysCodeCodeChallengeMethod>;
64
+ /**
65
+ * @internal
66
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
67
+ */
68
+ export declare namespace CreateAuthKeysCodeCodeChallengeMethod$ {
69
+ /** @deprecated use `CreateAuthKeysCodeCodeChallengeMethod$inboundSchema` instead. */
70
+ const inboundSchema: z.ZodType<CreateAuthKeysCodeCodeChallengeMethod, unknown, z.core.$ZodTypeInternals<CreateAuthKeysCodeCodeChallengeMethod, unknown>>;
71
+ /** @deprecated use `CreateAuthKeysCodeCodeChallengeMethod$outboundSchema` instead. */
72
+ const outboundSchema: z.ZodType<CreateAuthKeysCodeCodeChallengeMethod, CreateAuthKeysCodeCodeChallengeMethod, z.core.$ZodTypeInternals<CreateAuthKeysCodeCodeChallengeMethod, CreateAuthKeysCodeCodeChallengeMethod>>;
73
+ }
74
+ /** @internal */
75
+ export declare const CreateAuthKeysCodeRequest$inboundSchema: z.ZodType<CreateAuthKeysCodeRequest, unknown>;
76
+ /** @internal */
77
+ export type CreateAuthKeysCodeRequest$Outbound = {
78
+ callback_url: string;
79
+ code_challenge?: string | undefined;
80
+ code_challenge_method?: string | undefined;
81
+ limit?: number | undefined;
82
+ };
83
+ /** @internal */
84
+ export declare const CreateAuthKeysCodeRequest$outboundSchema: z.ZodType<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest>;
85
+ /**
86
+ * @internal
87
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
88
+ */
89
+ export declare namespace CreateAuthKeysCodeRequest$ {
90
+ /** @deprecated use `CreateAuthKeysCodeRequest$inboundSchema` instead. */
91
+ const inboundSchema: z.ZodType<CreateAuthKeysCodeRequest, unknown, z.core.$ZodTypeInternals<CreateAuthKeysCodeRequest, unknown>>;
92
+ /** @deprecated use `CreateAuthKeysCodeRequest$outboundSchema` instead. */
93
+ const outboundSchema: z.ZodType<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest, z.core.$ZodTypeInternals<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest>>;
94
+ /** @deprecated use `CreateAuthKeysCodeRequest$Outbound` instead. */
95
+ type Outbound = CreateAuthKeysCodeRequest$Outbound;
96
+ }
97
+ export declare function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest: CreateAuthKeysCodeRequest): string;
98
+ export declare function createAuthKeysCodeRequestFromJSON(jsonString: string): SafeParseResult<CreateAuthKeysCodeRequest, SDKValidationError>;
99
+ /** @internal */
100
+ export declare const CreateAuthKeysCodeData$inboundSchema: z.ZodType<CreateAuthKeysCodeData, unknown>;
101
+ /** @internal */
102
+ export type CreateAuthKeysCodeData$Outbound = {
103
+ id: string;
104
+ app_id: number;
105
+ created_at: string;
106
+ };
107
+ /** @internal */
108
+ export declare const CreateAuthKeysCodeData$outboundSchema: z.ZodType<CreateAuthKeysCodeData$Outbound, CreateAuthKeysCodeData>;
109
+ /**
110
+ * @internal
111
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
+ */
113
+ export declare namespace CreateAuthKeysCodeData$ {
114
+ /** @deprecated use `CreateAuthKeysCodeData$inboundSchema` instead. */
115
+ const inboundSchema: z.ZodType<CreateAuthKeysCodeData, unknown, z.core.$ZodTypeInternals<CreateAuthKeysCodeData, unknown>>;
116
+ /** @deprecated use `CreateAuthKeysCodeData$outboundSchema` instead. */
117
+ const outboundSchema: z.ZodType<CreateAuthKeysCodeData$Outbound, CreateAuthKeysCodeData, z.core.$ZodTypeInternals<CreateAuthKeysCodeData$Outbound, CreateAuthKeysCodeData>>;
118
+ /** @deprecated use `CreateAuthKeysCodeData$Outbound` instead. */
119
+ type Outbound = CreateAuthKeysCodeData$Outbound;
120
+ }
121
+ export declare function createAuthKeysCodeDataToJSON(createAuthKeysCodeData: CreateAuthKeysCodeData): string;
122
+ export declare function createAuthKeysCodeDataFromJSON(jsonString: string): SafeParseResult<CreateAuthKeysCodeData, SDKValidationError>;
123
+ /** @internal */
124
+ export declare const CreateAuthKeysCodeResponse$inboundSchema: z.ZodType<CreateAuthKeysCodeResponse, unknown>;
125
+ /** @internal */
126
+ export type CreateAuthKeysCodeResponse$Outbound = {
127
+ data: CreateAuthKeysCodeData$Outbound;
128
+ };
129
+ /** @internal */
130
+ export declare const CreateAuthKeysCodeResponse$outboundSchema: z.ZodType<CreateAuthKeysCodeResponse$Outbound, CreateAuthKeysCodeResponse>;
131
+ /**
132
+ * @internal
133
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
134
+ */
135
+ export declare namespace CreateAuthKeysCodeResponse$ {
136
+ /** @deprecated use `CreateAuthKeysCodeResponse$inboundSchema` instead. */
137
+ const inboundSchema: z.ZodType<CreateAuthKeysCodeResponse, unknown, z.core.$ZodTypeInternals<CreateAuthKeysCodeResponse, unknown>>;
138
+ /** @deprecated use `CreateAuthKeysCodeResponse$outboundSchema` instead. */
139
+ const outboundSchema: z.ZodType<CreateAuthKeysCodeResponse$Outbound, CreateAuthKeysCodeResponse, z.core.$ZodTypeInternals<CreateAuthKeysCodeResponse$Outbound, CreateAuthKeysCodeResponse>>;
140
+ /** @deprecated use `CreateAuthKeysCodeResponse$Outbound` instead. */
141
+ type Outbound = CreateAuthKeysCodeResponse$Outbound;
142
+ }
143
+ export declare function createAuthKeysCodeResponseToJSON(createAuthKeysCodeResponse: CreateAuthKeysCodeResponse): string;
144
+ export declare function createAuthKeysCodeResponseFromJSON(jsonString: string): SafeParseResult<CreateAuthKeysCodeResponse, SDKValidationError>;
145
+ //# sourceMappingURL=createauthkeyscode.d.ts.map
@@ -0,0 +1,146 @@
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
+ /**
9
+ * The method used to generate the code challenge
10
+ */
11
+ export const CreateAuthKeysCodeCodeChallengeMethod = {
12
+ S256: "S256",
13
+ Plain: "plain",
14
+ };
15
+ /** @internal */
16
+ export const CreateAuthKeysCodeCodeChallengeMethod$inboundSchema = z
17
+ .union([
18
+ z.enum(CreateAuthKeysCodeCodeChallengeMethod),
19
+ z.string().transform(catchUnrecognizedEnum),
20
+ ]);
21
+ /** @internal */
22
+ export const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema = z.union([
23
+ z.enum(CreateAuthKeysCodeCodeChallengeMethod),
24
+ z.string().and(z.custom()),
25
+ ]);
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 var CreateAuthKeysCodeCodeChallengeMethod$;
31
+ (function (CreateAuthKeysCodeCodeChallengeMethod$) {
32
+ /** @deprecated use `CreateAuthKeysCodeCodeChallengeMethod$inboundSchema` instead. */
33
+ CreateAuthKeysCodeCodeChallengeMethod$.inboundSchema = CreateAuthKeysCodeCodeChallengeMethod$inboundSchema;
34
+ /** @deprecated use `CreateAuthKeysCodeCodeChallengeMethod$outboundSchema` instead. */
35
+ CreateAuthKeysCodeCodeChallengeMethod$.outboundSchema = CreateAuthKeysCodeCodeChallengeMethod$outboundSchema;
36
+ })(CreateAuthKeysCodeCodeChallengeMethod$ || (CreateAuthKeysCodeCodeChallengeMethod$ = {}));
37
+ /** @internal */
38
+ export const CreateAuthKeysCodeRequest$inboundSchema = z.object({
39
+ callback_url: z.string(),
40
+ code_challenge: z.string().optional(),
41
+ code_challenge_method: CreateAuthKeysCodeCodeChallengeMethod$inboundSchema
42
+ .optional(),
43
+ limit: z.number().optional(),
44
+ }).transform((v) => {
45
+ return remap$(v, {
46
+ "callback_url": "callbackUrl",
47
+ "code_challenge": "codeChallenge",
48
+ "code_challenge_method": "codeChallengeMethod",
49
+ });
50
+ });
51
+ /** @internal */
52
+ export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
53
+ callbackUrl: z.string(),
54
+ codeChallenge: z.string().optional(),
55
+ codeChallengeMethod: CreateAuthKeysCodeCodeChallengeMethod$outboundSchema
56
+ .optional(),
57
+ limit: z.number().optional(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ callbackUrl: "callback_url",
61
+ codeChallenge: "code_challenge",
62
+ codeChallengeMethod: "code_challenge_method",
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 CreateAuthKeysCodeRequest$;
70
+ (function (CreateAuthKeysCodeRequest$) {
71
+ /** @deprecated use `CreateAuthKeysCodeRequest$inboundSchema` instead. */
72
+ CreateAuthKeysCodeRequest$.inboundSchema = CreateAuthKeysCodeRequest$inboundSchema;
73
+ /** @deprecated use `CreateAuthKeysCodeRequest$outboundSchema` instead. */
74
+ CreateAuthKeysCodeRequest$.outboundSchema = CreateAuthKeysCodeRequest$outboundSchema;
75
+ })(CreateAuthKeysCodeRequest$ || (CreateAuthKeysCodeRequest$ = {}));
76
+ export function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest) {
77
+ return JSON.stringify(CreateAuthKeysCodeRequest$outboundSchema.parse(createAuthKeysCodeRequest));
78
+ }
79
+ export function createAuthKeysCodeRequestFromJSON(jsonString) {
80
+ return safeParse(jsonString, (x) => CreateAuthKeysCodeRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthKeysCodeRequest' from JSON`);
81
+ }
82
+ /** @internal */
83
+ export const CreateAuthKeysCodeData$inboundSchema = z.object({
84
+ id: z.string(),
85
+ app_id: z.number(),
86
+ created_at: z.string(),
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ "app_id": "appId",
90
+ "created_at": "createdAt",
91
+ });
92
+ });
93
+ /** @internal */
94
+ export const CreateAuthKeysCodeData$outboundSchema = z.object({
95
+ id: z.string(),
96
+ appId: z.number(),
97
+ createdAt: z.string(),
98
+ }).transform((v) => {
99
+ return remap$(v, {
100
+ appId: "app_id",
101
+ createdAt: "created_at",
102
+ });
103
+ });
104
+ /**
105
+ * @internal
106
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
107
+ */
108
+ export var CreateAuthKeysCodeData$;
109
+ (function (CreateAuthKeysCodeData$) {
110
+ /** @deprecated use `CreateAuthKeysCodeData$inboundSchema` instead. */
111
+ CreateAuthKeysCodeData$.inboundSchema = CreateAuthKeysCodeData$inboundSchema;
112
+ /** @deprecated use `CreateAuthKeysCodeData$outboundSchema` instead. */
113
+ CreateAuthKeysCodeData$.outboundSchema = CreateAuthKeysCodeData$outboundSchema;
114
+ })(CreateAuthKeysCodeData$ || (CreateAuthKeysCodeData$ = {}));
115
+ export function createAuthKeysCodeDataToJSON(createAuthKeysCodeData) {
116
+ return JSON.stringify(CreateAuthKeysCodeData$outboundSchema.parse(createAuthKeysCodeData));
117
+ }
118
+ export function createAuthKeysCodeDataFromJSON(jsonString) {
119
+ return safeParse(jsonString, (x) => CreateAuthKeysCodeData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthKeysCodeData' from JSON`);
120
+ }
121
+ /** @internal */
122
+ export const CreateAuthKeysCodeResponse$inboundSchema = z.object({
123
+ data: z.lazy(() => CreateAuthKeysCodeData$inboundSchema),
124
+ });
125
+ /** @internal */
126
+ export const CreateAuthKeysCodeResponse$outboundSchema = z.object({
127
+ data: z.lazy(() => CreateAuthKeysCodeData$outboundSchema),
128
+ });
129
+ /**
130
+ * @internal
131
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
132
+ */
133
+ export var CreateAuthKeysCodeResponse$;
134
+ (function (CreateAuthKeysCodeResponse$) {
135
+ /** @deprecated use `CreateAuthKeysCodeResponse$inboundSchema` instead. */
136
+ CreateAuthKeysCodeResponse$.inboundSchema = CreateAuthKeysCodeResponse$inboundSchema;
137
+ /** @deprecated use `CreateAuthKeysCodeResponse$outboundSchema` instead. */
138
+ CreateAuthKeysCodeResponse$.outboundSchema = CreateAuthKeysCodeResponse$outboundSchema;
139
+ })(CreateAuthKeysCodeResponse$ || (CreateAuthKeysCodeResponse$ = {}));
140
+ export function createAuthKeysCodeResponseToJSON(createAuthKeysCodeResponse) {
141
+ return JSON.stringify(CreateAuthKeysCodeResponse$outboundSchema.parse(createAuthKeysCodeResponse));
142
+ }
143
+ export function createAuthKeysCodeResponseFromJSON(jsonString) {
144
+ return safeParse(jsonString, (x) => CreateAuthKeysCodeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthKeysCodeResponse' from JSON`);
145
+ }
146
+ //# sourceMappingURL=createauthkeyscode.js.map
@@ -0,0 +1,58 @@
1
+ import * as z from "zod/v4";
2
+ import { EventStream } from "../../lib/event-streams.js";
3
+ import { Result as SafeParseResult } from "../../types/fp.js";
4
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ import * as models from "../index.js";
6
+ /**
7
+ * Successful response
8
+ */
9
+ export type CreateResponsesResponseBody = {
10
+ /**
11
+ * Union of all possible event types emitted during response streaming
12
+ */
13
+ data: models.OpenResponsesStreamEvent;
14
+ };
15
+ export type CreateResponsesResponse = models.OpenResponsesNonStreamingResponse | EventStream<models.OpenResponsesStreamEvent>;
16
+ /** @internal */
17
+ export declare const CreateResponsesResponseBody$inboundSchema: z.ZodType<CreateResponsesResponseBody, unknown>;
18
+ /** @internal */
19
+ export type CreateResponsesResponseBody$Outbound = {
20
+ data: models.OpenResponsesStreamEvent$Outbound;
21
+ };
22
+ /** @internal */
23
+ export declare const CreateResponsesResponseBody$outboundSchema: z.ZodType<CreateResponsesResponseBody$Outbound, CreateResponsesResponseBody>;
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 declare namespace CreateResponsesResponseBody$ {
29
+ /** @deprecated use `CreateResponsesResponseBody$inboundSchema` instead. */
30
+ const inboundSchema: z.ZodType<CreateResponsesResponseBody, unknown, z.core.$ZodTypeInternals<CreateResponsesResponseBody, unknown>>;
31
+ /** @deprecated use `CreateResponsesResponseBody$outboundSchema` instead. */
32
+ const outboundSchema: z.ZodType<CreateResponsesResponseBody$Outbound, CreateResponsesResponseBody, z.core.$ZodTypeInternals<CreateResponsesResponseBody$Outbound, CreateResponsesResponseBody>>;
33
+ /** @deprecated use `CreateResponsesResponseBody$Outbound` instead. */
34
+ type Outbound = CreateResponsesResponseBody$Outbound;
35
+ }
36
+ export declare function createResponsesResponseBodyToJSON(createResponsesResponseBody: CreateResponsesResponseBody): string;
37
+ export declare function createResponsesResponseBodyFromJSON(jsonString: string): SafeParseResult<CreateResponsesResponseBody, SDKValidationError>;
38
+ /** @internal */
39
+ export declare const CreateResponsesResponse$inboundSchema: z.ZodType<CreateResponsesResponse, unknown>;
40
+ /** @internal */
41
+ export type CreateResponsesResponse$Outbound = models.OpenResponsesNonStreamingResponse$Outbound | never;
42
+ /** @internal */
43
+ export declare const CreateResponsesResponse$outboundSchema: z.ZodType<CreateResponsesResponse$Outbound, CreateResponsesResponse>;
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 declare namespace CreateResponsesResponse$ {
49
+ /** @deprecated use `CreateResponsesResponse$inboundSchema` instead. */
50
+ const inboundSchema: z.ZodType<CreateResponsesResponse, unknown, z.core.$ZodTypeInternals<CreateResponsesResponse, unknown>>;
51
+ /** @deprecated use `CreateResponsesResponse$outboundSchema` instead. */
52
+ const outboundSchema: z.ZodType<models.OpenResponsesNonStreamingResponse$Outbound, CreateResponsesResponse, z.core.$ZodTypeInternals<models.OpenResponsesNonStreamingResponse$Outbound, CreateResponsesResponse>>;
53
+ /** @deprecated use `CreateResponsesResponse$Outbound` instead. */
54
+ type Outbound = CreateResponsesResponse$Outbound;
55
+ }
56
+ export declare function createResponsesResponseToJSON(createResponsesResponse: CreateResponsesResponse): string;
57
+ export declare function createResponsesResponseFromJSON(jsonString: string): SafeParseResult<CreateResponsesResponse, SDKValidationError>;
58
+ //# sourceMappingURL=createresponses.d.ts.map
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { EventStream } from "../../lib/event-streams.js";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import * as models from "../index.js";
8
+ /** @internal */
9
+ export const CreateResponsesResponseBody$inboundSchema = z.object({
10
+ data: z.string().transform((v, ctx) => {
11
+ try {
12
+ return JSON.parse(v);
13
+ }
14
+ catch (err) {
15
+ ctx.addIssue({
16
+ code: z.ZodIssueCode.custom,
17
+ message: `malformed json: ${err}`,
18
+ });
19
+ return z.NEVER;
20
+ }
21
+ }).pipe(models.OpenResponsesStreamEvent$inboundSchema),
22
+ });
23
+ /** @internal */
24
+ export const CreateResponsesResponseBody$outboundSchema = z.object({
25
+ data: models.OpenResponsesStreamEvent$outboundSchema,
26
+ });
27
+ /**
28
+ * @internal
29
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
30
+ */
31
+ export var CreateResponsesResponseBody$;
32
+ (function (CreateResponsesResponseBody$) {
33
+ /** @deprecated use `CreateResponsesResponseBody$inboundSchema` instead. */
34
+ CreateResponsesResponseBody$.inboundSchema = CreateResponsesResponseBody$inboundSchema;
35
+ /** @deprecated use `CreateResponsesResponseBody$outboundSchema` instead. */
36
+ CreateResponsesResponseBody$.outboundSchema = CreateResponsesResponseBody$outboundSchema;
37
+ })(CreateResponsesResponseBody$ || (CreateResponsesResponseBody$ = {}));
38
+ export function createResponsesResponseBodyToJSON(createResponsesResponseBody) {
39
+ return JSON.stringify(CreateResponsesResponseBody$outboundSchema.parse(createResponsesResponseBody));
40
+ }
41
+ export function createResponsesResponseBodyFromJSON(jsonString) {
42
+ return safeParse(jsonString, (x) => CreateResponsesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateResponsesResponseBody' from JSON`);
43
+ }
44
+ /** @internal */
45
+ export const CreateResponsesResponse$inboundSchema = z.union([
46
+ models.OpenResponsesNonStreamingResponse$inboundSchema,
47
+ z.custom(x => x instanceof ReadableStream)
48
+ .transform(stream => {
49
+ return new EventStream(stream, rawEvent => {
50
+ if (rawEvent.data === "[DONE]")
51
+ return { done: true };
52
+ return {
53
+ value: z.lazy(() => CreateResponsesResponseBody$inboundSchema).parse(rawEvent)?.data,
54
+ };
55
+ });
56
+ }),
57
+ ]);
58
+ /** @internal */
59
+ export const CreateResponsesResponse$outboundSchema = z.union([
60
+ models.OpenResponsesNonStreamingResponse$outboundSchema,
61
+ z.never(),
62
+ ]);
63
+ /**
64
+ * @internal
65
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
66
+ */
67
+ export var CreateResponsesResponse$;
68
+ (function (CreateResponsesResponse$) {
69
+ /** @deprecated use `CreateResponsesResponse$inboundSchema` instead. */
70
+ CreateResponsesResponse$.inboundSchema = CreateResponsesResponse$inboundSchema;
71
+ /** @deprecated use `CreateResponsesResponse$outboundSchema` instead. */
72
+ CreateResponsesResponse$.outboundSchema = CreateResponsesResponse$outboundSchema;
73
+ })(CreateResponsesResponse$ || (CreateResponsesResponse$ = {}));
74
+ export function createResponsesResponseToJSON(createResponsesResponse) {
75
+ return JSON.stringify(CreateResponsesResponse$outboundSchema.parse(createResponsesResponse));
76
+ }
77
+ export function createResponsesResponseFromJSON(jsonString) {
78
+ return safeParse(jsonString, (x) => CreateResponsesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateResponsesResponse' from JSON`);
79
+ }
80
+ //# sourceMappingURL=createresponses.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
+ /**
6
+ * The method used to generate the code challenge
7
+ */
8
+ export declare const ExchangeAuthCodeForAPIKeyCodeChallengeMethod: {
9
+ readonly S256: "S256";
10
+ readonly Plain: "plain";
11
+ };
12
+ /**
13
+ * The method used to generate the code challenge
14
+ */
15
+ export type ExchangeAuthCodeForAPIKeyCodeChallengeMethod = OpenEnum<typeof ExchangeAuthCodeForAPIKeyCodeChallengeMethod>;
16
+ export type ExchangeAuthCodeForAPIKeyRequest = {
17
+ /**
18
+ * The authorization code received from the OAuth redirect
19
+ */
20
+ code: string;
21
+ /**
22
+ * The code verifier if code_challenge was used in the authorization request
23
+ */
24
+ codeVerifier?: string | undefined;
25
+ /**
26
+ * The method used to generate the code challenge
27
+ */
28
+ codeChallengeMethod?: ExchangeAuthCodeForAPIKeyCodeChallengeMethod | null | undefined;
29
+ };
30
+ /**
31
+ * Successfully exchanged code for an API key
32
+ */
33
+ export type ExchangeAuthCodeForAPIKeyResponse = {
34
+ /**
35
+ * The API key to use for OpenRouter requests
36
+ */
37
+ key: string;
38
+ /**
39
+ * User ID associated with the API key
40
+ */
41
+ userId: string | null;
42
+ };
43
+ /** @internal */
44
+ export declare const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, unknown>;
45
+ /** @internal */
46
+ export declare const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, ExchangeAuthCodeForAPIKeyCodeChallengeMethod>;
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export declare namespace ExchangeAuthCodeForAPIKeyCodeChallengeMethod$ {
52
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyCodeChallengeMethod$inboundSchema` instead. */
53
+ const inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, unknown, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, unknown>>;
54
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema` instead. */
55
+ const outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, ExchangeAuthCodeForAPIKeyCodeChallengeMethod, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, ExchangeAuthCodeForAPIKeyCodeChallengeMethod>>;
56
+ }
57
+ /** @internal */
58
+ export declare const ExchangeAuthCodeForAPIKeyRequest$inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyRequest, unknown>;
59
+ /** @internal */
60
+ export type ExchangeAuthCodeForAPIKeyRequest$Outbound = {
61
+ code: string;
62
+ code_verifier?: string | undefined;
63
+ code_challenge_method?: string | null | undefined;
64
+ };
65
+ /** @internal */
66
+ export declare const ExchangeAuthCodeForAPIKeyRequest$outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyRequest$Outbound, ExchangeAuthCodeForAPIKeyRequest>;
67
+ /**
68
+ * @internal
69
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
70
+ */
71
+ export declare namespace ExchangeAuthCodeForAPIKeyRequest$ {
72
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyRequest$inboundSchema` instead. */
73
+ const inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyRequest, unknown, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyRequest, unknown>>;
74
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyRequest$outboundSchema` instead. */
75
+ const outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyRequest$Outbound, ExchangeAuthCodeForAPIKeyRequest, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyRequest$Outbound, ExchangeAuthCodeForAPIKeyRequest>>;
76
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyRequest$Outbound` instead. */
77
+ type Outbound = ExchangeAuthCodeForAPIKeyRequest$Outbound;
78
+ }
79
+ export declare function exchangeAuthCodeForAPIKeyRequestToJSON(exchangeAuthCodeForAPIKeyRequest: ExchangeAuthCodeForAPIKeyRequest): string;
80
+ export declare function exchangeAuthCodeForAPIKeyRequestFromJSON(jsonString: string): SafeParseResult<ExchangeAuthCodeForAPIKeyRequest, SDKValidationError>;
81
+ /** @internal */
82
+ export declare const ExchangeAuthCodeForAPIKeyResponse$inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyResponse, unknown>;
83
+ /** @internal */
84
+ export type ExchangeAuthCodeForAPIKeyResponse$Outbound = {
85
+ key: string;
86
+ user_id: string | null;
87
+ };
88
+ /** @internal */
89
+ export declare const ExchangeAuthCodeForAPIKeyResponse$outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyResponse$Outbound, ExchangeAuthCodeForAPIKeyResponse>;
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 ExchangeAuthCodeForAPIKeyResponse$ {
95
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyResponse$inboundSchema` instead. */
96
+ const inboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyResponse, unknown, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyResponse, unknown>>;
97
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyResponse$outboundSchema` instead. */
98
+ const outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyResponse$Outbound, ExchangeAuthCodeForAPIKeyResponse, z.core.$ZodTypeInternals<ExchangeAuthCodeForAPIKeyResponse$Outbound, ExchangeAuthCodeForAPIKeyResponse>>;
99
+ /** @deprecated use `ExchangeAuthCodeForAPIKeyResponse$Outbound` instead. */
100
+ type Outbound = ExchangeAuthCodeForAPIKeyResponse$Outbound;
101
+ }
102
+ export declare function exchangeAuthCodeForAPIKeyResponseToJSON(exchangeAuthCodeForAPIKeyResponse: ExchangeAuthCodeForAPIKeyResponse): string;
103
+ export declare function exchangeAuthCodeForAPIKeyResponseFromJSON(jsonString: string): SafeParseResult<ExchangeAuthCodeForAPIKeyResponse, SDKValidationError>;
104
+ //# sourceMappingURL=exchangeauthcodeforapikey.d.ts.map