@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,66 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4c71cf4db173
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 ListGuardrailsResetInterval = {
13
+ Daily: "daily",
14
+ Weekly: "weekly",
15
+ Monthly: "monthly",
16
+ };
17
+ /** @internal */
18
+ export const ListGuardrailsRequest$outboundSchema = z.object({
19
+ offset: z.string().optional(),
20
+ limit: z.string().optional(),
21
+ });
22
+ export function listGuardrailsRequestToJSON(listGuardrailsRequest) {
23
+ return JSON.stringify(ListGuardrailsRequest$outboundSchema.parse(listGuardrailsRequest));
24
+ }
25
+ /** @internal */
26
+ export const ListGuardrailsResetInterval$inboundSchema = openEnums.inboundSchema(ListGuardrailsResetInterval);
27
+ /** @internal */
28
+ export const ListGuardrailsData$inboundSchema = z.object({
29
+ id: z.string(),
30
+ name: z.string(),
31
+ description: z.nullable(z.string()).optional(),
32
+ limit_usd: z.nullable(z.number()).optional(),
33
+ reset_interval: z.nullable(ListGuardrailsResetInterval$inboundSchema)
34
+ .optional(),
35
+ allowed_providers: z.nullable(z.array(z.string())).optional(),
36
+ allowed_models: z.nullable(z.array(z.string())).optional(),
37
+ enforce_zdr: z.nullable(z.boolean()).optional(),
38
+ created_at: z.string(),
39
+ updated_at: z.nullable(z.string()).optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "limit_usd": "limitUsd",
43
+ "reset_interval": "resetInterval",
44
+ "allowed_providers": "allowedProviders",
45
+ "allowed_models": "allowedModels",
46
+ "enforce_zdr": "enforceZdr",
47
+ "created_at": "createdAt",
48
+ "updated_at": "updatedAt",
49
+ });
50
+ });
51
+ export function listGuardrailsDataFromJSON(jsonString) {
52
+ return safeParse(jsonString, (x) => ListGuardrailsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailsData' from JSON`);
53
+ }
54
+ /** @internal */
55
+ export const ListGuardrailsResponse$inboundSchema = z.object({
56
+ data: z.array(z.lazy(() => ListGuardrailsData$inboundSchema)),
57
+ total_count: z.number(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ "total_count": "totalCount",
61
+ });
62
+ });
63
+ export function listGuardrailsResponseFromJSON(jsonString) {
64
+ return safeParse(jsonString, (x) => ListGuardrailsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListGuardrailsResponse' from JSON`);
65
+ }
66
+ //# sourceMappingURL=listguardrails.js.map
@@ -0,0 +1,71 @@
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 ListKeyAssignmentsRequest = {
5
+ /**
6
+ * Number of records to skip for pagination
7
+ */
8
+ offset?: string | undefined;
9
+ /**
10
+ * Maximum number of records to return (max 100)
11
+ */
12
+ limit?: string | undefined;
13
+ };
14
+ export type ListKeyAssignmentsData = {
15
+ /**
16
+ * Unique identifier for the assignment
17
+ */
18
+ id: string;
19
+ /**
20
+ * Hash of the assigned API key
21
+ */
22
+ keyHash: string;
23
+ /**
24
+ * ID of the guardrail
25
+ */
26
+ guardrailId: string;
27
+ /**
28
+ * Name of the API key
29
+ */
30
+ keyName: string;
31
+ /**
32
+ * Label of the API key
33
+ */
34
+ keyLabel: 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 key assignments
46
+ */
47
+ export type ListKeyAssignmentsResponse = {
48
+ /**
49
+ * List of key assignments
50
+ */
51
+ data: Array<ListKeyAssignmentsData>;
52
+ /**
53
+ * Total number of key assignments for this guardrail
54
+ */
55
+ totalCount: number;
56
+ };
57
+ /** @internal */
58
+ export type ListKeyAssignmentsRequest$Outbound = {
59
+ offset?: string | undefined;
60
+ limit?: string | undefined;
61
+ };
62
+ /** @internal */
63
+ export declare const ListKeyAssignmentsRequest$outboundSchema: z.ZodType<ListKeyAssignmentsRequest$Outbound, ListKeyAssignmentsRequest>;
64
+ export declare function listKeyAssignmentsRequestToJSON(listKeyAssignmentsRequest: ListKeyAssignmentsRequest): string;
65
+ /** @internal */
66
+ export declare const ListKeyAssignmentsData$inboundSchema: z.ZodType<ListKeyAssignmentsData, unknown>;
67
+ export declare function listKeyAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListKeyAssignmentsData, SDKValidationError>;
68
+ /** @internal */
69
+ export declare const ListKeyAssignmentsResponse$inboundSchema: z.ZodType<ListKeyAssignmentsResponse, unknown>;
70
+ export declare function listKeyAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListKeyAssignmentsResponse, SDKValidationError>;
71
+ //# sourceMappingURL=listkeyassignments.d.ts.map
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c4b0c0303428
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 ListKeyAssignmentsRequest$outboundSchema = z.object({
10
+ offset: z.string().optional(),
11
+ limit: z.string().optional(),
12
+ });
13
+ export function listKeyAssignmentsRequestToJSON(listKeyAssignmentsRequest) {
14
+ return JSON.stringify(ListKeyAssignmentsRequest$outboundSchema.parse(listKeyAssignmentsRequest));
15
+ }
16
+ /** @internal */
17
+ export const ListKeyAssignmentsData$inboundSchema = z.object({
18
+ id: z.string(),
19
+ key_hash: z.string(),
20
+ guardrail_id: z.string(),
21
+ key_name: z.string(),
22
+ key_label: z.string(),
23
+ assigned_by: z.nullable(z.string()),
24
+ created_at: z.string(),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "key_hash": "keyHash",
28
+ "guardrail_id": "guardrailId",
29
+ "key_name": "keyName",
30
+ "key_label": "keyLabel",
31
+ "assigned_by": "assignedBy",
32
+ "created_at": "createdAt",
33
+ });
34
+ });
35
+ export function listKeyAssignmentsDataFromJSON(jsonString) {
36
+ return safeParse(jsonString, (x) => ListKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKeyAssignmentsData' from JSON`);
37
+ }
38
+ /** @internal */
39
+ export const ListKeyAssignmentsResponse$inboundSchema = z.object({
40
+ data: z.array(z.lazy(() => ListKeyAssignmentsData$inboundSchema)),
41
+ total_count: z.number(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ "total_count": "totalCount",
45
+ });
46
+ });
47
+ export function listKeyAssignmentsResponseFromJSON(jsonString) {
48
+ return safeParse(jsonString, (x) => ListKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKeyAssignmentsResponse' from JSON`);
49
+ }
50
+ //# sourceMappingURL=listkeyassignments.js.map
@@ -0,0 +1,67 @@
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 ListMemberAssignmentsRequest = {
5
+ /**
6
+ * Number of records to skip for pagination
7
+ */
8
+ offset?: string | undefined;
9
+ /**
10
+ * Maximum number of records to return (max 100)
11
+ */
12
+ limit?: string | undefined;
13
+ };
14
+ export type ListMemberAssignmentsData = {
15
+ /**
16
+ * Unique identifier for the assignment
17
+ */
18
+ id: string;
19
+ /**
20
+ * Clerk user ID of the assigned member
21
+ */
22
+ userId: string;
23
+ /**
24
+ * Organization ID
25
+ */
26
+ organizationId: string;
27
+ /**
28
+ * ID of the guardrail
29
+ */
30
+ guardrailId: string;
31
+ /**
32
+ * User ID of who made the assignment
33
+ */
34
+ assignedBy: string | null;
35
+ /**
36
+ * ISO 8601 timestamp of when the assignment was created
37
+ */
38
+ createdAt: string;
39
+ };
40
+ /**
41
+ * List of member assignments
42
+ */
43
+ export type ListMemberAssignmentsResponse = {
44
+ /**
45
+ * List of member assignments
46
+ */
47
+ data: Array<ListMemberAssignmentsData>;
48
+ /**
49
+ * Total number of member assignments
50
+ */
51
+ totalCount: number;
52
+ };
53
+ /** @internal */
54
+ export type ListMemberAssignmentsRequest$Outbound = {
55
+ offset?: string | undefined;
56
+ limit?: string | undefined;
57
+ };
58
+ /** @internal */
59
+ export declare const ListMemberAssignmentsRequest$outboundSchema: z.ZodType<ListMemberAssignmentsRequest$Outbound, ListMemberAssignmentsRequest>;
60
+ export declare function listMemberAssignmentsRequestToJSON(listMemberAssignmentsRequest: ListMemberAssignmentsRequest): string;
61
+ /** @internal */
62
+ export declare const ListMemberAssignmentsData$inboundSchema: z.ZodType<ListMemberAssignmentsData, unknown>;
63
+ export declare function listMemberAssignmentsDataFromJSON(jsonString: string): SafeParseResult<ListMemberAssignmentsData, SDKValidationError>;
64
+ /** @internal */
65
+ export declare const ListMemberAssignmentsResponse$inboundSchema: z.ZodType<ListMemberAssignmentsResponse, unknown>;
66
+ export declare function listMemberAssignmentsResponseFromJSON(jsonString: string): SafeParseResult<ListMemberAssignmentsResponse, SDKValidationError>;
67
+ //# sourceMappingURL=listmemberassignments.d.ts.map
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7d02937e1a11
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 ListMemberAssignmentsRequest$outboundSchema = z.object({
10
+ offset: z.string().optional(),
11
+ limit: z.string().optional(),
12
+ });
13
+ export function listMemberAssignmentsRequestToJSON(listMemberAssignmentsRequest) {
14
+ return JSON.stringify(ListMemberAssignmentsRequest$outboundSchema.parse(listMemberAssignmentsRequest));
15
+ }
16
+ /** @internal */
17
+ export const ListMemberAssignmentsData$inboundSchema = z.object({
18
+ id: z.string(),
19
+ user_id: z.string(),
20
+ organization_id: z.string(),
21
+ guardrail_id: z.string(),
22
+ assigned_by: z.nullable(z.string()),
23
+ created_at: z.string(),
24
+ }).transform((v) => {
25
+ return remap$(v, {
26
+ "user_id": "userId",
27
+ "organization_id": "organizationId",
28
+ "guardrail_id": "guardrailId",
29
+ "assigned_by": "assignedBy",
30
+ "created_at": "createdAt",
31
+ });
32
+ });
33
+ export function listMemberAssignmentsDataFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => ListMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListMemberAssignmentsData' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const ListMemberAssignmentsResponse$inboundSchema = z.object({
38
+ data: z.array(z.lazy(() => ListMemberAssignmentsData$inboundSchema)),
39
+ total_count: z.number(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "total_count": "totalCount",
43
+ });
44
+ });
45
+ export function listMemberAssignmentsResponseFromJSON(jsonString) {
46
+ return safeParse(jsonString, (x) => ListMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListMemberAssignmentsResponse' from JSON`);
47
+ }
48
+ //# sourceMappingURL=listmemberassignments.js.map
@@ -0,0 +1,151 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../../types/enums.js";
3
+ import { Result as SafeParseResult } from "../../types/fp.js";
4
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ /**
6
+ * Interval at which the limit resets (daily, weekly, monthly)
7
+ */
8
+ export declare const UpdateGuardrailResetIntervalRequest: {
9
+ readonly Daily: "daily";
10
+ readonly Weekly: "weekly";
11
+ readonly Monthly: "monthly";
12
+ };
13
+ /**
14
+ * Interval at which the limit resets (daily, weekly, monthly)
15
+ */
16
+ export type UpdateGuardrailResetIntervalRequest = OpenEnum<typeof UpdateGuardrailResetIntervalRequest>;
17
+ export type UpdateGuardrailRequestBody = {
18
+ /**
19
+ * New name for the guardrail
20
+ */
21
+ name?: string | undefined;
22
+ /**
23
+ * New description for the guardrail
24
+ */
25
+ description?: string | null | undefined;
26
+ /**
27
+ * New spending limit in USD
28
+ */
29
+ limitUsd?: number | null | undefined;
30
+ /**
31
+ * Interval at which the limit resets (daily, weekly, monthly)
32
+ */
33
+ resetInterval?: UpdateGuardrailResetIntervalRequest | null | undefined;
34
+ /**
35
+ * New list of allowed provider IDs
36
+ */
37
+ allowedProviders?: Array<string> | null | undefined;
38
+ /**
39
+ * Array of model identifiers (slug or canonical_slug accepted)
40
+ */
41
+ allowedModels?: Array<string> | null | undefined;
42
+ /**
43
+ * Whether to enforce zero data retention
44
+ */
45
+ enforceZdr?: boolean | null | undefined;
46
+ };
47
+ export type UpdateGuardrailRequest = {
48
+ /**
49
+ * The unique identifier of the guardrail to update
50
+ */
51
+ id: string;
52
+ requestBody: UpdateGuardrailRequestBody;
53
+ };
54
+ /**
55
+ * Interval at which the limit resets (daily, weekly, monthly)
56
+ */
57
+ export declare const UpdateGuardrailResetIntervalResponse: {
58
+ readonly Daily: "daily";
59
+ readonly Weekly: "weekly";
60
+ readonly Monthly: "monthly";
61
+ };
62
+ /**
63
+ * Interval at which the limit resets (daily, weekly, monthly)
64
+ */
65
+ export type UpdateGuardrailResetIntervalResponse = OpenEnum<typeof UpdateGuardrailResetIntervalResponse>;
66
+ /**
67
+ * The updated guardrail
68
+ */
69
+ export type UpdateGuardrailData = {
70
+ /**
71
+ * Unique identifier for the guardrail
72
+ */
73
+ id: string;
74
+ /**
75
+ * Name of the guardrail
76
+ */
77
+ name: string;
78
+ /**
79
+ * Description of the guardrail
80
+ */
81
+ description?: string | null | undefined;
82
+ /**
83
+ * Spending limit in USD
84
+ */
85
+ limitUsd?: number | null | undefined;
86
+ /**
87
+ * Interval at which the limit resets (daily, weekly, monthly)
88
+ */
89
+ resetInterval?: UpdateGuardrailResetIntervalResponse | null | undefined;
90
+ /**
91
+ * List of allowed provider IDs
92
+ */
93
+ allowedProviders?: Array<string> | null | undefined;
94
+ /**
95
+ * Array of model canonical_slugs (immutable identifiers)
96
+ */
97
+ allowedModels?: Array<string> | null | undefined;
98
+ /**
99
+ * Whether to enforce zero data retention
100
+ */
101
+ enforceZdr?: boolean | null | undefined;
102
+ /**
103
+ * ISO 8601 timestamp of when the guardrail was created
104
+ */
105
+ createdAt: string;
106
+ /**
107
+ * ISO 8601 timestamp of when the guardrail was last updated
108
+ */
109
+ updatedAt?: string | null | undefined;
110
+ };
111
+ /**
112
+ * Guardrail updated successfully
113
+ */
114
+ export type UpdateGuardrailResponse = {
115
+ /**
116
+ * The updated guardrail
117
+ */
118
+ data: UpdateGuardrailData;
119
+ };
120
+ /** @internal */
121
+ export declare const UpdateGuardrailResetIntervalRequest$outboundSchema: z.ZodType<string, UpdateGuardrailResetIntervalRequest>;
122
+ /** @internal */
123
+ export type UpdateGuardrailRequestBody$Outbound = {
124
+ name?: string | undefined;
125
+ description?: string | null | undefined;
126
+ limit_usd?: number | null | undefined;
127
+ reset_interval?: string | null | undefined;
128
+ allowed_providers?: Array<string> | null | undefined;
129
+ allowed_models?: Array<string> | null | undefined;
130
+ enforce_zdr?: boolean | null | undefined;
131
+ };
132
+ /** @internal */
133
+ export declare const UpdateGuardrailRequestBody$outboundSchema: z.ZodType<UpdateGuardrailRequestBody$Outbound, UpdateGuardrailRequestBody>;
134
+ export declare function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody: UpdateGuardrailRequestBody): string;
135
+ /** @internal */
136
+ export type UpdateGuardrailRequest$Outbound = {
137
+ id: string;
138
+ RequestBody: UpdateGuardrailRequestBody$Outbound;
139
+ };
140
+ /** @internal */
141
+ export declare const UpdateGuardrailRequest$outboundSchema: z.ZodType<UpdateGuardrailRequest$Outbound, UpdateGuardrailRequest>;
142
+ export declare function updateGuardrailRequestToJSON(updateGuardrailRequest: UpdateGuardrailRequest): string;
143
+ /** @internal */
144
+ export declare const UpdateGuardrailResetIntervalResponse$inboundSchema: z.ZodType<UpdateGuardrailResetIntervalResponse, unknown>;
145
+ /** @internal */
146
+ export declare const UpdateGuardrailData$inboundSchema: z.ZodType<UpdateGuardrailData, unknown>;
147
+ export declare function updateGuardrailDataFromJSON(jsonString: string): SafeParseResult<UpdateGuardrailData, SDKValidationError>;
148
+ /** @internal */
149
+ export declare const UpdateGuardrailResponse$inboundSchema: z.ZodType<UpdateGuardrailResponse, unknown>;
150
+ export declare function updateGuardrailResponseFromJSON(jsonString: string): SafeParseResult<UpdateGuardrailResponse, SDKValidationError>;
151
+ //# sourceMappingURL=updateguardrail.d.ts.map
@@ -0,0 +1,97 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d4106fbc6dca
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 UpdateGuardrailResetIntervalRequest = {
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 UpdateGuardrailResetIntervalResponse = {
21
+ Daily: "daily",
22
+ Weekly: "weekly",
23
+ Monthly: "monthly",
24
+ };
25
+ /** @internal */
26
+ export const UpdateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(UpdateGuardrailResetIntervalRequest);
27
+ /** @internal */
28
+ export const UpdateGuardrailRequestBody$outboundSchema = z.object({
29
+ name: z.string().optional(),
30
+ description: z.nullable(z.string()).optional(),
31
+ limitUsd: z.nullable(z.number()).optional(),
32
+ resetInterval: z.nullable(UpdateGuardrailResetIntervalRequest$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 updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody) {
47
+ return JSON.stringify(UpdateGuardrailRequestBody$outboundSchema.parse(updateGuardrailRequestBody));
48
+ }
49
+ /** @internal */
50
+ export const UpdateGuardrailRequest$outboundSchema = z.object({
51
+ id: z.string(),
52
+ requestBody: z.lazy(() => UpdateGuardrailRequestBody$outboundSchema),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ requestBody: "RequestBody",
56
+ });
57
+ });
58
+ export function updateGuardrailRequestToJSON(updateGuardrailRequest) {
59
+ return JSON.stringify(UpdateGuardrailRequest$outboundSchema.parse(updateGuardrailRequest));
60
+ }
61
+ /** @internal */
62
+ export const UpdateGuardrailResetIntervalResponse$inboundSchema = openEnums.inboundSchema(UpdateGuardrailResetIntervalResponse);
63
+ /** @internal */
64
+ export const UpdateGuardrailData$inboundSchema = z.object({
65
+ id: z.string(),
66
+ name: z.string(),
67
+ description: z.nullable(z.string()).optional(),
68
+ limit_usd: z.nullable(z.number()).optional(),
69
+ reset_interval: z.nullable(UpdateGuardrailResetIntervalResponse$inboundSchema)
70
+ .optional(),
71
+ allowed_providers: z.nullable(z.array(z.string())).optional(),
72
+ allowed_models: z.nullable(z.array(z.string())).optional(),
73
+ enforce_zdr: z.nullable(z.boolean()).optional(),
74
+ created_at: z.string(),
75
+ updated_at: z.nullable(z.string()).optional(),
76
+ }).transform((v) => {
77
+ return remap$(v, {
78
+ "limit_usd": "limitUsd",
79
+ "reset_interval": "resetInterval",
80
+ "allowed_providers": "allowedProviders",
81
+ "allowed_models": "allowedModels",
82
+ "enforce_zdr": "enforceZdr",
83
+ "created_at": "createdAt",
84
+ "updated_at": "updatedAt",
85
+ });
86
+ });
87
+ export function updateGuardrailDataFromJSON(jsonString) {
88
+ return safeParse(jsonString, (x) => UpdateGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailData' from JSON`);
89
+ }
90
+ /** @internal */
91
+ export const UpdateGuardrailResponse$inboundSchema = z.object({
92
+ data: z.lazy(() => UpdateGuardrailData$inboundSchema),
93
+ });
94
+ export function updateGuardrailResponseFromJSON(jsonString) {
95
+ return safeParse(jsonString, (x) => UpdateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailResponse' from JSON`);
96
+ }
97
+ //# sourceMappingURL=updateguardrail.js.map
@@ -4,6 +4,7 @@ export declare const OutputModality: {
4
4
  readonly Text: "text";
5
5
  readonly Image: "image";
6
6
  readonly Embeddings: "embeddings";
7
+ readonly Audio: "audio";
7
8
  };
8
9
  export type OutputModality = OpenEnum<typeof OutputModality>;
9
10
  /** @internal */
@@ -7,6 +7,7 @@ export const OutputModality = {
7
7
  Text: "text",
8
8
  Image: "image",
9
9
  Embeddings: "embeddings",
10
+ Audio: "audio",
10
11
  };
11
12
  /** @internal */
12
13
  export const OutputModality$inboundSchema = openEnums.inboundSchema(OutputModality);
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 92e053096488
3
+ * @generated-id: ab5ef16080c7
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  /** @internal */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 9a6b504d3964
3
+ * @generated-id: f8001516363f
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 847aba8ff633
3
+ * @generated-id: 366b617b09b4
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  /** @internal */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: e03f33269427
3
+ * @generated-id: 17fc19055e19
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { PercentileLatencyCutoffs$outboundSchema, } from "./percentilelatencycutoffs.js";
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 5ff9056f1474
3
+ * @generated-id: 04b7597c84f9
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { PercentileThroughputCutoffs$outboundSchema, } from "./percentilethroughputcutoffs.js";
@@ -35,6 +35,10 @@ export type Pricing = {
35
35
  * A value in string format that is a large number
36
36
  */
37
37
  audio?: string | undefined;
38
+ /**
39
+ * A value in string format that is a large number
40
+ */
41
+ audioOutput?: string | undefined;
38
42
  /**
39
43
  * A value in string format that is a large number
40
44
  */
@@ -74,6 +78,10 @@ export type PublicEndpointQuantization = OpenEnum<typeof PublicEndpointQuantizat
74
78
  */
75
79
  export type PublicEndpoint = {
76
80
  name: string;
81
+ /**
82
+ * The unique identifier for the model (permaslug)
83
+ */
84
+ modelId: string;
77
85
  modelName: string;
78
86
  contextLength: number;
79
87
  pricing: Pricing;
@@ -30,6 +30,7 @@ export const Pricing$inboundSchema = z.object({
30
30
  image_token: z.string().optional(),
31
31
  image_output: z.string().optional(),
32
32
  audio: z.string().optional(),
33
+ audio_output: z.string().optional(),
33
34
  input_audio_cache: z.string().optional(),
34
35
  web_search: z.string().optional(),
35
36
  internal_reasoning: z.string().optional(),
@@ -40,6 +41,7 @@ export const Pricing$inboundSchema = z.object({
40
41
  return remap$(v, {
41
42
  "image_token": "imageToken",
42
43
  "image_output": "imageOutput",
44
+ "audio_output": "audioOutput",
43
45
  "input_audio_cache": "inputAudioCache",
44
46
  "web_search": "webSearch",
45
47
  "internal_reasoning": "internalReasoning",
@@ -55,6 +57,7 @@ export const PublicEndpointQuantization$inboundSchema = openEnums.inboundSchema(
55
57
  /** @internal */
56
58
  export const PublicEndpoint$inboundSchema = z.object({
57
59
  name: z.string(),
60
+ model_id: z.string(),
58
61
  model_name: z.string(),
59
62
  context_length: z.number(),
60
63
  pricing: z.lazy(() => Pricing$inboundSchema),
@@ -71,6 +74,7 @@ export const PublicEndpoint$inboundSchema = z.object({
71
74
  throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
72
75
  }).transform((v) => {
73
76
  return remap$(v, {
77
+ "model_id": "modelId",
74
78
  "model_name": "modelName",
75
79
  "context_length": "contextLength",
76
80
  "provider_name": "providerName",