@openrouter/sdk 0.5.1 → 0.8.0

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 (192) hide show
  1. package/FUNCTIONS.md +5 -1
  2. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  3. package/esm/funcs/analyticsGetUserActivity.js +4 -2
  4. package/esm/funcs/apiKeysCreate.d.ts +1 -1
  5. package/esm/funcs/apiKeysCreate.js +5 -3
  6. package/esm/funcs/apiKeysDelete.d.ts +1 -1
  7. package/esm/funcs/apiKeysDelete.js +3 -1
  8. package/esm/funcs/apiKeysGet.d.ts +1 -1
  9. package/esm/funcs/apiKeysGet.js +3 -1
  10. package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
  11. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +14 -3
  12. package/esm/funcs/apiKeysList.d.ts +1 -1
  13. package/esm/funcs/apiKeysList.js +4 -2
  14. package/esm/funcs/apiKeysUpdate.d.ts +1 -1
  15. package/esm/funcs/apiKeysUpdate.js +3 -1
  16. package/esm/funcs/betaResponsesSend.d.ts +9 -5
  17. package/esm/funcs/betaResponsesSend.js +10 -5
  18. package/esm/funcs/chatSend.d.ts +9 -5
  19. package/esm/funcs/chatSend.js +10 -5
  20. package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -2
  21. package/esm/funcs/creditsCreateCoinbaseCharge.js +7 -4
  22. package/esm/funcs/creditsGetCredits.d.ts +2 -2
  23. package/esm/funcs/creditsGetCredits.js +15 -4
  24. package/esm/funcs/embeddingsGenerate.js +4 -2
  25. package/esm/funcs/embeddingsListModels.d.ts +2 -1
  26. package/esm/funcs/embeddingsListModels.js +15 -3
  27. package/esm/funcs/endpointsList.js +2 -0
  28. package/esm/funcs/endpointsListZdrEndpoints.d.ts +1 -1
  29. package/esm/funcs/endpointsListZdrEndpoints.js +14 -3
  30. package/esm/funcs/generationsGetGeneration.js +3 -1
  31. package/esm/funcs/guardrailsBulkAssignKeys.d.ts +1 -1
  32. package/esm/funcs/guardrailsBulkAssignKeys.js +3 -1
  33. package/esm/funcs/guardrailsBulkAssignMembers.d.ts +1 -1
  34. package/esm/funcs/guardrailsBulkAssignMembers.js +3 -1
  35. package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +1 -1
  36. package/esm/funcs/guardrailsBulkUnassignKeys.js +3 -1
  37. package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +1 -1
  38. package/esm/funcs/guardrailsBulkUnassignMembers.js +3 -1
  39. package/esm/funcs/guardrailsCreate.d.ts +1 -1
  40. package/esm/funcs/guardrailsCreate.js +5 -3
  41. package/esm/funcs/guardrailsDelete.d.ts +1 -1
  42. package/esm/funcs/guardrailsDelete.js +3 -1
  43. package/esm/funcs/guardrailsGet.d.ts +1 -1
  44. package/esm/funcs/guardrailsGet.js +3 -1
  45. package/esm/funcs/guardrailsList.d.ts +1 -1
  46. package/esm/funcs/guardrailsList.js +4 -2
  47. package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +1 -1
  48. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +3 -1
  49. package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +1 -1
  50. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +3 -1
  51. package/esm/funcs/guardrailsListKeyAssignments.d.ts +1 -1
  52. package/esm/funcs/guardrailsListKeyAssignments.js +4 -2
  53. package/esm/funcs/guardrailsListMemberAssignments.d.ts +1 -1
  54. package/esm/funcs/guardrailsListMemberAssignments.js +4 -2
  55. package/esm/funcs/guardrailsUpdate.d.ts +1 -1
  56. package/esm/funcs/guardrailsUpdate.js +3 -1
  57. package/esm/funcs/modelsCount.d.ts +2 -1
  58. package/esm/funcs/modelsCount.js +15 -3
  59. package/esm/funcs/modelsList.js +3 -1
  60. package/esm/funcs/modelsListForUser.d.ts +1 -1
  61. package/esm/funcs/modelsListForUser.js +15 -3
  62. package/esm/funcs/oAuthCreateAuthCode.js +4 -2
  63. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +4 -2
  64. package/esm/funcs/providersList.d.ts +1 -1
  65. package/esm/funcs/providersList.js +14 -3
  66. package/esm/lib/config.d.ts +2 -2
  67. package/esm/lib/config.js +2 -2
  68. package/esm/lib/model-result.d.ts +3 -5
  69. package/esm/lib/model-result.js +98 -46
  70. package/esm/models/assistantmessage.d.ts +3 -3
  71. package/esm/models/assistantmessage.js +3 -3
  72. package/esm/models/chatgenerationparams.d.ts +43 -234
  73. package/esm/models/chatgenerationparams.js +32 -159
  74. package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
  75. package/esm/models/chatstreamingmessagechunk.js +2 -2
  76. package/esm/models/developermessage.d.ts +23 -0
  77. package/esm/models/developermessage.js +24 -0
  78. package/esm/models/index.d.ts +6 -2
  79. package/esm/models/index.js +6 -2
  80. package/esm/models/message.d.ts +3 -23
  81. package/esm/models/message.js +2 -19
  82. package/esm/models/openresponsesrequest.d.ts +33 -45
  83. package/esm/models/openresponsesrequest.js +36 -36
  84. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +30 -0
  85. package/esm/models/operations/bulkassignkeystoguardrail.js +4 -0
  86. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +30 -0
  87. package/esm/models/operations/bulkassignmemberstoguardrail.js +4 -0
  88. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +30 -0
  89. package/esm/models/operations/bulkunassignkeysfromguardrail.js +4 -0
  90. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +30 -0
  91. package/esm/models/operations/bulkunassignmembersfromguardrail.js +4 -0
  92. package/esm/models/operations/createauthkeyscode.d.ts +42 -2
  93. package/esm/models/operations/createauthkeyscode.js +16 -1
  94. package/esm/models/operations/createcoinbasecharge.d.ts +41 -0
  95. package/esm/models/operations/createcoinbasecharge.js +16 -0
  96. package/esm/models/operations/createembeddings.d.ts +42 -2
  97. package/esm/models/operations/createembeddings.js +16 -1
  98. package/esm/models/operations/createguardrail.d.ts +42 -2
  99. package/esm/models/operations/createguardrail.js +16 -1
  100. package/esm/models/operations/createkeys.d.ts +42 -2
  101. package/esm/models/operations/createkeys.js +16 -1
  102. package/esm/models/operations/createresponses.d.ts +40 -0
  103. package/esm/models/operations/createresponses.js +16 -0
  104. package/esm/models/operations/deleteguardrail.d.ts +30 -0
  105. package/esm/models/operations/deleteguardrail.js +8 -0
  106. package/esm/models/operations/deletekeys.d.ts +30 -0
  107. package/esm/models/operations/deletekeys.js +8 -0
  108. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +42 -2
  109. package/esm/models/operations/exchangeauthcodeforapikey.js +16 -1
  110. package/esm/models/operations/getcredits.d.ts +38 -0
  111. package/esm/models/operations/getcredits.js +13 -0
  112. package/esm/models/operations/getcurrentkey.d.ts +45 -1
  113. package/esm/models/operations/getcurrentkey.js +15 -0
  114. package/esm/models/operations/getgeneration.d.ts +151 -0
  115. package/esm/models/operations/getgeneration.js +133 -0
  116. package/esm/models/operations/getguardrail.d.ts +30 -0
  117. package/esm/models/operations/getguardrail.js +7 -0
  118. package/esm/models/operations/getkey.d.ts +30 -0
  119. package/esm/models/operations/getkey.js +7 -0
  120. package/esm/models/operations/getmodels.d.ts +30 -0
  121. package/esm/models/operations/getmodels.js +4 -0
  122. package/esm/models/operations/getuseractivity.d.ts +30 -0
  123. package/esm/models/operations/getuseractivity.js +8 -0
  124. package/esm/models/operations/index.d.ts +2 -0
  125. package/esm/models/operations/index.js +2 -0
  126. package/esm/models/operations/list.d.ts +30 -0
  127. package/esm/models/operations/list.js +4 -0
  128. package/esm/models/operations/listembeddingsmodels.d.ts +40 -0
  129. package/esm/models/operations/listembeddingsmodels.js +20 -0
  130. package/esm/models/operations/listendpoints.d.ts +30 -0
  131. package/esm/models/operations/listendpoints.js +8 -0
  132. package/esm/models/operations/listendpointszdr.d.ts +38 -0
  133. package/esm/models/operations/listendpointszdr.js +14 -0
  134. package/esm/models/operations/listguardrailkeyassignments.d.ts +30 -0
  135. package/esm/models/operations/listguardrailkeyassignments.js +7 -0
  136. package/esm/models/operations/listguardrailmemberassignments.d.ts +30 -0
  137. package/esm/models/operations/listguardrailmemberassignments.js +7 -0
  138. package/esm/models/operations/listguardrails.d.ts +30 -0
  139. package/esm/models/operations/listguardrails.js +7 -0
  140. package/esm/models/operations/listkeyassignments.d.ts +30 -0
  141. package/esm/models/operations/listkeyassignments.js +7 -0
  142. package/esm/models/operations/listmemberassignments.d.ts +30 -0
  143. package/esm/models/operations/listmemberassignments.js +7 -0
  144. package/esm/models/operations/listmodelscount.d.ts +40 -0
  145. package/esm/models/operations/listmodelscount.js +20 -0
  146. package/esm/models/operations/listmodelsuser.d.ts +38 -0
  147. package/esm/models/operations/listmodelsuser.js +14 -0
  148. package/esm/models/operations/listproviders.d.ts +38 -0
  149. package/esm/models/operations/listproviders.js +13 -0
  150. package/esm/models/operations/sendchatcompletionrequest.d.ts +43 -0
  151. package/esm/models/operations/sendchatcompletionrequest.js +16 -0
  152. package/esm/models/operations/updateguardrail.d.ts +30 -0
  153. package/esm/models/operations/updateguardrail.js +4 -0
  154. package/esm/models/operations/updatekeys.d.ts +30 -0
  155. package/esm/models/operations/updatekeys.js +4 -0
  156. package/esm/models/providername.d.ts +2 -0
  157. package/esm/models/providername.js +2 -0
  158. package/esm/models/providerpreferences.d.ts +1 -13
  159. package/esm/models/publicendpoint.d.ts +0 -39
  160. package/esm/models/publicpricing.d.ts +0 -39
  161. package/esm/models/schema10.d.ts +33 -0
  162. package/esm/models/schema10.js +30 -0
  163. package/esm/models/schema14.d.ts +8 -0
  164. package/esm/models/schema14.js +12 -0
  165. package/esm/models/schema17.d.ts +102 -0
  166. package/esm/models/schema17.js +95 -0
  167. package/esm/models/schema19.d.ts +92 -0
  168. package/esm/models/schema19.js +109 -0
  169. package/esm/models/{schema0.d.ts → schema5.d.ts} +10 -8
  170. package/esm/models/{schema0.js → schema5.js} +10 -8
  171. package/esm/sdk/analytics.d.ts +1 -1
  172. package/esm/sdk/analytics.js +1 -1
  173. package/esm/sdk/apikeys.d.ts +6 -6
  174. package/esm/sdk/apikeys.js +7 -7
  175. package/esm/sdk/chat.d.ts +9 -5
  176. package/esm/sdk/credits.d.ts +3 -4
  177. package/esm/sdk/credits.js +3 -3
  178. package/esm/sdk/embeddings.d.ts +1 -1
  179. package/esm/sdk/embeddings.js +2 -2
  180. package/esm/sdk/endpoints.d.ts +1 -1
  181. package/esm/sdk/endpoints.js +2 -2
  182. package/esm/sdk/guardrails.d.ts +13 -13
  183. package/esm/sdk/guardrails.js +13 -13
  184. package/esm/sdk/models.d.ts +2 -2
  185. package/esm/sdk/models.js +4 -4
  186. package/esm/sdk/providers.d.ts +1 -1
  187. package/esm/sdk/providers.js +2 -2
  188. package/esm/sdk/responses.d.ts +9 -5
  189. package/jsr.json +1 -1
  190. package/package.json +1 -1
  191. package/esm/models/schema2.d.ts +0 -92
  192. package/esm/models/schema2.js +0 -109
