@openrouter/sdk 0.3.14 → 0.3.16

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 (136) 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/async-params.d.ts +46 -6
  45. package/esm/lib/async-params.js +10 -2
  46. package/esm/lib/config.d.ts +2 -4
  47. package/esm/lib/config.js +2 -2
  48. package/esm/lib/conversation-state.d.ts +61 -0
  49. package/esm/lib/conversation-state.js +207 -0
  50. package/esm/lib/model-result.d.ts +179 -4
  51. package/esm/lib/model-result.js +719 -191
  52. package/esm/lib/tool-executor.js +37 -13
  53. package/esm/lib/tool-types.d.ts +135 -2
  54. package/esm/lib/tool-types.js +19 -0
  55. package/esm/lib/tool.d.ts +21 -1
  56. package/esm/lib/tool.js +7 -0
  57. package/esm/models/assistantmessage.d.ts +31 -0
  58. package/esm/models/assistantmessage.js +43 -0
  59. package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
  60. package/esm/models/chatmessagecontentitemimage.js +8 -9
  61. package/esm/models/chatresponsechoice.d.ts +0 -2
  62. package/esm/models/chatresponsechoice.js +0 -3
  63. package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
  64. package/esm/models/chatstreamingmessagechunk.js +2 -2
  65. package/esm/models/index.d.ts +1 -1
  66. package/esm/models/index.js +1 -1
  67. package/esm/models/model.d.ts +4 -0
  68. package/esm/models/model.js +2 -0
  69. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
  70. package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
  71. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
  72. package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
  73. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
  74. package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
  75. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
  76. package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
  77. package/esm/models/operations/createguardrail.d.ts +136 -0
  78. package/esm/models/operations/createguardrail.js +85 -0
  79. package/esm/models/operations/deleteguardrail.d.ts +29 -0
  80. package/esm/models/operations/deleteguardrail.js +21 -0
  81. package/esm/models/operations/getguardrail.d.ts +92 -0
  82. package/esm/models/operations/getguardrail.js +60 -0
  83. package/esm/models/operations/getmodels.d.ts +28 -1
  84. package/esm/models/operations/getmodels.js +22 -1
  85. package/esm/models/operations/index.d.ts +13 -1
  86. package/esm/models/operations/index.js +13 -1
  87. package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
  88. package/esm/models/operations/listguardrailkeyassignments.js +51 -0
  89. package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
  90. package/esm/models/operations/listguardrailmemberassignments.js +49 -0
  91. package/esm/models/operations/listguardrails.d.ts +98 -0
  92. package/esm/models/operations/listguardrails.js +66 -0
  93. package/esm/models/operations/listkeyassignments.d.ts +71 -0
  94. package/esm/models/operations/listkeyassignments.js +50 -0
  95. package/esm/models/operations/listmemberassignments.d.ts +67 -0
  96. package/esm/models/operations/listmemberassignments.js +48 -0
  97. package/esm/models/operations/updateguardrail.d.ts +151 -0
  98. package/esm/models/operations/updateguardrail.js +97 -0
  99. package/esm/models/outputmodality.d.ts +1 -0
  100. package/esm/models/outputmodality.js +1 -0
  101. package/esm/models/percentilelatencycutoffs.js +1 -1
  102. package/esm/models/percentilestats.js +1 -1
  103. package/esm/models/percentilethroughputcutoffs.js +1 -1
  104. package/esm/models/preferredmaxlatency.js +1 -1
  105. package/esm/models/preferredminthroughput.js +1 -1
  106. package/esm/models/publicendpoint.d.ts +8 -0
  107. package/esm/models/publicendpoint.js +4 -0
  108. package/esm/models/publicpricing.d.ts +4 -0
  109. package/esm/models/publicpricing.js +2 -0
  110. package/esm/models/responseinputvideo.js +1 -1
  111. package/esm/models/responsesoutputmodality.js +1 -1
  112. package/esm/models/schema2.d.ts +92 -0
  113. package/esm/models/schema2.js +109 -0
  114. package/esm/sdk/analytics.d.ts +1 -1
  115. package/esm/sdk/analytics.js +1 -1
  116. package/esm/sdk/apikeys.d.ts +15 -0
  117. package/esm/sdk/apikeys.js +15 -0
  118. package/esm/sdk/credits.d.ts +1 -1
  119. package/esm/sdk/credits.js +1 -1
  120. package/esm/sdk/guardrails.d.ts +96 -0
  121. package/esm/sdk/guardrails.js +139 -0
  122. package/esm/sdk/sdk.d.ts +3 -3
  123. package/esm/sdk/sdk.js +4 -4
  124. package/esm/types/index.d.ts +2 -0
  125. package/esm/types/index.js +1 -0
  126. package/esm/types/models.d.ts +25 -0
  127. package/esm/types/models.js +10 -0
  128. package/jsr.json +1 -1
  129. package/package.json +12 -10
  130. package/scripts/check-types.js +127 -0
  131. package/esm/models/operations/getparameters.d.ts +0 -87
  132. package/esm/models/operations/getparameters.js +0 -73
  133. package/esm/models/schema3.d.ts +0 -51
  134. package/esm/models/schema3.js +0 -62
  135. package/esm/sdk/parameters.d.ts +0 -9
  136. package/esm/sdk/parameters.js +0 -16
