@openrouter/sdk 1.5.22 → 1.5.24

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 (40) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/classifierfiltersfilter.d.ts +10 -0
  4. package/esm/models/classifierfiltersfilter.js +16 -0
  5. package/esm/models/classifierscalarfilter.d.ts +35 -0
  6. package/esm/models/classifierscalarfilter.js +21 -0
  7. package/esm/models/classifierscalarfilteroperator.d.ts +16 -0
  8. package/esm/models/classifierscalarfilteroperator.js +15 -0
  9. package/esm/models/classifiersetfilter.d.ts +32 -0
  10. package/esm/models/classifiersetfilter.js +21 -0
  11. package/esm/models/classifiersetfilteroperator.d.ts +16 -0
  12. package/esm/models/classifiersetfilteroperator.js +15 -0
  13. package/esm/models/filter.d.ts +10 -0
  14. package/esm/models/filter.js +14 -0
  15. package/esm/models/imagegenerationrequest.d.ts +2 -2
  16. package/esm/models/index.d.ts +11 -0
  17. package/esm/models/index.js +11 -0
  18. package/esm/models/jevrouterplugin.d.ts +1 -1
  19. package/esm/models/observabilityfilterrulegroup.d.ts +5 -5
  20. package/esm/models/observabilityfilterrulegroup.js +5 -7
  21. package/esm/models/operations/createkeys.d.ts +1 -1
  22. package/esm/models/operations/deleteinternvaultsecret.d.ts +1 -1
  23. package/esm/models/operations/deletevaultsecret.d.ts +1 -1
  24. package/esm/models/operations/getanalyticsmeta.d.ts +6 -50
  25. package/esm/models/operations/getanalyticsmeta.js +6 -41
  26. package/esm/models/operations/queryanalytics.d.ts +5 -85
  27. package/esm/models/operations/queryanalytics.js +3 -60
  28. package/esm/models/operator.d.ts +50 -0
  29. package/esm/models/operator.js +46 -0
  30. package/esm/models/scalarfilter.d.ts +35 -0
  31. package/esm/models/scalarfilter.js +21 -0
  32. package/esm/models/scalarfilteroperator.d.ts +20 -0
  33. package/esm/models/scalarfilteroperator.js +19 -0
  34. package/esm/models/setfilter.d.ts +37 -0
  35. package/esm/models/setfilter.js +27 -0
  36. package/esm/models/setfilteroperator.d.ts +16 -0
  37. package/esm/models/setfilteroperator.js +15 -0
  38. package/esm/models/vaultsecretwriterequest.d.ts +1 -1
  39. package/jsr.json +1 -1
  40. package/package.json +4 -4
@@ -6,10 +6,11 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import * as openEnums from "../../types/enums.js";
9
+ import { Operator$inboundSchema as models_Operator$inboundSchema } from "../operator.js";
9
10
  /**
10
11
  * Granularity identifier
11
12
  */