@@ -1,6 +1,21 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../../types/fp.js";
3
3
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ export type BulkUnassignKeysFromGuardrailGlobals = {
5
+ /**
6
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
7
+ *
8
+ * @remarks
9
+ * This is used to track API usage per application.
10
+ */
11
+ httpReferer?: string | undefined;
12
+ /**
13
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
14
+ *
15
+ * @remarks
16
+ */
17
+ xTitle?: string | undefined;
18
+ };
4
19
  export type BulkUnassignKeysFromGuardrailRequestBody = {
5
20
  /**
6
21
  * Array of API key hashes to unassign from the guardrail
@@ -8,6 +23,19 @@ export type BulkUnassignKeysFromGuardrailRequestBody = {
8
23
  keyHashes: Array<string>;
9
24
  };
10
25
  export type BulkUnassignKeysFromGuardrailRequest = {
26
+ /**
27
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
28
+ *
29
+ * @remarks
30
+ * This is used to track API usage per application.
31
+ */
32
+ httpReferer?: string | undefined;
33
+ /**
34
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
35
+ *
36
+ * @remarks
37
+ */
38
+ xTitle?: string | undefined;
11
39
  /**
12
40
  * The unique identifier of the guardrail
13
41
  */
@@ -32,6 +60,8 @@ export declare const BulkUnassignKeysFromGuardrailRequestBody$outboundSchema: z.
32
60
  export declare function bulkUnassignKeysFromGuardrailRequestBodyToJSON(bulkUnassignKeysFromGuardrailRequestBody: BulkUnassignKeysFromGuardrailRequestBody): string;
33
61
  /** @internal */
34
62
  export type BulkUnassignKeysFromGuardrailRequest$Outbound = {
63
+ "HTTP-Referer"?: string | undefined;
64
+ "X-Title"?: string | undefined;
35
65
  id: string;
36
66
  RequestBody: BulkUnassignKeysFromGuardrailRequestBody$Outbound;
37
67
  };
@@ -18,10 +18,14 @@ export function bulkUnassignKeysFromGuardrailRequestBodyToJSON(bulkUnassignKeysF
18
18
  }
19
19
  /** @internal */
20
20
  export const BulkUnassignKeysFromGuardrailRequest$outboundSchema = z.object({
21
+ httpReferer: z.string().optional(),
22
+ xTitle: z.string().optional(),
21
23
  id: z.string(),
22
24
  requestBody: z.lazy(() => BulkUnassignKeysFromGuardrailRequestBody$outboundSchema),
23
25
  }).transform((v) => {
24
26
  return remap$(v, {
27
+ httpReferer: "HTTP-Referer",
28
+ xTitle: "X-Title",
25
29
  requestBody: "RequestBody",
26
30
  });
27
31
  });
@@ -1,6 +1,21 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../../types/fp.js";
3
3
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ export type BulkUnassignMembersFromGuardrailGlobals = {
5
+ /**
6
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
7
+ *
8
+ * @remarks
9
+ * This is used to track API usage per application.
10
+ */
11
+ httpReferer?: string | undefined;
12
+ /**
13
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
14
+ *
15
+ * @remarks
16
+ */
17
+ xTitle?: string | undefined;
18
+ };
4
19
  export type BulkUnassignMembersFromGuardrailRequestBody = {
5
20
  /**
6
21
  * Array of member user IDs to unassign from the guardrail
@@ -8,6 +23,19 @@ export type BulkUnassignMembersFromGuardrailRequestBody = {
8
23
  memberUserIds: Array<string>;
9
24
  };
10
25
  export type BulkUnassignMembersFromGuardrailRequest = {
26
+ /**
27
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
28
+ *
29
+ * @remarks
30
+ * This is used to track API usage per application.
31
+ */
32
+ httpReferer?: string | undefined;
33
+ /**
34
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
35
+ *
36
+ * @remarks
37
+ */
38
+ xTitle?: string | undefined;
11
39
  /**
12
40
  * The unique identifier of the guardrail
13
41
  */
@@ -32,6 +60,8 @@ export declare const BulkUnassignMembersFromGuardrailRequestBody$outboundSchema:
32
60
  export declare function bulkUnassignMembersFromGuardrailRequestBodyToJSON(bulkUnassignMembersFromGuardrailRequestBody: BulkUnassignMembersFromGuardrailRequestBody): string;
33
61
  /** @internal */
34
62
  export type BulkUnassignMembersFromGuardrailRequest$Outbound = {
63
+ "HTTP-Referer"?: string | undefined;
64
+ "X-Title"?: string | undefined;
35
65
  id: string;
36
66
  RequestBody: BulkUnassignMembersFromGuardrailRequestBody$Outbound;
37
67
  };
@@ -18,10 +18,14 @@ export function bulkUnassignMembersFromGuardrailRequestBodyToJSON(bulkUnassignMe
18
18
  }
19
19
  /** @internal */
20
20
  export const BulkUnassignMembersFromGuardrailRequest$outboundSchema = z.object({
21
+ httpReferer: z.string().optional(),
22
+ xTitle: z.string().optional(),
21
23
  id: z.string(),
22
24
  requestBody: z.lazy(() => BulkUnassignMembersFromGuardrailRequestBody$outboundSchema),
23
25
  }).transform((v) => {
24
26
  return remap$(v, {
27
+ httpReferer: "HTTP-Referer",
28
+ xTitle: "X-Title",
25
29
  requestBody: "RequestBody",
26
30
  });
27
31
  });
@@ -2,6 +2,21 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ export type CreateAuthKeysCodeGlobals = {
6
+ /**
7
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
8
+ *
9
+ * @remarks
10
+ * This is used to track API usage per application.
11
+ */
12
+ httpReferer?: string | undefined;
13
+ /**
14
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
15
+ *
16
+ * @remarks
17
+ */
18
+ xTitle?: string | undefined;
19
+ };
5
20
  /**
6
21
  * The method used to generate the code challenge
7
22
  */
@@ -13,7 +28,7 @@ export declare const CreateAuthKeysCodeCodeChallengeMethod: {
13
28
  * The method used to generate the code challenge
14
29
  */
15
30
  export type CreateAuthKeysCodeCodeChallengeMethod = OpenEnum<typeof CreateAuthKeysCodeCodeChallengeMethod>;
16
- export type CreateAuthKeysCodeRequest = {
31
+ export type CreateAuthKeysCodeRequestBody = {
17
32
  /**
18
33
  * The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.
19
34
  */
@@ -35,6 +50,22 @@ export type CreateAuthKeysCodeRequest = {
35
50
  */
36
51
  expiresAt?: Date | null | undefined;
37
52
  };
53
+ export type CreateAuthKeysCodeRequest = {
54
+ /**
55
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
56
+ *
57
+ * @remarks
58
+ * This is used to track API usage per application.
59
+ */
60
+ httpReferer?: string | undefined;
61
+ /**
62
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
63
+ *
64
+ * @remarks
65
+ */
66
+ xTitle?: string | undefined;
67
+ requestBody: CreateAuthKeysCodeRequestBody;
68
+ };
38
69
  /**
39
70
  * Auth code data
40
71
  */
@@ -64,7 +95,7 @@ export type CreateAuthKeysCodeResponse = {
64
95
  /** @internal */
65
96
  export declare const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema: z.ZodType<string, CreateAuthKeysCodeCodeChallengeMethod>;
66
97
  /** @internal */
67
- export type CreateAuthKeysCodeRequest$Outbound = {
98
+ export type CreateAuthKeysCodeRequestBody$Outbound = {
68
99
  callback_url: string;
69
100
  code_challenge?: string | undefined;
70
101
  code_challenge_method?: string | undefined;
@@ -72,6 +103,15 @@ export type CreateAuthKeysCodeRequest$Outbound = {
72
103
  expires_at?: string | null | undefined;
73
104
  };
74
105
  /** @internal */
106
+ export declare const CreateAuthKeysCodeRequestBody$outboundSchema: z.ZodType<CreateAuthKeysCodeRequestBody$Outbound, CreateAuthKeysCodeRequestBody>;
107
+ export declare function createAuthKeysCodeRequestBodyToJSON(createAuthKeysCodeRequestBody: CreateAuthKeysCodeRequestBody): string;
108
+ /** @internal */
109
+ export type CreateAuthKeysCodeRequest$Outbound = {
110
+ "HTTP-Referer"?: string | undefined;
111
+ "X-Title"?: string | undefined;
112
+ RequestBody: CreateAuthKeysCodeRequestBody$Outbound;
113
+ };
114
+ /** @internal */
75
115
  export declare const CreateAuthKeysCodeRequest$outboundSchema: z.ZodType<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest>;
76
116
  export declare function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest: CreateAuthKeysCodeRequest): string;
77
117
  /** @internal */
@@ -16,7 +16,7 @@ export const CreateAuthKeysCodeCodeChallengeMethod = {
16
16
  /** @internal */
17
17
  export const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema = openEnums.outboundSchema(CreateAuthKeysCodeCodeChallengeMethod);
18
18
  /** @internal */
19
- export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
19
+ export const CreateAuthKeysCodeRequestBody$outboundSchema = z.object({
20
20
  callbackUrl: z.string(),
21
21
  codeChallenge: z.string().optional(),
22
22
  codeChallengeMethod: CreateAuthKeysCodeCodeChallengeMethod$outboundSchema
@@ -31,6 +31,21 @@ export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
31
31
  expiresAt: "expires_at",
32
32
  });
33
33
  });
34
+ export function createAuthKeysCodeRequestBodyToJSON(createAuthKeysCodeRequestBody) {
35
+ return JSON.stringify(CreateAuthKeysCodeRequestBody$outboundSchema.parse(createAuthKeysCodeRequestBody));
36
+ }
37
+ /** @internal */
38
+ export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
39
+ httpReferer: z.string().optional(),
40
+ xTitle: z.string().optional(),
41
+ requestBody: z.lazy(() => CreateAuthKeysCodeRequestBody$outboundSchema),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ httpReferer: "HTTP-Referer",
45
+ xTitle: "X-Title",
46
+ requestBody: "RequestBody",
47
+ });
48
+ });
34
49
  export function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest) {
35
50
  return JSON.stringify(CreateAuthKeysCodeRequest$outboundSchema.parse(createAuthKeysCodeRequest));
36
51
  }
@@ -1,9 +1,41 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../../types/fp.js";
3
3
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ import * as models from "../index.js";
5
+ export type CreateCoinbaseChargeGlobals = {
6
+ /**
7
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
8
+ *
9
+ * @remarks
10
+ * This is used to track API usage per application.
11
+ */
12
+ httpReferer?: string | undefined;
13
+ /**
14
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
15
+ *
16
+ * @remarks
17
+ */
18
+ xTitle?: string | undefined;
19
+ };
4
20
  export type CreateCoinbaseChargeSecurity = {
5
21
  bearer: string;
6
22
  };
23
+ export type CreateCoinbaseChargeRequest = {
24
+ /**
25
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
26
+ *
27
+ * @remarks
28
+ * This is used to track API usage per application.
29
+ */
30
+ httpReferer?: string | undefined;
31
+ /**
32
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
33
+ *
34
+ * @remarks
35
+ */
36
+ xTitle?: string | undefined;
37
+ createChargeRequest: models.CreateChargeRequest;
38
+ };
7
39
  export type CallData = {
8
40
  deadline: string;
9
41
  feeAmount: string;
@@ -48,6 +80,15 @@ export type CreateCoinbaseChargeSecurity$Outbound = {
48
80
  export declare const CreateCoinbaseChargeSecurity$outboundSchema: z.ZodType<CreateCoinbaseChargeSecurity$Outbound, CreateCoinbaseChargeSecurity>;
49
81
  export declare function createCoinbaseChargeSecurityToJSON(createCoinbaseChargeSecurity: CreateCoinbaseChargeSecurity): string;
50
82
  /** @internal */
83
+ export type CreateCoinbaseChargeRequest$Outbound = {
84
+ "HTTP-Referer"?: string | undefined;
85
+ "X-Title"?: string | undefined;
86
+ CreateChargeRequest: models.CreateChargeRequest$Outbound;
87
+ };
88
+ /** @internal */
89
+ export declare const CreateCoinbaseChargeRequest$outboundSchema: z.ZodType<CreateCoinbaseChargeRequest$Outbound, CreateCoinbaseChargeRequest>;
90
+ export declare function createCoinbaseChargeRequestToJSON(createCoinbaseChargeRequest: CreateCoinbaseChargeRequest): string;
91
+ /** @internal */
51
92
  export declare const CallData$inboundSchema: z.ZodType<CallData, unknown>;
52
93
  export declare function callDataFromJSON(jsonString: string): SafeParseResult<CallData, SDKValidationError>;
53
94
  /** @internal */
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import * as models from "../index.js";
8
9
  /** @internal */
9
10
  export const CreateCoinbaseChargeSecurity$outboundSchema = z.object({
10
11
  bearer: z.string(),
@@ -13,6 +14,21 @@ export function createCoinbaseChargeSecurityToJSON(createCoinbaseChargeSecurity)
13
14
  return JSON.stringify(CreateCoinbaseChargeSecurity$outboundSchema.parse(createCoinbaseChargeSecurity));
14
15
  }
15
16
  /** @internal */
17
+ export const CreateCoinbaseChargeRequest$outboundSchema = z.object({
18
+ httpReferer: z.string().optional(),
19
+ xTitle: z.string().optional(),
20
+ createChargeRequest: models.CreateChargeRequest$outboundSchema,
21
+ }).transform((v) => {
22
+ return remap$(v, {
23
+ httpReferer: "HTTP-Referer",
24
+ xTitle: "X-Title",
25
+ createChargeRequest: "CreateChargeRequest",
26
+ });
27
+ });
28
+ export function createCoinbaseChargeRequestToJSON(createCoinbaseChargeRequest) {
29
+ return JSON.stringify(CreateCoinbaseChargeRequest$outboundSchema.parse(createCoinbaseChargeRequest));
30
+ }
31
+ /** @internal */
16
32
  export const CallData$inboundSchema = z.object({
17
33
  deadline: z.string(),
18
34
  fee_amount: z.string(),
@@ -3,6 +3,21 @@ import { ClosedEnum, OpenEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
5
  import * as models from "../index.js";
6
+ export type CreateEmbeddingsGlobals = {
7
+ /**
8
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
9
+ *
10
+ * @remarks
11
+ * This is used to track API usage per application.
12
+ */
13
+ httpReferer?: string | undefined;
14
+ /**
15
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
16
+ *
17
+ * @remarks
18
+ */
19
+ xTitle?: string | undefined;
20
+ };
6
21
  export type ImageUrl = {
7
22
  url: string;
8
23
  };
@@ -24,7 +39,7 @@ export declare const EncodingFormat: {
24
39
  readonly Base64: "base64";
25
40
  };
26
41
  export type EncodingFormat = OpenEnum<typeof EncodingFormat>;
27
- export type CreateEmbeddingsRequest = {
42
+ export type CreateEmbeddingsRequestBody = {
28
43
  input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
29
44
  model: string;
30
45
  encodingFormat?: EncodingFormat | undefined;
@@ -36,6 +51,22 @@ export type CreateEmbeddingsRequest = {
36
51
  provider?: models.ProviderPreferences | undefined;
37
52
  inputType?: string | undefined;
38
53
  };
54
+ export type CreateEmbeddingsRequest = {
55
+ /**
56
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
57
+ *
58
+ * @remarks
59
+ * This is used to track API usage per application.
60
+ */
61
+ httpReferer?: string | undefined;
62
+ /**
63
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
64
+ *
65
+ * @remarks
66
+ */
67
+ xTitle?: string | undefined;
68
+ requestBody: CreateEmbeddingsRequestBody;
69
+ };
39
70
  export declare const ObjectT: {
40
71
  readonly List: "list";
41
72
  };
@@ -109,7 +140,7 @@ export declare function inputUnionToJSON(inputUnion: InputUnion): string;
109
140
  /** @internal */
110
141
  export declare const EncodingFormat$outboundSchema: z.ZodType<string, EncodingFormat>;
111
142
  /** @internal */
112
- export type CreateEmbeddingsRequest$Outbound = {
143
+ export type CreateEmbeddingsRequestBody$Outbound = {
113
144
  input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
114
145
  model: string;
115
146
  encoding_format?: string | undefined;
@@ -119,6 +150,15 @@ export type CreateEmbeddingsRequest$Outbound = {
119
150
  input_type?: string | undefined;
120
151
  };
121
152
  /** @internal */
153
+ export declare const CreateEmbeddingsRequestBody$outboundSchema: z.ZodType<CreateEmbeddingsRequestBody$Outbound, CreateEmbeddingsRequestBody>;
154
+ export declare function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody: CreateEmbeddingsRequestBody): string;
155
+ /** @internal */
156
+ export type CreateEmbeddingsRequest$Outbound = {
157
+ "HTTP-Referer"?: string | undefined;
158
+ "X-Title"?: string | undefined;
159
+ RequestBody: CreateEmbeddingsRequestBody$Outbound;
160
+ };
161
+ /** @internal */
122
162
  export declare const CreateEmbeddingsRequest$outboundSchema: z.ZodType<CreateEmbeddingsRequest$Outbound, CreateEmbeddingsRequest>;
123
163
  export declare function createEmbeddingsRequestToJSON(createEmbeddingsRequest: CreateEmbeddingsRequest): string;
124
164
  /** @internal */
@@ -78,7 +78,7 @@ export function inputUnionToJSON(inputUnion) {
78
78
  /** @internal */
79
79
  export const EncodingFormat$outboundSchema = openEnums.outboundSchema(EncodingFormat);
80
80
  /** @internal */
81
- export const CreateEmbeddingsRequest$outboundSchema = z.object({
81
+ export const CreateEmbeddingsRequestBody$outboundSchema = z.object({
82
82
  input: z.union([
83
83
  z.string(),
84
84
  z.array(z.string()),
@@ -98,6 +98,21 @@ export const CreateEmbeddingsRequest$outboundSchema = z.object({
98
98
  inputType: "input_type",
99
99
  });
100
100
  });
101
+ export function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody) {
102
+ return JSON.stringify(CreateEmbeddingsRequestBody$outboundSchema.parse(createEmbeddingsRequestBody));
103
+ }
104
+ /** @internal */
105
+ export const CreateEmbeddingsRequest$outboundSchema = z.object({
106
+ httpReferer: z.string().optional(),
107
+ xTitle: z.string().optional(),
108
+ requestBody: z.lazy(() => CreateEmbeddingsRequestBody$outboundSchema),
109
+ }).transform((v) => {
110
+ return remap$(v, {
111
+ httpReferer: "HTTP-Referer",
112
+ xTitle: "X-Title",
113
+ requestBody: "RequestBody",
114
+ });
115
+ });
101
116
  export function createEmbeddingsRequestToJSON(createEmbeddingsRequest) {
102
117
  return JSON.stringify(CreateEmbeddingsRequest$outboundSchema.parse(createEmbeddingsRequest));
103
118
  }
@@ -2,6 +2,21 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ export type CreateGuardrailGlobals = {
6
+ /**
7
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
8
+ *
9
+ * @remarks
10
+ * This is used to track API usage per application.
11
+ */
12
+ httpReferer?: string | undefined;
13
+ /**
14
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
15
+ *
16
+ * @remarks
17
+ */
18
+ xTitle?: string | undefined;
19
+ };
5
20
  /**
6
21
  * Interval at which the limit resets (daily, weekly, monthly)
7
22
  */
@@ -14,7 +29,7 @@ export declare const CreateGuardrailResetIntervalRequest: {
14
29
  * Interval at which the limit resets (daily, weekly, monthly)
15
30
  */
16
31
  export type CreateGuardrailResetIntervalRequest = OpenEnum<typeof CreateGuardrailResetIntervalRequest>;
17
- export type CreateGuardrailRequest = {
32
+ export type CreateGuardrailRequestBody = {
18
33
  /**
19
34
  * Name for the new guardrail
20
35
  */
@@ -44,6 +59,22 @@ export type CreateGuardrailRequest = {
44
59
  */
45
60
  enforceZdr?: boolean | null | undefined;
46
61
  };
62
+ export type CreateGuardrailRequest = {
63
+ /**
64
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
65
+ *
66
+ * @remarks
67
+ * This is used to track API usage per application.
68
+ */
69
+ httpReferer?: string | undefined;
70
+ /**
71
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
72
+ *
73
+ * @remarks
74
+ */
75
+ xTitle?: string | undefined;
76
+ requestBody: CreateGuardrailRequestBody;
77
+ };
47
78
  /**
48
79
  * Interval at which the limit resets (daily, weekly, monthly)
49
80
  */
@@ -113,7 +144,7 @@ export type CreateGuardrailResponse = {
113
144
  /** @internal */
114
145
  export declare const CreateGuardrailResetIntervalRequest$outboundSchema: z.ZodType<string, CreateGuardrailResetIntervalRequest>;
115
146
  /** @internal */
116
- export type CreateGuardrailRequest$Outbound = {
147
+ export type CreateGuardrailRequestBody$Outbound = {
117
148
  name: string;
118
149
  description?: string | null | undefined;
119
150
  limit_usd?: number | null | undefined;
@@ -123,6 +154,15 @@ export type CreateGuardrailRequest$Outbound = {
123
154
  enforce_zdr?: boolean | null | undefined;
124
155
  };
125
156
  /** @internal */
157
+ export declare const CreateGuardrailRequestBody$outboundSchema: z.ZodType<CreateGuardrailRequestBody$Outbound, CreateGuardrailRequestBody>;
158
+ export declare function createGuardrailRequestBodyToJSON(createGuardrailRequestBody: CreateGuardrailRequestBody): string;
159
+ /** @internal */
160
+ export type CreateGuardrailRequest$Outbound = {
161
+ "HTTP-Referer"?: string | undefined;
162
+ "X-Title"?: string | undefined;
163
+ RequestBody: CreateGuardrailRequestBody$Outbound;
164
+ };
165
+ /** @internal */
126
166
  export declare const CreateGuardrailRequest$outboundSchema: z.ZodType<CreateGuardrailRequest$Outbound, CreateGuardrailRequest>;
127
167
  export declare function createGuardrailRequestToJSON(createGuardrailRequest: CreateGuardrailRequest): string;
128
168
  /** @internal */
@@ -25,7 +25,7 @@ export const CreateGuardrailResetIntervalResponse = {
25
25
  /** @internal */
26
26
  export const CreateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(CreateGuardrailResetIntervalRequest);
27
27
  /** @internal */
28
- export const CreateGuardrailRequest$outboundSchema = z.object({
28
+ export const CreateGuardrailRequestBody$outboundSchema = z.object({
29
29
  name: z.string(),
30
30
  description: z.nullable(z.string()).optional(),
31
31
  limitUsd: z.nullable(z.number()).optional(),
@@ -43,6 +43,21 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
43
43
  enforceZdr: "enforce_zdr",
44
44
  });
45
45
  });
46
+ export function createGuardrailRequestBodyToJSON(createGuardrailRequestBody) {
47
+ return JSON.stringify(CreateGuardrailRequestBody$outboundSchema.parse(createGuardrailRequestBody));
48
+ }
49
+ /** @internal */
50
+ export const CreateGuardrailRequest$outboundSchema = z.object({
51
+ httpReferer: z.string().optional(),
52
+ xTitle: z.string().optional(),
53
+ requestBody: z.lazy(() => CreateGuardrailRequestBody$outboundSchema),
54
+ }).transform((v) => {
55
+ return remap$(v, {
56
+ httpReferer: "HTTP-Referer",
57
+ xTitle: "X-Title",
58
+ requestBody: "RequestBody",
59
+ });
60
+ });
46
61
  export function createGuardrailRequestToJSON(createGuardrailRequest) {
47
62
  return JSON.stringify(CreateGuardrailRequest$outboundSchema.parse(createGuardrailRequest));
48
63
  }
@@ -2,6 +2,21 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ export type CreateKeysGlobals = {
6
+ /**
7
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
8
+ *
9
+ * @remarks
10
+ * This is used to track API usage per application.
11
+ */
12
+ httpReferer?: string | undefined;
13
+ /**
14
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
15
+ *
16
+ * @remarks
17
+ */
18
+ xTitle?: string | undefined;
19
+ };
5
20
  /**
6
21
  * Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
7
22
  */
@@ -14,7 +29,7 @@ export declare const CreateKeysLimitReset: {
14
29
  * Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
15
30
  */
16
31
  export type CreateKeysLimitReset = OpenEnum<typeof CreateKeysLimitReset>;
17
- export type CreateKeysRequest = {
32
+ export type CreateKeysRequestBody = {
18
33
  /**
19
34
  * Name for the new API key
20
35
  */
@@ -36,6 +51,22 @@ export type CreateKeysRequest = {
36
51
  */
37
52
  expiresAt?: Date | null | undefined;
38
53
  };
54
+ export type CreateKeysRequest = {
55
+ /**
56
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
57
+ *
58
+ * @remarks
59
+ * This is used to track API usage per application.
60
+ */
61
+ httpReferer?: string | undefined;
62
+ /**
63
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
64
+ *
65
+ * @remarks
66
+ */
67
+ xTitle?: string | undefined;
68
+ requestBody: CreateKeysRequestBody;
69
+ };
39
70
  /**
40
71
  * The created API key information
41
72
  */
@@ -133,7 +164,7 @@ export type CreateKeysResponse = {
133
164
  /** @internal */
134
165
  export declare const CreateKeysLimitReset$outboundSchema: z.ZodType<string, CreateKeysLimitReset>;
135
166
  /** @internal */
136
- export type CreateKeysRequest$Outbound = {
167
+ export type CreateKeysRequestBody$Outbound = {
137
168
  name: string;
138
169
  limit?: number | null | undefined;
139
170
  limit_reset?: string | null | undefined;
@@ -141,6 +172,15 @@ export type CreateKeysRequest$Outbound = {
141
172
  expires_at?: string | null | undefined;
142
173
  };
143
174
  /** @internal */
175
+ export declare const CreateKeysRequestBody$outboundSchema: z.ZodType<CreateKeysRequestBody$Outbound, CreateKeysRequestBody>;
176
+ export declare function createKeysRequestBodyToJSON(createKeysRequestBody: CreateKeysRequestBody): string;
177
+ /** @internal */
178
+ export type CreateKeysRequest$Outbound = {
179
+ "HTTP-Referer"?: string | undefined;
180
+ "X-Title"?: string | undefined;
181
+ RequestBody: CreateKeysRequestBody$Outbound;
182
+ };
183
+ /** @internal */
144
184
  export declare const CreateKeysRequest$outboundSchema: z.ZodType<CreateKeysRequest$Outbound, CreateKeysRequest>;
145
185
  export declare function createKeysRequestToJSON(createKeysRequest: CreateKeysRequest): string;
146
186
  /** @internal */
@@ -17,7 +17,7 @@ export const CreateKeysLimitReset = {
17
17
  /** @internal */
18
18
  export const CreateKeysLimitReset$outboundSchema = openEnums.outboundSchema(CreateKeysLimitReset);
19
19
  /** @internal */
20
- export const CreateKeysRequest$outboundSchema = z.object({
20
+ export const CreateKeysRequestBody$outboundSchema = z.object({
21
21
  name: z.string(),
22
22
  limit: z.nullable(z.number()).optional(),
23
23
  limitReset: z.nullable(CreateKeysLimitReset$outboundSchema).optional(),
@@ -30,6 +30,21 @@ export const CreateKeysRequest$outboundSchema = z.object({
30
30
  expiresAt: "expires_at",
31
31
  });
32
32
  });
33
+ export function createKeysRequestBodyToJSON(createKeysRequestBody) {
34
+ return JSON.stringify(CreateKeysRequestBody$outboundSchema.parse(createKeysRequestBody));
35
+ }
36
+ /** @internal */
37
+ export const CreateKeysRequest$outboundSchema = z.object({
38
+ httpReferer: z.string().optional(),
39
+ xTitle: z.string().optional(),
40
+ requestBody: z.lazy(() => CreateKeysRequestBody$outboundSchema),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ httpReferer: "HTTP-Referer",
44
+ xTitle: "X-Title",
45
+ requestBody: "RequestBody",
46
+ });
47
+ });
33
48
  export function createKeysRequestToJSON(createKeysRequest) {
34
49
  return JSON.stringify(CreateKeysRequest$outboundSchema.parse(createKeysRequest));
35
50
  }