@openrouter/sdk 0.3.12 → 0.3.15

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 (172) hide show
  1. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  2. package/esm/funcs/analyticsGetUserActivity.js +1 -1
  3. package/esm/funcs/apiKeysCreate.d.ts +3 -0
  4. package/esm/funcs/apiKeysCreate.js +3 -0
  5. package/esm/funcs/apiKeysDelete.d.ts +3 -0
  6. package/esm/funcs/apiKeysDelete.js +3 -0
  7. package/esm/funcs/apiKeysGet.d.ts +3 -0
  8. package/esm/funcs/apiKeysGet.js +3 -0
  9. package/esm/funcs/apiKeysList.d.ts +3 -0
  10. package/esm/funcs/apiKeysList.js +3 -0
  11. package/esm/funcs/apiKeysUpdate.d.ts +3 -0
  12. package/esm/funcs/apiKeysUpdate.js +3 -0
  13. package/esm/funcs/call-model.js +9 -6
  14. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  15. package/esm/funcs/creditsGetCredits.js +1 -1
  16. package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
  17. package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
  18. package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
  19. package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
  20. package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
  21. package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
  22. package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
  23. package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
  24. package/esm/funcs/guardrailsCreate.d.ts +18 -0
  25. package/esm/funcs/guardrailsCreate.js +83 -0
  26. package/esm/funcs/guardrailsDelete.d.ts +18 -0
  27. package/esm/funcs/guardrailsDelete.js +88 -0
  28. package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
  29. package/esm/funcs/guardrailsGet.js +88 -0
  30. package/esm/funcs/guardrailsList.d.ts +18 -0
  31. package/esm/funcs/guardrailsList.js +87 -0
  32. package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
  33. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
  34. package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
  35. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
  36. package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
  37. package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
  38. package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
  39. package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
  40. package/esm/funcs/guardrailsUpdate.d.ts +18 -0
  41. package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
  42. package/esm/index.d.ts +4 -3
  43. package/esm/index.js +3 -1
  44. package/esm/lib/anthropic-compat.test.js +3 -0
  45. package/esm/lib/async-params.d.ts +46 -6
  46. package/esm/lib/async-params.js +10 -2
  47. package/esm/lib/chat-compat.test.js +3 -0
  48. package/esm/lib/config.d.ts +2 -4
  49. package/esm/lib/config.js +2 -2
  50. package/esm/lib/conversation-state.d.ts +61 -0
  51. package/esm/lib/conversation-state.js +207 -0
  52. package/esm/lib/model-result.d.ts +175 -2
  53. package/esm/lib/model-result.js +678 -181
  54. package/esm/lib/tool-types.d.ts +109 -1
  55. package/esm/lib/tool-types.js +13 -0
  56. package/esm/lib/tool.d.ts +21 -1
  57. package/esm/lib/tool.js +7 -0
  58. package/esm/models/assistantmessage.d.ts +31 -0
  59. package/esm/models/assistantmessage.js +43 -0
  60. package/esm/models/chatgenerationparams.d.ts +93 -12
  61. package/esm/models/chatgenerationparams.js +75 -6
  62. package/esm/models/chatgenerationtokenusage.d.ts +1 -0
  63. package/esm/models/chatgenerationtokenusage.js +2 -0
  64. package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
  65. package/esm/models/chatmessagecontentitemimage.js +8 -9
  66. package/esm/models/chatmessagetokenlogprob.d.ts +4 -4
  67. package/esm/models/chatmessagetokenlogprob.js +4 -5
  68. package/esm/models/chatresponsechoice.d.ts +0 -2
  69. package/esm/models/chatresponsechoice.js +0 -3
  70. package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
  71. package/esm/models/chatstreamingmessagechunk.js +2 -2
  72. package/esm/models/index.d.ts +8 -1
  73. package/esm/models/index.js +8 -1
  74. package/esm/models/model.d.ts +4 -0
  75. package/esm/models/model.js +2 -0
  76. package/esm/models/openairesponsesinputunion.d.ts +15 -5
  77. package/esm/models/openairesponsesinputunion.js +5 -5
  78. package/esm/models/openresponseseasyinputmessage.d.ts +41 -16
  79. package/esm/models/openresponseseasyinputmessage.js +38 -13
  80. package/esm/models/openresponsesinputmessageitem.d.ts +37 -12
  81. package/esm/models/openresponsesinputmessageitem.js +33 -9
  82. package/esm/models/openresponsesnonstreamingresponse.d.ts +5 -2
  83. package/esm/models/openresponsesnonstreamingresponse.js +8 -2
  84. package/esm/models/openresponsesreasoning.d.ts +1 -0
  85. package/esm/models/openresponsesreasoning.js +1 -0
  86. package/esm/models/openresponsesrequest.d.ts +61 -24
  87. package/esm/models/openresponsesrequest.js +39 -6
  88. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
  89. package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
  90. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
  91. package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
  92. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
  93. package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
  94. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
  95. package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
  96. package/esm/models/operations/createguardrail.d.ts +136 -0
  97. package/esm/models/operations/createguardrail.js +85 -0
  98. package/esm/models/operations/deleteguardrail.d.ts +29 -0
  99. package/esm/models/operations/deleteguardrail.js +21 -0
  100. package/esm/models/operations/getgeneration.d.ts +4 -0
  101. package/esm/models/operations/getgeneration.js +1 -0
  102. package/esm/models/operations/getguardrail.d.ts +92 -0
  103. package/esm/models/operations/getguardrail.js +60 -0
  104. package/esm/models/operations/getmodels.d.ts +28 -1
  105. package/esm/models/operations/getmodels.js +22 -1
  106. package/esm/models/operations/index.d.ts +13 -1
  107. package/esm/models/operations/index.js +13 -1
  108. package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
  109. package/esm/models/operations/listguardrailkeyassignments.js +51 -0
  110. package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
  111. package/esm/models/operations/listguardrailmemberassignments.js +49 -0
  112. package/esm/models/operations/listguardrails.d.ts +98 -0
  113. package/esm/models/operations/listguardrails.js +66 -0
  114. package/esm/models/operations/listkeyassignments.d.ts +71 -0
  115. package/esm/models/operations/listkeyassignments.js +50 -0
  116. package/esm/models/operations/listmemberassignments.d.ts +67 -0
  117. package/esm/models/operations/listmemberassignments.js +48 -0
  118. package/esm/models/operations/updateguardrail.d.ts +151 -0
  119. package/esm/models/operations/updateguardrail.js +97 -0
  120. package/esm/models/percentilelatencycutoffs.d.ts +33 -0
  121. package/esm/models/percentilelatencycutoffs.js +16 -0
  122. package/esm/models/percentilestats.d.ts +28 -0
  123. package/esm/models/percentilestats.js +17 -0
  124. package/esm/models/percentilethroughputcutoffs.d.ts +33 -0
  125. package/esm/models/percentilethroughputcutoffs.js +16 -0
  126. package/esm/models/preferredmaxlatency.d.ts +12 -0
  127. package/esm/models/preferredmaxlatency.js +12 -0
  128. package/esm/models/preferredminthroughput.d.ts +12 -0
  129. package/esm/models/preferredminthroughput.js +12 -0
  130. package/esm/models/providername.d.ts +3 -2
  131. package/esm/models/providername.js +3 -2
  132. package/esm/models/providerpreferences.d.ts +8 -20
  133. package/esm/models/providerpreferences.js +6 -6
  134. package/esm/models/publicendpoint.d.ts +6 -0
  135. package/esm/models/publicendpoint.js +5 -0
  136. package/esm/models/responseinputimage.d.ts +11 -3
  137. package/esm/models/responseinputimage.js +9 -2
  138. package/esm/models/responseinputvideo.d.ts +20 -0
  139. package/esm/models/responseinputvideo.js +19 -0
  140. package/esm/models/responseoutputtext.d.ts +38 -0
  141. package/esm/models/responseoutputtext.js +50 -0
  142. package/esm/models/responsesoutputitemreasoning.d.ts +30 -1
  143. package/esm/models/responsesoutputitemreasoning.js +22 -0
  144. package/esm/models/responsesoutputmodality.d.ts +10 -0
  145. package/esm/models/responsesoutputmodality.js +12 -0
  146. package/esm/models/schema0.d.ts +3 -2
  147. package/esm/models/schema0.js +3 -2
  148. package/esm/models/schema2.d.ts +92 -0
  149. package/esm/models/schema2.js +109 -0
  150. package/esm/sdk/analytics.d.ts +1 -1
  151. package/esm/sdk/analytics.js +1 -1
  152. package/esm/sdk/apikeys.d.ts +15 -0
  153. package/esm/sdk/apikeys.js +15 -0
  154. package/esm/sdk/credits.d.ts +1 -1
  155. package/esm/sdk/credits.js +1 -1
  156. package/esm/sdk/guardrails.d.ts +96 -0
  157. package/esm/sdk/guardrails.js +139 -0
  158. package/esm/sdk/sdk.d.ts +3 -3
  159. package/esm/sdk/sdk.js +4 -4
  160. package/esm/types/index.d.ts +2 -0
  161. package/esm/types/index.js +1 -0
  162. package/esm/types/models.d.ts +25 -0
  163. package/esm/types/models.js +10 -0
  164. package/jsr.json +1 -1
  165. package/package.json +12 -10
  166. package/scripts/check-types.js +127 -0
  167. package/esm/models/operations/getparameters.d.ts +0 -87
  168. package/esm/models/operations/getparameters.js +0 -73
  169. package/esm/models/schema3.d.ts +0 -50
  170. package/esm/models/schema3.js +0 -61
  171. package/esm/sdk/parameters.d.ts +0 -9
  172. package/esm/sdk/parameters.js +0 -16
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5f0f56d14d79
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ /**
10
+ * Interval at which the limit resets (daily, weekly, monthly)
11
+ */
12
+ export const CreateGuardrailResetIntervalRequest = {
13
+ Daily: "daily",
14
+ Weekly: "weekly",
15
+ Monthly: "monthly",
16
+ };
17
+ /**
18
+ * Interval at which the limit resets (daily, weekly, monthly)
19
+ */
20
+ export const CreateGuardrailResetIntervalResponse = {
21
+ Daily: "daily",
22
+ Weekly: "weekly",
23
+ Monthly: "monthly",
24
+ };
25
+ /** @internal */
26
+ export const CreateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(CreateGuardrailResetIntervalRequest);
27
+ /** @internal */
28
+ export const CreateGuardrailRequest$outboundSchema = z.object({
29
+ name: z.string(),
30
+ description: z.nullable(z.string()).optional(),
31
+ limitUsd: z.nullable(z.number()).optional(),
32
+ resetInterval: z.nullable(CreateGuardrailResetIntervalRequest$outboundSchema)
33
+ .optional(),
34
+ allowedProviders: z.nullable(z.array(z.string())).optional(),
35
+ allowedModels: z.nullable(z.array(z.string())).optional(),
36
+ enforceZdr: z.nullable(z.boolean()).optional(),
37
+ }).transform((v) => {
38
+ return remap$(v, {
39
+ limitUsd: "limit_usd",
40
+ resetInterval: "reset_interval",
41
+ allowedProviders: "allowed_providers",
42
+ allowedModels: "allowed_models",
43
+ enforceZdr: "enforce_zdr",
44
+ });
45
+ });
46
+ export function createGuardrailRequestToJSON(createGuardrailRequest) {
47
+ return JSON.stringify(CreateGuardrailRequest$outboundSchema.parse(createGuardrailRequest));
48
+ }
49
+ /** @internal */
50
+ export const CreateGuardrailResetIntervalResponse$inboundSchema = openEnums.inboundSchema(CreateGuardrailResetIntervalResponse);
51
+ /** @internal */
52
+ export const CreateGuardrailData$inboundSchema = z.object({
53
+ id: z.string(),
54
+ name: z.string(),
55
+ description: z.nullable(z.string()).optional(),
56
+ limit_usd: z.nullable(z.number()).optional(),
57
+ reset_interval: z.nullable(CreateGuardrailResetIntervalResponse$inboundSchema)
58
+ .optional(),
59
+ allowed_providers: z.nullable(z.array(z.string())).optional(),
60
+ allowed_models: z.nullable(z.array(z.string())).optional(),
61
+ enforce_zdr: z.nullable(z.boolean()).optional(),
62
+ created_at: z.string(),
63
+ updated_at: z.nullable(z.string()).optional(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ "limit_usd": "limitUsd",
67
+ "reset_interval": "resetInterval",
68
+ "allowed_providers": "allowedProviders",
69
+ "allowed_models": "allowedModels",
70
+ "enforce_zdr": "enforceZdr",
71
+ "created_at": "createdAt",
72
+ "updated_at": "updatedAt",
73
+ });
74
+ });
75
+ export function createGuardrailDataFromJSON(jsonString) {
76
+ return safeParse(jsonString, (x) => CreateGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateGuardrailData' from JSON`);
77
+ }
78
+ /** @internal */
79
+ export const CreateGuardrailResponse$inboundSchema = z.object({
80
+ data: z.lazy(() => CreateGuardrailData$inboundSchema),
81
+ });
82
+ export function createGuardrailResponseFromJSON(jsonString) {
83
+ return safeParse(jsonString, (x) => CreateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateGuardrailResponse' from JSON`);
84
+ }
85
+ //# sourceMappingURL=createguardrail.js.map
@@ -0,0 +1,29 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ export type DeleteGuardrailRequest = {
5
+ /**
6
+ * The unique identifier of the guardrail to delete
7
+ */
8
+ id: string;
9
+ };
10
+ /**
11
+ * Guardrail deleted successfully
12
+ */
13
+ export type DeleteGuardrailResponse = {
14
+ /**
15
+ * Confirmation that the guardrail was deleted
16
+ */
17
+ deleted: true;
18
+ };
19
+ /** @internal */
20
+ export type DeleteGuardrailRequest$Outbound = {
21
+ id: string;
22
+ };
23
+ /** @internal */
24
+ export declare const DeleteGuardrailRequest$outboundSchema: z.ZodType<DeleteGuardrailRequest$Outbound, DeleteGuardrailRequest>;
25
+ export declare function deleteGuardrailRequestToJSON(deleteGuardrailRequest: DeleteGuardrailRequest): string;
26
+ /** @internal */
27
+ export declare const DeleteGuardrailResponse$inboundSchema: z.ZodType<DeleteGuardrailResponse, unknown>;
28
+ export declare function deleteGuardrailResponseFromJSON(jsonString: string): SafeParseResult<DeleteGuardrailResponse, SDKValidationError>;
29
+ //# sourceMappingURL=deleteguardrail.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0319276942bf
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ /** @internal */
8
+ export const DeleteGuardrailRequest$outboundSchema = z.object({
9
+ id: z.string(),
10
+ });
11
+ export function deleteGuardrailRequestToJSON(deleteGuardrailRequest) {
12
+ return JSON.stringify(DeleteGuardrailRequest$outboundSchema.parse(deleteGuardrailRequest));
13
+ }
14
+ /** @internal */
15
+ export const DeleteGuardrailResponse$inboundSchema = z.object({
16
+ deleted: z.literal(true),
17
+ });
18
+ export function deleteGuardrailResponseFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => DeleteGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteGuardrailResponse' from JSON`);
20
+ }
21
+ //# sourceMappingURL=deleteguardrail.js.map
@@ -148,6 +148,10 @@ export type GetGenerationData = {
148
148
  * Type of API used for the generation
149
149
  */
150
150
  apiType: ApiType | null;
151
+ /**
152
+ * Router used for the request (e.g., openrouter/auto)
153
+ */
154
+ router: string | null;
151
155
  };
152
156
  /**
153
157
  * Generation response
@@ -57,6 +57,7 @@ export const GetGenerationData$inboundSchema = z.object({
57
57
  native_finish_reason: z.nullable(z.string()),
58
58
  external_user: z.nullable(z.string()),
59
59
  api_type: z.nullable(ApiType$inboundSchema),
60
+ router: z.nullable(z.string()),
60
61
  }).transform((v) => {
61
62
  return remap$(v, {
62
63
  "upstream_id": "upstreamId",
@@ -0,0 +1,92 @@
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
+ export type GetGuardrailRequest = {
6
+ /**
7
+ * The unique identifier of the guardrail to retrieve
8
+ */
9
+ id: string;
10
+ };
11
+ /**
12
+ * Interval at which the limit resets (daily, weekly, monthly)
13
+ */
14
+ export declare const GetGuardrailResetInterval: {
15
+ readonly Daily: "daily";
16
+ readonly Weekly: "weekly";
17
+ readonly Monthly: "monthly";
18
+ };
19
+ /**
20
+ * Interval at which the limit resets (daily, weekly, monthly)
21
+ */
22
+ export type GetGuardrailResetInterval = OpenEnum<typeof GetGuardrailResetInterval>;
23
+ /**
24
+ * The guardrail
25
+ */
26
+ export type GetGuardrailData = {
27
+ /**
28
+ * Unique identifier for the guardrail
29
+ */
30
+ id: string;
31
+ /**
32
+ * Name of the guardrail
33
+ */
34
+ name: string;
35
+ /**
36
+ * Description of the guardrail
37
+ */
38
+ description?: string | null | undefined;
39
+ /**
40
+ * Spending limit in USD
41
+ */
42
+ limitUsd?: number | null | undefined;
43
+ /**
44
+ * Interval at which the limit resets (daily, weekly, monthly)
45
+ */
46
+ resetInterval?: GetGuardrailResetInterval | null | undefined;
47
+ /**
48
+ * List of allowed provider IDs
49
+ */
50
+ allowedProviders?: Array<string> | null | undefined;
51
+ /**
52
+ * Array of model canonical_slugs (immutable identifiers)
53
+ */
54
+ allowedModels?: Array<string> | null | undefined;
55
+ /**
56
+ * Whether to enforce zero data retention
57
+ */
58
+ enforceZdr?: boolean | null | undefined;
59
+ /**
60
+ * ISO 8601 timestamp of when the guardrail was created
61
+ */
62
+ createdAt: string;
63
+ /**
64
+ * ISO 8601 timestamp of when the guardrail was last updated
65
+ */
66
+ updatedAt?: string | null | undefined;
67
+ };
68
+ /**
69
+ * Guardrail details
70
+ */
71
+ export type GetGuardrailResponse = {
72
+ /**
73
+ * The guardrail
74
+ */
75
+ data: GetGuardrailData;
76
+ };
77
+ /** @internal */
78
+ export type GetGuardrailRequest$Outbound = {
79
+ id: string;
80
+ };
81
+ /** @internal */
82
+ export declare const GetGuardrailRequest$outboundSchema: z.ZodType<GetGuardrailRequest$Outbound, GetGuardrailRequest>;
83
+ export declare function getGuardrailRequestToJSON(getGuardrailRequest: GetGuardrailRequest): string;
84
+ /** @internal */
85
+ export declare const GetGuardrailResetInterval$inboundSchema: z.ZodType<GetGuardrailResetInterval, unknown>;
86
+ /** @internal */
87
+ export declare const GetGuardrailData$inboundSchema: z.ZodType<GetGuardrailData, unknown>;
88
+ export declare function getGuardrailDataFromJSON(jsonString: string): SafeParseResult<GetGuardrailData, SDKValidationError>;
89
+ /** @internal */
90
+ export declare const GetGuardrailResponse$inboundSchema: z.ZodType<GetGuardrailResponse, unknown>;
91
+ export declare function getGuardrailResponseFromJSON(jsonString: string): SafeParseResult<GetGuardrailResponse, SDKValidationError>;
92
+ //# sourceMappingURL=getguardrail.d.ts.map
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5a16015b4d1f
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ /**
10
+ * Interval at which the limit resets (daily, weekly, monthly)
11
+ */
12
+ export const GetGuardrailResetInterval = {
13
+ Daily: "daily",
14
+ Weekly: "weekly",
15
+ Monthly: "monthly",
16
+ };
17
+ /** @internal */
18
+ export const GetGuardrailRequest$outboundSchema = z.object({
19
+ id: z.string(),
20
+ });
21
+ export function getGuardrailRequestToJSON(getGuardrailRequest) {
22
+ return JSON.stringify(GetGuardrailRequest$outboundSchema.parse(getGuardrailRequest));
23
+ }
24
+ /** @internal */
25
+ export const GetGuardrailResetInterval$inboundSchema = openEnums.inboundSchema(GetGuardrailResetInterval);
26
+ /** @internal */
27
+ export const GetGuardrailData$inboundSchema = z.object({
28
+ id: z.string(),
29
+ name: z.string(),
30
+ description: z.nullable(z.string()).optional(),
31
+ limit_usd: z.nullable(z.number()).optional(),
32
+ reset_interval: z.nullable(GetGuardrailResetInterval$inboundSchema)
33
+ .optional(),
34
+ allowed_providers: z.nullable(z.array(z.string())).optional(),
35
+ allowed_models: z.nullable(z.array(z.string())).optional(),
36
+ enforce_zdr: z.nullable(z.boolean()).optional(),
37
+ created_at: z.string(),
38
+ updated_at: z.nullable(z.string()).optional(),
39
+ }).transform((v) => {
40
+ return remap$(v, {
41
+ "limit_usd": "limitUsd",
42
+ "reset_interval": "resetInterval",
43
+ "allowed_providers": "allowedProviders",
44
+ "allowed_models": "allowedModels",
45
+ "enforce_zdr": "enforceZdr",
46
+ "created_at": "createdAt",
47
+ "updated_at": "updatedAt",
48
+ });
49
+ });
50
+ export function getGuardrailDataFromJSON(jsonString) {
51
+ return safeParse(jsonString, (x) => GetGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetGuardrailData' from JSON`);
52
+ }
53
+ /** @internal */
54
+ export const GetGuardrailResponse$inboundSchema = z.object({
55
+ data: z.lazy(() => GetGuardrailData$inboundSchema),
56
+ });
57
+ export function getGuardrailResponseFromJSON(jsonString) {
58
+ return safeParse(jsonString, (x) => GetGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetGuardrailResponse' from JSON`);
59
+ }
60
+ //# sourceMappingURL=getguardrail.js.map
@@ -1,9 +1,36 @@
1
1
  import * as z from "zod/v4";
2
+ import { OpenEnum } from "../../types/enums.js";
3
+ /**
4
+ * Filter models by use case category
5
+ */
6
+ export declare const Category: {
7
+ readonly Programming: "programming";
8
+ readonly Roleplay: "roleplay";
9
+ readonly Marketing: "marketing";
10
+ readonly MarketingSeo: "marketing/seo";
11
+ readonly Technology: "technology";
12
+ readonly Science: "science";
13
+ readonly Translation: "translation";
14
+ readonly Legal: "legal";
15
+ readonly Finance: "finance";
16
+ readonly Health: "health";
17
+ readonly Trivia: "trivia";
18
+ readonly Academia: "academia";
19
+ };
20
+ /**
21
+ * Filter models by use case category
22
+ */
23
+ export type Category = OpenEnum<typeof Category>;
2
24
  export type GetModelsRequest = {
3
- category?: string | undefined;
25
+ /**
26
+ * Filter models by use case category
27
+ */
28
+ category?: Category | undefined;
4
29
  supportedParameters?: string | undefined;
5
30
  };
6
31
  /** @internal */
32
+ export declare const Category$outboundSchema: z.ZodType<string, Category>;
33
+ /** @internal */
7
34
  export type GetModelsRequest$Outbound = {
8
35
  category?: string | undefined;
9
36
  supported_parameters?: string | undefined;
@@ -4,9 +4,30 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as openEnums from "../../types/enums.js";
8
+ /**
9
+ * Filter models by use case category
10
+ */
11
+ export const Category = {
12
+ Programming: "programming",
13
+ Roleplay: "roleplay",
14
+ Marketing: "marketing",
15
+ MarketingSeo: "marketing/seo",
16
+ Technology: "technology",
17
+ Science: "science",
18
+ Translation: "translation",
19
+ Legal: "legal",
20
+ Finance: "finance",
21
+ Health: "health",
22
+ Trivia: "trivia",
23
+ Academia: "academia",
24
+ };
25
+ /** @internal */
26
+ export const Category$outboundSchema = openEnums
27
+ .outboundSchema(Category);
7
28
  /** @internal */
8
29
  export const GetModelsRequest$outboundSchema = z.object({
9
- category: z.string().optional(),
30
+ category: Category$outboundSchema.optional(),
10
31
  supportedParameters: z.string().optional(),
11
32
  }).transform((v) => {
12
33
  return remap$(v, {
@@ -1,22 +1,34 @@
1
+ export * from "./bulkassignkeystoguardrail.js";
2
+ export * from "./bulkassignmemberstoguardrail.js";
3
+ export * from "./bulkunassignkeysfromguardrail.js";
4
+ export * from "./bulkunassignmembersfromguardrail.js";
1
5
  export * from "./createauthkeyscode.js";
2
6
  export * from "./createcoinbasecharge.js";
3
7
  export * from "./createembeddings.js";
8
+ export * from "./createguardrail.js";
4
9
  export * from "./createkeys.js";
5
10
  export * from "./createresponses.js";
11
+ export * from "./deleteguardrail.js";
6
12
  export * from "./deletekeys.js";
7
13
  export * from "./exchangeauthcodeforapikey.js";
8
14
  export * from "./getcredits.js";
9
15
  export * from "./getcurrentkey.js";
10
16
  export * from "./getgeneration.js";
17
+ export * from "./getguardrail.js";
11
18
  export * from "./getkey.js";
12
19
  export * from "./getmodels.js";
13
- export * from "./getparameters.js";
14
20
  export * from "./getuseractivity.js";
15
21
  export * from "./list.js";
16
22
  export * from "./listendpoints.js";
17
23
  export * from "./listendpointszdr.js";
24
+ export * from "./listguardrailkeyassignments.js";
25
+ export * from "./listguardrailmemberassignments.js";
26
+ export * from "./listguardrails.js";
27
+ export * from "./listkeyassignments.js";
28
+ export * from "./listmemberassignments.js";
18
29
  export * from "./listmodelsuser.js";
19
30
  export * from "./listproviders.js";
20
31
  export * from "./sendchatcompletionrequest.js";
32
+ export * from "./updateguardrail.js";
21
33
  export * from "./updatekeys.js";
22
34
  //# sourceMappingURL=index.d.ts.map
@@ -2,25 +2,37 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  * @generated-id: 0d9ffaf774d2
4
4
  */
5
+ export * from "./bulkassignkeystoguardrail.js";
6
+ export * from "./bulkassignmemberstoguardrail.js";
7
+ export * from "./bulkunassignkeysfromguardrail.js";
8
+ export * from "./bulkunassignmembersfromguardrail.js";
5
9
  export * from "./createauthkeyscode.js";
6
10
  export * from "./createcoinbasecharge.js";
7
11
  export * from "./createembeddings.js";
12
+ export * from "./createguardrail.js";
8
13
  export * from "./createkeys.js";
9
14
  export * from "./createresponses.js";
15
+ export * from "./deleteguardrail.js";
10
16
  export * from "./deletekeys.js";
11
17
  export * from "./exchangeauthcodeforapikey.js";
12
18
  export * from "./getcredits.js";
13
19
  export * from "./getcurrentkey.js";
14
20
  export * from "./getgeneration.js";
21
+ export * from "./getguardrail.js";
15
22
  export * from "./getkey.js";
16
23
  export * from "./getmodels.js";
17
- export * from "./getparameters.js";
18
24
  export * from "./getuseractivity.js";
19
25
  export * from "./list.js";
20
26
  export * from "./listendpoints.js";
21
27
  export * from "./listendpointszdr.js";
28
+ export * from "./listguardrailkeyassignments.js";
29
+ export * from "./listguardrailmemberassignments.js";
30
+ export * from "./listguardrails.js";
31
+ export * from "./listkeyassignments.js";
32
+ export * from "./listmemberassignments.js";
22
33
  export * from "./listmodelsuser.js";
23
34
  export * from "./listproviders.js";
24
35
  export * from "./sendchatcompletionrequest.js";
36
+ export * from "./updateguardrail.js";
25
37
  export * from "./updatekeys.js";
26
38
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,76 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ export type ListGuardrailKeyAssignmentsRequest = {
5
+ /**
6
+ * The unique identifier of the guardrail
7
+ */
8
+ id: string;
9
+ /**
10
+ * Number of records to skip for pagination
11
+ */
12
+ offset?: string | undefined;
13
+ /**
14
+ * Maximum number of records to return (max 100)
15
+ */
16
+ limit?: string | undefined;
17
+ };
18
+ export type ListGuardrailKeyAssignmentsData = {
19
+ /**
20
+ * Unique identifier for the assignment
21
+ */
22
+ id: string;
23
+ /**
24
+ * Hash of the assigned API key
25
+ */
26
+ keyHash: string;
27
+ /**
28
+ * ID of the guardrail
29
+ */
30
+ guardrailId: string;
31
+ /**
32
+ * Name of the API key
33
+ */
34
+ keyName: string;
35
+ /**
36
+ * Label of the API key
37
+ */
38
+ keyLabel: string;
39
+ /**
40
+ * User ID of who made the assignment
41
+ */
42
+ assignedBy: string | null;
43
+ /**
44
+ * ISO 8601 timestamp of when the assignment was created
45
+ */
46
+ createdAt: string;
47
+ };
48
+ /**
49
+ * List of key assignments
50
+ */
51
+ export type ListGuardrailKeyAssignmentsResponse = {
52
+ /**
53
+ * List of key assignments
54
+ */
55
+ data: Array<ListGuardrailKeyAssignmentsData>;
56
+ /**
57
+ * Total number of key assignments for this guardrail
58
+ */
59
+ totalCount: number;
60
+ };
61
+ /** @internal */
62
+ export type ListGuardrailKeyAssignmentsRequest$Outbound = {
63
+ id: string;
64
+ offset?: string | undefined;
65
+ limit?: string | undefined;
66
+ };
67
+ /** @internal */
68
+ export declare const ListGuardrailKeyAssignmentsRequest$outboundSchema: z.ZodType<ListGuardrailKeyAssignmentsRequest$Outbound, ListGuardrailKeyAssignmentsRequest>;
69
+ export declare function listGuardrailKeyAssignmentsRequestToJSON(listGuardrailKeyAssignmentsRequest: ListGuardrailKeyAssignmentsRequest): string;
70
+ /** @internal */
71
+ export declare const ListGuardrailKeyAssignmentsData$inboundSchema: z.ZodType<ListGuardrailKeyAssignmentsData, unknown>;
72
+ export declare function listGuardrailKeyAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailKeyAssignmentsData, SDKValidationError>;
73
+ /** @internal */
74
+ export declare const ListGuardrailKeyAssignmentsResponse$inboundSchema: z.ZodType<ListGuardrailKeyAssignmentsResponse, unknown>;
75
+ export declare function listGuardrailKeyAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailKeyAssignmentsResponse, SDKValidationError>;
76
+ //# sourceMappingURL=listguardrailkeyassignments.d.ts.map
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e616af13fd7a
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ /** @internal */
9
+ export const ListGuardrailKeyAssignmentsRequest$outboundSchema = z.object({
10
+ id: z.string(),
11
+ offset: z.string().optional(),
12
+ limit: z.string().optional(),
13
+ });
14
+ export function listGuardrailKeyAssignmentsRequestToJSON(listGuardrailKeyAssignmentsRequest) {
15
+ return JSON.stringify(ListGuardrailKeyAssignmentsRequest$outboundSchema.parse(listGuardrailKeyAssignmentsRequest));
16
+ }
17
+ /** @internal */
18
+ export const ListGuardrailKeyAssignmentsData$inboundSchema = z.object({
19
+ id: z.string(),
20
+ key_hash: z.string(),
21
+ guardrail_id: z.string(),
22
+ key_name: z.string(),
23
+ key_label: z.string(),
24
+ assigned_by: z.nullable(z.string()),
25
+ created_at: z.string(),
26
+ }).transform((v) => {
27
+ return remap$(v, {
28
+ "key_hash": "keyHash",
29
+ "guardrail_id": "guardrailId",
30
+ "key_name": "keyName",
31
+ "key_label": "keyLabel",
32
+ "assigned_by": "assignedBy",
33
+ "created_at": "createdAt",
34
+ });
35
+ });
36
+ export function listGuardrailKeyAssignmentsDataFromJSON(jsonString) {
37
+ return safeParse(jsonString, (x) => ListGuardrailKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailKeyAssignmentsData' from JSON`);
38
+ }
39
+ /** @internal */
40
+ export const ListGuardrailKeyAssignmentsResponse$inboundSchema = z.object({
41
+ data: z.array(z.lazy(() => ListGuardrailKeyAssignmentsData$inboundSchema)),
42
+ total_count: z.number(),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ "total_count": "totalCount",
46
+ });
47
+ });
48
+ export function listGuardrailKeyAssignmentsResponseFromJSON(jsonString) {
49
+ return safeParse(jsonString, (x) => ListGuardrailKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailKeyAssignmentsResponse' from JSON`);
50
+ }
51
+ //# sourceMappingURL=listguardrailkeyassignments.js.map
@@ -0,0 +1,72 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ export type ListGuardrailMemberAssignmentsRequest = {
5
+ /**
6
+ * The unique identifier of the guardrail
7
+ */
8
+ id: string;
9
+ /**
10
+ * Number of records to skip for pagination
11
+ */
12
+ offset?: string | undefined;
13
+ /**
14
+ * Maximum number of records to return (max 100)
15
+ */
16
+ limit?: string | undefined;
17
+ };
18
+ export type ListGuardrailMemberAssignmentsData = {
19
+ /**
20
+ * Unique identifier for the assignment
21
+ */
22
+ id: string;
23
+ /**
24
+ * Clerk user ID of the assigned member
25
+ */
26
+ userId: string;
27
+ /**
28
+ * Organization ID
29
+ */
30
+ organizationId: string;
31
+ /**
32
+ * ID of the guardrail
33
+ */
34
+ guardrailId: string;
35
+ /**
36
+ * User ID of who made the assignment
37
+ */
38
+ assignedBy: string | null;
39
+ /**
40
+ * ISO 8601 timestamp of when the assignment was created
41
+ */
42
+ createdAt: string;
43
+ };
44
+ /**
45
+ * List of member assignments
46
+ */
47
+ export type ListGuardrailMemberAssignmentsResponse = {
48
+ /**
49
+ * List of member assignments
50
+ */
51
+ data: Array<ListGuardrailMemberAssignmentsData>;
52
+ /**
53
+ * Total number of member assignments
54
+ */
55
+ totalCount: number;
56
+ };
57
+ /** @internal */
58
+ export type ListGuardrailMemberAssignmentsRequest$Outbound = {
59
+ id: string;
60
+ offset?: string | undefined;
61
+ limit?: string | undefined;
62
+ };
63
+ /** @internal */
64
+ export declare const ListGuardrailMemberAssignmentsRequest$outboundSchema: z.ZodType<ListGuardrailMemberAssignmentsRequest$Outbound, ListGuardrailMemberAssignmentsRequest>;
65
+ export declare function listGuardrailMemberAssignmentsRequestToJSON(listGuardrailMemberAssignmentsRequest: ListGuardrailMemberAssignmentsRequest): string;
66
+ /** @internal */
67
+ export declare const ListGuardrailMemberAssignmentsData$inboundSchema: z.ZodType<ListGuardrailMemberAssignmentsData, unknown>;
68
+ export declare function listGuardrailMemberAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailMemberAssignmentsData, SDKValidationError>;
69
+ /** @internal */
70
+ export declare const ListGuardrailMemberAssignmentsResponse$inboundSchema: z.ZodType<ListGuardrailMemberAssignmentsResponse, unknown>;
71
+ export declare function listGuardrailMemberAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailMemberAssignmentsResponse, SDKValidationError>;
72
+ //# sourceMappingURL=listguardrailmemberassignments.d.ts.map