12
- export const GranularityName = {
13
+ export const Name = {
13
14
  Minute: "minute",
14
15
  Hour: "hour",
15
16
  Day: "day",
@@ -26,26 +27,6 @@ export const DisplayFormat = {
26
27
  Latency: "latency",
27
28
  Throughput: "throughput",
28
29
  };
29
- /**
30
- * Operator identifier used in filter definitions
31
- */
32
- export const OperatorName = {
33
- Eq: "eq",
34
- Neq: "neq",
35
- In: "in",
36
- NotIn: "not_in",
37
- Gt: "gt",
38
- Gte: "gte",
39
- Lt: "lt",
40
- Lte: "lte",
41
- };
42
- /**
43
- * Whether the operator expects a single value or an array
44
- */
45
- export const ValueType = {
46
- Scalar: "scalar",
47
- Array: "array",
48
- };
49
30
  /** @internal */
50
31
  export const GetAnalyticsMetaRequest$outboundSchema = z.object({
51
32
  httpReferer: z.string().optional(),
@@ -72,12 +53,13 @@ export function dimensionFromJSON(jsonString) {
72
53
  return safeParse(jsonString, (x) => Dimension$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Dimension' from JSON`);
73
54
  }
74
55
  /** @internal */
75
- export const GranularityName$inboundSchema = openEnums.inboundSchema(GranularityName);
56
+ export const Name$inboundSchema = openEnums
57
+ .inboundSchema(Name);
76
58
  /** @internal */
77
59
  export const Granularity$inboundSchema = z
78
60
  .object({
79
61
  display_label: z.string(),
80
- name: GranularityName$inboundSchema,
62
+ name: Name$inboundSchema,
81
63
  }).transform((v) => {
82
64
  return remap$(v, {
83
65
  "display_label": "displayLabel",
@@ -105,28 +87,11 @@ export function metricFromJSON(jsonString) {
105
87
  return safeParse(jsonString, (x) => Metric$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Metric' from JSON`);
106
88
  }
107
89
  /** @internal */
108
- export const OperatorName$inboundSchema = openEnums.inboundSchema(OperatorName);
109
- /** @internal */
110
- export const ValueType$inboundSchema = openEnums
111
- .inboundSchema(ValueType);
112
- /** @internal */
113
- export const Operator$inboundSchema = z.object({
114
- name: OperatorName$inboundSchema,
115
- value_type: ValueType$inboundSchema,
116
- }).transform((v) => {
117
- return remap$(v, {
118
- "value_type": "valueType",
119
- });
120
- });
121
- export function operatorFromJSON(jsonString) {
122
- return safeParse(jsonString, (x) => Operator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operator' from JSON`);
123
- }
124
- /** @internal */
125
90
  export const GetAnalyticsMetaData$inboundSchema = z.object({
126
91
  dimensions: z.array(z.lazy(() => Dimension$inboundSchema)),
127
92
  granularities: z.array(z.lazy(() => Granularity$inboundSchema)),
128
93
  metrics: z.array(z.lazy(() => Metric$inboundSchema)),
129
- operators: z.array(z.lazy(() => Operator$inboundSchema)),
94
+ operators: z.array(models_Operator$inboundSchema),
130
95
  });
131
96
  export function getAnalyticsMetaDataFromJSON(jsonString) {
132
97
  return safeParse(jsonString, (x) => GetAnalyticsMetaData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAnalyticsMetaData' from JSON`);
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../../types/fp.js";
4
4
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ import * as models from "../index.js";
5
6
  export type QueryAnalyticsGlobals = {
6
7
  /**
7
8
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -37,25 +38,6 @@ export type ClassifierDimensions = {
37
38
  */
38
39
  includeNulls?: boolean | undefined;
39
40
  };
40
- export type ValueClassifierFilters = string | number;
41
- /**
42
- * Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.
43
- */
44
- export type ClassifierFiltersValue = string | number | Array<string | number>;
45
- export type ClassifierFiltersFilter = {
46
- /**
47
- * Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").
48
- */
49
- field: string;
50
- /**
51
- * Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.
52
- */
53
- operator: string;
54
- /**
55
- * Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.
56
- */
57
- value: string | number | Array<string | number>;
58
- };
59
41
  /**
60
42
  * Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.
61
43
  */
@@ -64,30 +46,7 @@ export type ClassifierFilters = {
64
46
  * UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.
65
47
  */
66
48
  classifierId: string;
67
- filters: Array<ClassifierFiltersFilter>;
68
- };
69
- export type Value2 = string | number;
70
- /**
71
- * Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
72
- */
73
- export type Value1 = string | number | Array<string | number>;
74
- export type Filter = {
75
- /**
76
- * Dimension to filter on. Use the /meta endpoint for available dimensions.
77
- */
78
- field: string;
79
- /**
80
- * Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.
81
- */
82
- includeUnset?: boolean | undefined;
83
- /**
84
- * Filter operator
85
- */
86
- operator: string;
87
- /**
88
- * Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
89
- */
90
- value: string | number | Array<string | number>;
49
+ filters: Array<models.ClassifierFiltersFilter>;
91
50
  };
92
51
  export declare const Direction: {
93
52
  readonly Asc: "asc";
@@ -121,7 +80,7 @@ export type QueryAnalyticsRequestBody = {
121
80
  */
122
81
  classifierFilters?: ClassifierFilters | undefined;
123
82
  dimensions?: Array<string> | undefined;
124
- filters?: Array<Filter> | undefined;
83
+ filters?: Array<models.Filter> | undefined;
125
84
  /**
126
85
  * Time granularity
127
86
  */
@@ -194,53 +153,14 @@ export type ClassifierDimensions$Outbound = {
194
153
  export declare const ClassifierDimensions$outboundSchema: z.ZodType<ClassifierDimensions$Outbound, ClassifierDimensions>;
195
154
  export declare function classifierDimensionsToJSON(classifierDimensions: ClassifierDimensions): string;
196
155
  /** @internal */
197
- export type ValueClassifierFilters$Outbound = string | number;
198
- /** @internal */
199
- export declare const ValueClassifierFilters$outboundSchema: z.ZodType<ValueClassifierFilters$Outbound, ValueClassifierFilters>;
200
- export declare function valueClassifierFiltersToJSON(valueClassifierFilters: ValueClassifierFilters): string;
201
- /** @internal */
202
- export type ClassifierFiltersValue$Outbound = string | number | Array<string | number>;
203
- /** @internal */
204
- export declare const ClassifierFiltersValue$outboundSchema: z.ZodType<ClassifierFiltersValue$Outbound, ClassifierFiltersValue>;
205
- export declare function classifierFiltersValueToJSON(classifierFiltersValue: ClassifierFiltersValue): string;
206
- /** @internal */
207
- export type ClassifierFiltersFilter$Outbound = {
208
- field: string;
209
- operator: string;
210
- value: string | number | Array<string | number>;
211
- };
212
- /** @internal */
213
- export declare const ClassifierFiltersFilter$outboundSchema: z.ZodType<ClassifierFiltersFilter$Outbound, ClassifierFiltersFilter>;
214
- export declare function classifierFiltersFilterToJSON(classifierFiltersFilter: ClassifierFiltersFilter): string;
215
- /** @internal */
216
156
  export type ClassifierFilters$Outbound = {
217
157
  classifier_id: string;
218
- filters: Array<ClassifierFiltersFilter$Outbound>;
158
+ filters: Array<models.ClassifierFiltersFilter$Outbound>;
219
159
  };
220
160
  /** @internal */
221
161
  export declare const ClassifierFilters$outboundSchema: z.ZodType<ClassifierFilters$Outbound, ClassifierFilters>;
222
162
  export declare function classifierFiltersToJSON(classifierFilters: ClassifierFilters): string;
223
163
  /** @internal */
224
- export type Value2$Outbound = string | number;
225
- /** @internal */
226
- export declare const Value2$outboundSchema: z.ZodType<Value2$Outbound, Value2>;
227
- export declare function value2ToJSON(value2: Value2): string;
228
- /** @internal */
229
- export type Value1$Outbound = string | number | Array<string | number>;
230
- /** @internal */
231
- export declare const Value1$outboundSchema: z.ZodType<Value1$Outbound, Value1>;
232
- export declare function value1ToJSON(value1: Value1): string;
233
- /** @internal */
234
- export type Filter$Outbound = {
235
- field: string;
236
- include_unset?: boolean | undefined;
237
- operator: string;
238
- value: string | number | Array<string | number>;
239
- };
240
- /** @internal */
241
- export declare const Filter$outboundSchema: z.ZodType<Filter$Outbound, Filter>;
242
- export declare function filterToJSON(filter: Filter): string;
243
- /** @internal */
244
164
  export declare const Direction$outboundSchema: z.ZodType<string, Direction>;
245
165
  /** @internal */
246
166
  export type OrderBy$Outbound = {
@@ -263,7 +183,7 @@ export type QueryAnalyticsRequestBody$Outbound = {
263
183
  classifier_dimensions?: ClassifierDimensions$Outbound | undefined;
264
184
  classifier_filters?: ClassifierFilters$Outbound | undefined;
265
185
  dimensions?: Array<string> | undefined;
266
- filters?: Array<Filter$Outbound> | undefined;
186
+ filters?: Array<models.Filter$Outbound> | undefined;
267
187
  granularity?: string | undefined;
268
188
  group_limit?: number | undefined;
269
189
  limit?: number | undefined;
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import * as openEnums from "../../types/enums.js";
9
+ import { ClassifierFiltersFilter$outboundSchema as models_ClassifierFiltersFilter$outboundSchema } from "../classifierfiltersfilter.js"; import { Filter$outboundSchema as models_Filter$outboundSchema } from "../filter.js";
9
10
  export const Direction = {
10
11
  Asc: "asc",
11
12
  Desc: "desc",
@@ -26,36 +27,9 @@ export function classifierDimensionsToJSON(classifierDimensions) {
26
27
  return JSON.stringify(ClassifierDimensions$outboundSchema.parse(classifierDimensions));
27
28
  }
28
29
  /** @internal */
29
- export const ValueClassifierFilters$outboundSchema = z.union([z.string(), z.number()]);
30
- export function valueClassifierFiltersToJSON(valueClassifierFilters) {
31
- return JSON.stringify(ValueClassifierFilters$outboundSchema.parse(valueClassifierFilters));
32
- }
33
- /** @internal */
34
- export const ClassifierFiltersValue$outboundSchema = z.union([
35
- z.string(),
36
- z.number(),
37
- z.array(z.union([z.string(), z.number()])),
38
- ]);
39
- export function classifierFiltersValueToJSON(classifierFiltersValue) {
40
- return JSON.stringify(ClassifierFiltersValue$outboundSchema.parse(classifierFiltersValue));
41
- }
42
- /** @internal */
43
- export const ClassifierFiltersFilter$outboundSchema = z.object({
44
- field: z.string(),
45
- operator: z.string(),
46
- value: z.union([
47
- z.string(),
48
- z.number(),
49
- z.array(z.union([z.string(), z.number()])),
50
- ]),
51
- });
52
- export function classifierFiltersFilterToJSON(classifierFiltersFilter) {
53
- return JSON.stringify(ClassifierFiltersFilter$outboundSchema.parse(classifierFiltersFilter));
54
- }
55
- /** @internal */
56
30
  export const ClassifierFilters$outboundSchema = z.object({
57
31
  classifierId: z.string(),
58
- filters: z.array(z.lazy(() => ClassifierFiltersFilter$outboundSchema)),
32
+ filters: z.array(models_ClassifierFiltersFilter$outboundSchema),
59
33
  }).transform((v) => {
60
34
  return remap$(v, {
61
35
  classifierId: "classifier_id",
@@ -65,37 +39,6 @@ export function classifierFiltersToJSON(classifierFilters) {
65
39
  return JSON.stringify(ClassifierFilters$outboundSchema.parse(classifierFilters));
66
40
  }
67
41
  /** @internal */
68
- export const Value2$outboundSchema = z
69
- .union([z.string(), z.number()]);
70
- export function value2ToJSON(value2) {
71
- return JSON.stringify(Value2$outboundSchema.parse(value2));
72
- }
73
- /** @internal */
74
- export const Value1$outboundSchema = z
75
- .union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]);
76
- export function value1ToJSON(value1) {
77
- return JSON.stringify(Value1$outboundSchema.parse(value1));
78
- }
79
- /** @internal */
80
- export const Filter$outboundSchema = z
81
- .object({
82
- field: z.string(),
83
- includeUnset: z.boolean().optional(),
84
- operator: z.string(),
85
- value: z.union([
86
- z.string(),
87
- z.number(),
88
- z.array(z.union([z.string(), z.number()])),
89
- ]),
90
- }).transform((v) => {
91
- return remap$(v, {
92
- includeUnset: "include_unset",
93
- });
94
- });
95
- export function filterToJSON(filter) {
96
- return JSON.stringify(Filter$outboundSchema.parse(filter));
97
- }
98
- /** @internal */
99
42
  export const Direction$outboundSchema = openEnums
100
43
  .outboundSchema(Direction);
101
44
  /** @internal */
@@ -121,7 +64,7 @@ export const QueryAnalyticsRequestBody$outboundSchema = z.object({
121
64
  .optional(),
122
65
  classifierFilters: z.lazy(() => ClassifierFilters$outboundSchema).optional(),
123
66
  dimensions: z.array(z.string()).optional(),
124
- filters: z.array(z.lazy(() => Filter$outboundSchema)).optional(),
67
+ filters: z.array(models_Filter$outboundSchema).optional(),
125
68
  granularity: z.string().optional(),
126
69
  groupLimit: z.int().optional(),
127
70
  limit: z.int().optional(),
@@ -0,0 +1,50 @@
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
+ * Operator identifier used in filter definitions
7
+ */
8
+ export declare const OperatorName: {
9
+ readonly Eq: "eq";
10
+ readonly Neq: "neq";
11
+ readonly In: "in";
12
+ readonly NotIn: "not_in";
13
+ readonly Gt: "gt";
14
+ readonly Gte: "gte";
15
+ readonly Lt: "lt";
16
+ readonly Lte: "lte";
17
+ };
18
+ /**
19
+ * Operator identifier used in filter definitions
20
+ */
21
+ export type OperatorName = OpenEnum<typeof OperatorName>;
22
+ /**
23
+ * Whether the operator expects a single value or an array
24
+ */
25
+ export declare const ValueType: {
26
+ readonly Scalar: "scalar";
27
+ readonly Array: "array";
28
+ };
29
+ /**
30
+ * Whether the operator expects a single value or an array
31
+ */
32
+ export type ValueType = OpenEnum<typeof ValueType>;
33
+ export type Operator = {
34
+ /**
35
+ * Operator identifier used in filter definitions
36
+ */
37
+ name: OperatorName;
38
+ /**
39
+ * Whether the operator expects a single value or an array
40
+ */
41
+ valueType: ValueType;
42
+ };
43
+ /** @internal */
44
+ export declare const OperatorName$inboundSchema: z.ZodType<OperatorName, unknown>;
45
+ /** @internal */
46
+ export declare const ValueType$inboundSchema: z.ZodType<ValueType, unknown>;
47
+ /** @internal */
48
+ export declare const Operator$inboundSchema: z.ZodType<Operator, unknown>;
49
+ export declare function operatorFromJSON(jsonString: string): SafeParseResult<Operator, SDKValidationError>;
50
+ //# sourceMappingURL=operator.d.ts.map
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2c6d6b8bb46a
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
+ * Operator identifier used in filter definitions
11
+ */
12
+ export const OperatorName = {
13
+ Eq: "eq",
14
+ Neq: "neq",
15
+ In: "in",
16
+ NotIn: "not_in",
17
+ Gt: "gt",
18
+ Gte: "gte",
19
+ Lt: "lt",
20
+ Lte: "lte",
21
+ };
22
+ /**
23
+ * Whether the operator expects a single value or an array
24
+ */
25
+ export const ValueType = {
26
+ Scalar: "scalar",
27
+ Array: "array",
28
+ };
29
+ /** @internal */
30
+ export const OperatorName$inboundSchema = openEnums.inboundSchema(OperatorName);
31
+ /** @internal */
32
+ export const ValueType$inboundSchema = openEnums
33
+ .inboundSchema(ValueType);
34
+ /** @internal */
35
+ export const Operator$inboundSchema = z.object({
36
+ name: OperatorName$inboundSchema,
37
+ value_type: ValueType$inboundSchema,
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ "value_type": "valueType",
41
+ });
42
+ });
43
+ export function operatorFromJSON(jsonString) {
44
+ return safeParse(jsonString, (x) => Operator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operator' from JSON`);
45
+ }
46
+ //# sourceMappingURL=operator.js.map
@@ -0,0 +1,35 @@
1
+ import * as z from "zod/v4";
2
+ import { ScalarFilterOperator } from "./scalarfilteroperator.js";
3
+ /**
4
+ * Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
5
+ */
6
+ export type ScalarFilterValue = string | number;
7
+ export type ScalarFilter = {
8
+ /**
9
+ * Dimension to filter on. Use the /meta endpoint for available dimensions.
10
+ */
11
+ field: string;
12
+ /**
13
+ * Comparison operator taking a scalar filter value.
14
+ */
15
+ operator: ScalarFilterOperator;
16
+ /**
17
+ * Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
18
+ */
19
+ value: string | number;
20
+ };
21
+ /** @internal */
22
+ export type ScalarFilterValue$Outbound = string | number;
23
+ /** @internal */
24
+ export declare const ScalarFilterValue$outboundSchema: z.ZodType<ScalarFilterValue$Outbound, ScalarFilterValue>;
25
+ export declare function scalarFilterValueToJSON(scalarFilterValue: ScalarFilterValue): string;
26
+ /** @internal */
27
+ export type ScalarFilter$Outbound = {
28
+ field: string;
29
+ operator: string;
30
+ value: string | number;
31
+ };
32
+ /** @internal */
33
+ export declare const ScalarFilter$outboundSchema: z.ZodType<ScalarFilter$Outbound, ScalarFilter>;
34
+ export declare function scalarFilterToJSON(scalarFilter: ScalarFilter): string;
35
+ //# sourceMappingURL=scalarfilter.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a35bae1c804d
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { ScalarFilterOperator$outboundSchema, } from "./scalarfilteroperator.js";
7
+ /** @internal */
8
+ export const ScalarFilterValue$outboundSchema = z.union([z.string(), z.number()]);
9
+ export function scalarFilterValueToJSON(scalarFilterValue) {
10
+ return JSON.stringify(ScalarFilterValue$outboundSchema.parse(scalarFilterValue));
11
+ }
12
+ /** @internal */
13
+ export const ScalarFilter$outboundSchema = z.object({
14
+ field: z.string(),
15
+ operator: ScalarFilterOperator$outboundSchema,
16
+ value: z.union([z.string(), z.number()]),
17
+ });
18
+ export function scalarFilterToJSON(scalarFilter) {
19
+ return JSON.stringify(ScalarFilter$outboundSchema.parse(scalarFilter));
20
+ }
21
+ //# sourceMappingURL=scalarfilter.js.map
@@ -0,0 +1,20 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Comparison operator taking a scalar filter value.
5
+ */
6
+ export declare const ScalarFilterOperator: {
7
+ readonly Eq: "eq";
8
+ readonly Neq: "neq";
9
+ readonly Gt: "gt";
10
+ readonly Gte: "gte";
11
+ readonly Lt: "lt";
12
+ readonly Lte: "lte";
13
+ };
14
+ /**
15
+ * Comparison operator taking a scalar filter value.
16
+ */
17
+ export type ScalarFilterOperator = OpenEnum<typeof ScalarFilterOperator>;
18
+ /** @internal */
19
+ export declare const ScalarFilterOperator$outboundSchema: z.ZodType<string, ScalarFilterOperator>;
20
+ //# sourceMappingURL=scalarfilteroperator.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 25c4ab8aa37c
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * Comparison operator taking a scalar filter value.
8
+ */
9
+ export const ScalarFilterOperator = {
10
+ Eq: "eq",
11
+ Neq: "neq",
12
+ Gt: "gt",
13
+ Gte: "gte",
14
+ Lt: "lt",
15
+ Lte: "lte",
16
+ };
17
+ /** @internal */
18
+ export const ScalarFilterOperator$outboundSchema = openEnums.outboundSchema(ScalarFilterOperator);
19
+ //# sourceMappingURL=scalarfilteroperator.js.map
@@ -0,0 +1,37 @@
1
+ import * as z from "zod/v4";
2
+ import { SetFilterOperator } from "./setfilteroperator.js";
3
+ /**
4
+ * Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
5
+ */
6
+ export type SetFilterValue = string | number;
7
+ export type SetFilter = {
8
+ /**
9
+ * Dimension to filter on. Use the /meta endpoint for available dimensions.
10
+ */
11
+ field: string;
12
+ /**
13
+ * Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket.
14
+ */
15
+ includeUnset?: boolean | undefined;
16
+ /**
17
+ * Set-membership operator taking an array filter value.
18
+ */
19
+ operator: SetFilterOperator;
20
+ value: Array<string | number>;
21
+ };
22
+ /** @internal */
23
+ export type SetFilterValue$Outbound = string | number;
24
+ /** @internal */
25
+ export declare const SetFilterValue$outboundSchema: z.ZodType<SetFilterValue$Outbound, SetFilterValue>;
26
+ export declare function setFilterValueToJSON(setFilterValue: SetFilterValue): string;
27
+ /** @internal */
28
+ export type SetFilter$Outbound = {
29
+ field: string;
30
+ include_unset?: boolean | undefined;
31
+ operator: string;
32
+ value: Array<string | number>;
33
+ };
34
+ /** @internal */
35
+ export declare const SetFilter$outboundSchema: z.ZodType<SetFilter$Outbound, SetFilter>;
36
+ export declare function setFilterToJSON(setFilter: SetFilter): string;
37
+ //# sourceMappingURL=setfilter.d.ts.map
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 996a872ffcc5
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { SetFilterOperator$outboundSchema, } from "./setfilteroperator.js";
8
+ /** @internal */
9
+ export const SetFilterValue$outboundSchema = z.union([z.string(), z.number()]);
10
+ export function setFilterValueToJSON(setFilterValue) {
11
+ return JSON.stringify(SetFilterValue$outboundSchema.parse(setFilterValue));
12
+ }
13
+ /** @internal */
14
+ export const SetFilter$outboundSchema = z.object({
15
+ field: z.string(),
16
+ includeUnset: z.boolean().optional(),
17
+ operator: SetFilterOperator$outboundSchema,
18
+ value: z.array(z.union([z.string(), z.number()])),
19
+ }).transform((v) => {
20
+ return remap$(v, {
21
+ includeUnset: "include_unset",
22
+ });
23
+ });
24
+ export function setFilterToJSON(setFilter) {
25
+ return JSON.stringify(SetFilter$outboundSchema.parse(setFilter));
26
+ }
27
+ //# sourceMappingURL=setfilter.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Set-membership operator taking an array filter value.
5
+ */
6
+ export declare const SetFilterOperator: {
7
+ readonly In: "in";
8
+ readonly NotIn: "not_in";
9
+ };
10
+ /**
11
+ * Set-membership operator taking an array filter value.
12
+ */
13
+ export type SetFilterOperator = OpenEnum<typeof SetFilterOperator>;
14
+ /** @internal */
15
+ export declare const SetFilterOperator$outboundSchema: z.ZodType<string, SetFilterOperator>;
16
+ //# sourceMappingURL=setfilteroperator.d.ts.map
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 96f1a2679754
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * Set-membership operator taking an array filter value.
8
+ */
9
+ export const SetFilterOperator = {
10
+ In: "in",
11
+ NotIn: "not_in",
12
+ };
13
+ /** @internal */
14
+ export const SetFilterOperator$outboundSchema = openEnums.outboundSchema(SetFilterOperator);
15
+ //# sourceMappingURL=setfilteroperator.js.map
@@ -8,7 +8,7 @@ export type VaultSecretWriteRequest = {
8
8
  */
9
9
  hosts: Array<string>;
10
10
  /**
11
- * Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.
11
+ * Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.
12
12
  */
13
13
  value: string;
14
14
  };
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.22",
5
+ "version": "1.5.24",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.5.22",
3
+ "version": "1.5.24",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
6
6
  "keywords": [
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "compile": "tsc && node scripts/unbarrel-imports.js",
77
+ "test:transit": "exit 0",
76
78
  "test:watch": "vitest --watch --project unit",
77
79
  "typecheck": "tsc --noEmit",
78
- "compile": "tsc && node scripts/unbarrel-imports.js",
79
80
  "postinstall": "node scripts/check-types.js || true",
80
81
  "prepare": "npm run build",
81
82
  "test": "vitest --run --project unit",
82
- "typecheck:transit": "exit 0",
83
83
  "test:e2e": "vitest --run --project e2e",
84
- "test:transit": "exit 0"
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {
87
87