@@ -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
@@ -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
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 37ee24c57c33
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 ListGuardrailMemberAssignmentsRequest$outboundSchema = z.object({
10
+ id: z.string(),
11
+ offset: z.string().optional(),
12
+ limit: z.string().optional(),
13
+ });
14
+ export function listGuardrailMemberAssignmentsRequestToJSON(listGuardrailMemberAssignmentsRequest) {
15
+ return JSON.stringify(ListGuardrailMemberAssignmentsRequest$outboundSchema.parse(listGuardrailMemberAssignmentsRequest));
16
+ }
17
+ /** @internal */
18
+ export const ListGuardrailMemberAssignmentsData$inboundSchema = z.object({
19
+ id: z.string(),
20
+ user_id: z.string(),
21
+ organization_id: z.string(),
22
+ guardrail_id: z.string(),
23
+ assigned_by: z.nullable(z.string()),
24
+ created_at: z.string(),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "user_id": "userId",
28
+ "organization_id": "organizationId",
29
+ "guardrail_id": "guardrailId",
30
+ "assigned_by": "assignedBy",
31
+ "created_at": "createdAt",
32
+ });
33
+ });
34
+ export function listGuardrailMemberAssignmentsDataFromJSON(jsonString) {
35
+ return safeParse(jsonString, (x) => ListGuardrailMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailMemberAssignmentsData' from JSON`);
36
+ }
37
+ /** @internal */
38
+ export const ListGuardrailMemberAssignmentsResponse$inboundSchema = z.object({
39
+ data: z.array(z.lazy(() => ListGuardrailMemberAssignmentsData$inboundSchema)),
40
+ total_count: z.number(),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "total_count": "totalCount",
44
+ });
45
+ });
46
+ export function listGuardrailMemberAssignmentsResponseFromJSON(jsonString) {
47
+ return safeParse(jsonString, (x) => ListGuardrailMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailMemberAssignmentsResponse' from JSON`);
48
+ }
49
+ //# sourceMappingURL=listguardrailmemberassignments.js.map
@@ -0,0 +1,98 @@
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 ListGuardrailsRequest = {
6
+ /**
7
+ * Number of records to skip for pagination
8
+ */
9
+ offset?: string | undefined;
10
+ /**
11
+ * Maximum number of records to return (max 100)
12
+ */
13
+ limit?: string | undefined;
14
+ };
15
+ /**
16
+ * Interval at which the limit resets (daily, weekly, monthly)
17
+ */
18
+ export declare const ListGuardrailsResetInterval: {
19
+ readonly Daily: "daily";
20
+ readonly Weekly: "weekly";
21
+ readonly Monthly: "monthly";
22
+ };
23
+ /**
24
+ * Interval at which the limit resets (daily, weekly, monthly)
25
+ */
26
+ export type ListGuardrailsResetInterval = OpenEnum<typeof ListGuardrailsResetInterval>;
27
+ export type ListGuardrailsData = {
28
+ /**
29
+ * Unique identifier for the guardrail
30
+ */
31
+ id: string;
32
+ /**
33
+ * Name of the guardrail
34
+ */
35
+ name: string;
36
+ /**
37
+ * Description of the guardrail
38
+ */
39
+ description?: string | null | undefined;
40
+ /**
41
+ * Spending limit in USD
42
+ */
43
+ limitUsd?: number | null | undefined;
44
+ /**
45
+ * Interval at which the limit resets (daily, weekly, monthly)
46
+ */
47
+ resetInterval?: ListGuardrailsResetInterval | null | undefined;
48
+ /**
49
+ * List of allowed provider IDs
50
+ */
51
+ allowedProviders?: Array<string> | null | undefined;
52
+ /**
53
+ * Array of model canonical_slugs (immutable identifiers)
54
+ */
55
+ allowedModels?: Array<string> | null | undefined;
56
+ /**
57
+ * Whether to enforce zero data retention
58
+ */
59
+ enforceZdr?: boolean | null | undefined;
60
+ /**
61
+ * ISO 8601 timestamp of when the guardrail was created
62
+ */
63
+ createdAt: string;
64
+ /**
65
+ * ISO 8601 timestamp of when the guardrail was last updated
66
+ */
67
+ updatedAt?: string | null | undefined;
68
+ };
69
+ /**
70
+ * List of guardrails
71
+ */
72
+ export type ListGuardrailsResponse = {
73
+ /**
74
+ * List of guardrails
75
+ */
76
+ data: Array<ListGuardrailsData>;
77
+ /**
78
+ * Total number of guardrails
79
+ */
80
+ totalCount: number;
81
+ };
82
+ /** @internal */
83
+ export type ListGuardrailsRequest$Outbound = {
84
+ offset?: string | undefined;
85
+ limit?: string | undefined;
86
+ };
87
+ /** @internal */
88
+ export declare const ListGuardrailsRequest$outboundSchema: z.ZodType<ListGuardrailsRequest$Outbound, ListGuardrailsRequest>;
89
+ export declare function listGuardrailsRequestToJSON(listGuardrailsRequest: ListGuardrailsRequest): string;
90
+ /** @internal */
91
+ export declare const ListGuardrailsResetInterval$inboundSchema: z.ZodType<ListGuardrailsResetInterval, unknown>;
92
+ /** @internal */
93
+ export declare const ListGuardrailsData$inboundSchema: z.ZodType<ListGuardrailsData, unknown>;
94
+ export declare function listGuardrailsDataFromJSON(jsonString: string): SafeParseResult<ListGuardrailsData, SDKValidationError>;
95
+ /** @internal */
96
+ export declare const ListGuardrailsResponse$inboundSchema: z.ZodType<ListGuardrailsResponse, unknown>;
97
+ export declare function listGuardrailsResponseFromJSON(jsonString: string): SafeParseResult<ListGuardrailsResponse, SDKValidationError>;
98
+ //# sourceMappingURL=listguardrails.d.ts.map