@openrouter/sdk 1.2.23 → 1.2.25

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 (37) hide show
  1. package/esm/funcs/benchmarksGetBenchmarks.d.ts +1 -1
  2. package/esm/funcs/benchmarksGetBenchmarks.js +5 -1
  3. package/esm/funcs/generationsListGenerationContent.d.ts +1 -1
  4. package/esm/funcs/generationsListGenerationContent.js +1 -1
  5. package/esm/lib/config.d.ts +2 -2
  6. package/esm/lib/config.js +2 -2
  7. package/esm/models/generationcontentdata.d.ts +6 -1
  8. package/esm/models/generationcontentdata.js +2 -0
  9. package/esm/models/generationcontenterror.d.ts +33 -0
  10. package/esm/models/generationcontenterror.js +25 -0
  11. package/esm/models/generationcontenterrorattempt.d.ts +28 -0
  12. package/esm/models/generationcontenterrorattempt.js +22 -0
  13. package/esm/models/generationcontentresponse.d.ts +1 -1
  14. package/esm/models/index.d.ts +4 -0
  15. package/esm/models/index.js +4 -0
  16. package/esm/models/operations/getbenchmarks.d.ts +54 -3
  17. package/esm/models/operations/getbenchmarks.js +32 -1
  18. package/esm/models/unifiedbenchmarksaaitem.d.ts +14 -1
  19. package/esm/models/unifiedbenchmarksaaitem.js +9 -1
  20. package/esm/models/unifiedbenchmarksdaitem.d.ts +14 -1
  21. package/esm/models/unifiedbenchmarksdaitem.js +9 -1
  22. package/esm/models/unifiedbenchmarksmeta.d.ts +4 -4
  23. package/esm/models/unifiedbenchmarksmeta.js +3 -3
  24. package/esm/models/unifiedbenchmarksoritem.d.ts +18 -6
  25. package/esm/models/unifiedbenchmarksoritem.js +12 -4
  26. package/esm/models/unifiedbenchmarksresponse.d.ts +3 -3
  27. package/esm/models/unifiedbenchmarksresponse.js +13 -11
  28. package/esm/models/unifiedbenchmarkssearchitem.d.ts +116 -0
  29. package/esm/models/unifiedbenchmarkssearchitem.js +81 -0
  30. package/esm/models/unifiedbenchmarkssearchrunconfig.d.ts +24 -0
  31. package/esm/models/unifiedbenchmarkssearchrunconfig.js +22 -0
  32. package/esm/sdk/benchmarks.d.ts +1 -1
  33. package/esm/sdk/benchmarks.js +1 -1
  34. package/esm/sdk/generations.d.ts +1 -1
  35. package/esm/sdk/generations.js +1 -1
  36. package/jsr.json +1 -1
  37. package/package.json +6 -6
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * List Benchmarks
14
14
  *
15
15
  * @remarks
16
- * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench and GPQA evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
16
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter's search benchmarks, which publish each model's highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
17
17
  */
18
18
  export declare function benchmarksGetBenchmarks(client: OpenRouterCore, request?: operations.GetBenchmarksRequest | undefined, options?: RequestOptions): APIPromise<Result<models.UnifiedBenchmarksResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=benchmarksGetBenchmarks.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * List Benchmarks
18
18
  *
19
19
  * @remarks
20
- * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench and GPQA evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
20
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter's search benchmarks, which publish each model's highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
21
21
  */
22
22
  export function benchmarksGetBenchmarks(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -32,8 +32,12 @@ async function $do(client, request, options) {
32
32
  const path = pathToFunc("/benchmarks")();
33
33
  const query = encodeFormQuery({
34
34
  "arena": payload?.arena,
35
+ "benchmark_type": payload?.benchmark_type,
35
36
  "category": payload?.category,
37
+ "include_run_config": payload?.include_run_config,
36
38
  "max_results": payload?.max_results,
39
+ "search_engine": payload?.search_engine,
40
+ "search_surface": payload?.search_surface,
37
41
  "source": payload?.source,
38
42
  "task_type": payload?.task_type,
39
43
  });
@@ -10,7 +10,7 @@ import * as operations from "../models/operations/index.js";
10
10
  import { APIPromise } from "../types/async.js";
11
11
  import { Result } from "../types/fp.js";
12
12
  /**
13
- * Get stored prompt and completion content for a generation
13
+ * Get stored prompt, completion, and error content for a generation
14
14
  */
15
15
  export declare function generationsListGenerationContent(client: OpenRouterCore, request: operations.ListGenerationContentRequest, options?: RequestOptions): APIPromise<Result<models.GenerationContentResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
16
16
  //# sourceMappingURL=generationsListGenerationContent.d.ts.map
@@ -14,7 +14,7 @@ import * as models from "../models/index.js";
14
14
  import * as operations from "../models/operations/index.js";
15
15
  import { APIPromise } from "../types/async.js";
16
16
  /**
17
- * Get stored prompt and completion content for a generation
17
+ * Get stored prompt, completion, and error content for a generation
18
18
  */
19
19
  export function generationsListGenerationContent(client, request, options) {
20
20
  return new APIPromise($do(client, request, options));
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
49
49
  export declare const SDK_METADATA: {
50
50
  readonly language: "typescript";
51
51
  readonly openapiDocVersion: "1.0.0";
52
- readonly sdkVersion: "1.2.23";
52
+ readonly sdkVersion: "1.2.25";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.2.23 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.25 2.914.0 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "1.2.23",
29
+ sdkVersion: "1.2.25",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.2.23 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.2.25 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { GenerationContentError } from "./generationcontenterror.js";
4
5
  export type Input2 = {
5
6
  messages: Array<any>;
6
7
  };
@@ -25,9 +26,13 @@ export type GenerationContentDataOutput = {
25
26
  reasoning: string | null;
26
27
  };
27
28
  /**
28
- * Stored prompt and completion content
29
+ * Stored prompt and completion content, plus the failure error when one was stored
29
30
  */
30
31
  export type GenerationContentData = {
32
+ /**
33
+ * The stored failure for this generation, or null when it succeeded
34
+ */
35
+ error: GenerationContentError | null;
31
36
  /**
32
37
  * The input to the generation — either a prompt string or an array of messages
33
38
  */
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
+ import { GenerationContentError$inboundSchema, } from "./generationcontenterror.js";
7
8
  /** @internal */
8
9
  export const Input2$inboundSchema = z.object({
9
10
  messages: z.array(z.any()),
@@ -33,6 +34,7 @@ export function generationContentDataOutputFromJSON(jsonString) {
33
34
  }
34
35
  /** @internal */
35
36
  export const GenerationContentData$inboundSchema = z.object({
37
+ error: z.nullable(GenerationContentError$inboundSchema),
36
38
  input: z.union([
37
39
  z.lazy(() => Input1$inboundSchema),
38
40
  z.lazy(() => Input2$inboundSchema),
@@ -0,0 +1,33 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { GenerationContentErrorAttempt } from "./generationcontenterrorattempt.js";
5
+ /**
6
+ * The stored failure for this generation, or null when it succeeded
7
+ */
8
+ export type GenerationContentError = {
9
+ /**
10
+ * Error message returned to the client
11
+ */
12
+ message: string | null;
13
+ /**
14
+ * Every upstream attempt that failed before the returned error, in attempt order
15
+ */
16
+ previousErrors: Array<GenerationContentErrorAttempt>;
17
+ /**
18
+ * Provider whose error was returned to the client, when known
19
+ */
20
+ providerName: string | null;
21
+ /**
22
+ * Raw error body behind the returned error, when stored
23
+ */
24
+ raw: string | null;
25
+ /**
26
+ * HTTP status returned to the client
27
+ */
28
+ status: number | null;
29
+ };
30
+ /** @internal */
31
+ export declare const GenerationContentError$inboundSchema: z.ZodType<GenerationContentError, unknown>;
32
+ export declare function generationContentErrorFromJSON(jsonString: string): SafeParseResult<GenerationContentError, SDKValidationError>;
33
+ //# sourceMappingURL=generationcontenterror.d.ts.map
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5fb5a3b52853
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 { GenerationContentErrorAttempt$inboundSchema, } from "./generationcontenterrorattempt.js";
9
+ /** @internal */
10
+ export const GenerationContentError$inboundSchema = z.object({
11
+ message: z.nullable(z.string()),
12
+ previous_errors: z.array(GenerationContentErrorAttempt$inboundSchema),
13
+ provider_name: z.nullable(z.string()),
14
+ raw: z.nullable(z.string()),
15
+ status: z.nullable(z.int()),
16
+ }).transform((v) => {
17
+ return remap$(v, {
18
+ "previous_errors": "previousErrors",
19
+ "provider_name": "providerName",
20
+ });
21
+ });
22
+ export function generationContentErrorFromJSON(jsonString) {
23
+ return safeParse(jsonString, (x) => GenerationContentError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerationContentError' from JSON`);
24
+ }
25
+ //# sourceMappingURL=generationcontenterror.js.map
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * A single failed upstream attempt recorded for the generation
6
+ */
7
+ export type GenerationContentErrorAttempt = {
8
+ /**
9
+ * HTTP status returned by this attempt
10
+ */
11
+ code: number;
12
+ /**
13
+ * Error message returned by this attempt
14
+ */
15
+ message: string;
16
+ /**
17
+ * Provider that served this attempt, when known
18
+ */
19
+ providerName: string | null;
20
+ /**
21
+ * Raw error body returned by the provider, when stored
22
+ */
23
+ raw: string | null;
24
+ };
25
+ /** @internal */
26
+ export declare const GenerationContentErrorAttempt$inboundSchema: z.ZodType<GenerationContentErrorAttempt, unknown>;
27
+ export declare function generationContentErrorAttemptFromJSON(jsonString: string): SafeParseResult<GenerationContentErrorAttempt, SDKValidationError>;
28
+ //# sourceMappingURL=generationcontenterrorattempt.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0a3c55570f8e
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 GenerationContentErrorAttempt$inboundSchema = z.object({
10
+ code: z.int(),
11
+ message: z.string(),
12
+ provider_name: z.nullable(z.string()),
13
+ raw: z.nullable(z.string()),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "provider_name": "providerName",
17
+ });
18
+ });
19
+ export function generationContentErrorAttemptFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => GenerationContentErrorAttempt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerationContentErrorAttempt' from JSON`);
21
+ }
22
+ //# sourceMappingURL=generationcontenterrorattempt.js.map
@@ -7,7 +7,7 @@ import { GenerationContentData } from "./generationcontentdata.js";
7
7
  */
8
8
  export type GenerationContentResponse = {
9
9
  /**
10
- * Stored prompt and completion content
10
+ * Stored prompt and completion content, plus the failure error when one was stored
11
11
  */
12
12
  data: GenerationContentData;
13
13
  };
@@ -237,6 +237,8 @@ export * from "./fusionservertoolconfig.js";
237
237
  export * from "./fusionservertoolopenrouter.js";
238
238
  export * from "./fusionsource.js";
239
239
  export * from "./generationcontentdata.js";
240
+ export * from "./generationcontenterror.js";
241
+ export * from "./generationcontenterrorattempt.js";
240
242
  export * from "./generationcontentresponse.js";
241
243
  export * from "./generationresponse.js";
242
244
  export * from "./getbyokkeyresponse.js";
@@ -559,6 +561,8 @@ export * from "./unifiedbenchmarksdaitem.js";
559
561
  export * from "./unifiedbenchmarksmeta.js";
560
562
  export * from "./unifiedbenchmarksoritem.js";
561
563
  export * from "./unifiedbenchmarksresponse.js";
564
+ export * from "./unifiedbenchmarkssearchitem.js";
565
+ export * from "./unifiedbenchmarkssearchrunconfig.js";
562
566
  export * from "./unprocessableentityresponseerrordata.js";
563
567
  export * from "./updatebyokkeyrequest.js";
564
568
  export * from "./updatebyokkeyresponse.js";
@@ -241,6 +241,8 @@ export * from "./fusionservertoolconfig.js";
241
241
  export * from "./fusionservertoolopenrouter.js";
242
242
  export * from "./fusionsource.js";
243
243
  export * from "./generationcontentdata.js";
244
+ export * from "./generationcontenterror.js";
245
+ export * from "./generationcontenterrorattempt.js";
244
246
  export * from "./generationcontentresponse.js";
245
247
  export * from "./generationresponse.js";
246
248
  export * from "./getbyokkeyresponse.js";
@@ -563,6 +565,8 @@ export * from "./unifiedbenchmarksdaitem.js";
563
565
  export * from "./unifiedbenchmarksmeta.js";
564
566
  export * from "./unifiedbenchmarksoritem.js";
565
567
  export * from "./unifiedbenchmarksresponse.js";
568
+ export * from "./unifiedbenchmarkssearchitem.js";
569
+ export * from "./unifiedbenchmarkssearchrunconfig.js";
566
570
  export * from "./unprocessableentityresponseerrordata.js";
567
571
  export * from "./updatebyokkeyrequest.js";
568
572
  export * from "./updatebyokkeyresponse.js";
@@ -34,17 +34,44 @@ export declare const Source: {
34
34
  */
35
35
  export type Source = OpenEnum<typeof Source>;
36
36
  /**
37
- * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
37
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.
38
38
  */
39
39
  export declare const TaskType: {
40
40
  readonly Coding: "coding";
41
41
  readonly Intelligence: "intelligence";
42
42
  readonly Agentic: "agentic";
43
+ readonly Search: "search";
43
44
  };
44
45
  /**
45
- * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
46
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.
46
47
  */
47
48
  export type TaskType = OpenEnum<typeof TaskType>;
49
+ /**
50
+ * Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources' items as they are.
51
+ */
52
+ export declare const BenchmarkType: {
53
+ readonly GpqaDiamond: "gpqa_diamond";
54
+ readonly TauBenchVerifiedAirline: "tau_bench_verified_airline";
55
+ readonly SearchBrowsecomp: "search_browsecomp";
56
+ readonly SearchHle: "search_hle";
57
+ readonly SearchDsqa: "search_dsqa";
58
+ readonly SearchWidesearch: "search_widesearch";
59
+ };
60
+ /**
61
+ * Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources' items as they are.
62
+ */
63
+ export type BenchmarkType = OpenEnum<typeof BenchmarkType>;
64
+ /**
65
+ * OpenRouter search benchmarks only: filter by the request surface the lane ran on.
66
+ */
67
+ export declare const SearchSurface: {
68
+ readonly ServerTool: "server-tool";
69
+ readonly Plugin: "plugin";
70
+ };
71
+ /**
72
+ * OpenRouter search benchmarks only: filter by the request surface the lane ran on.
73
+ */
74
+ export type SearchSurface = OpenEnum<typeof SearchSurface>;
48
75
  /**
49
76
  * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
50
77
  */
@@ -82,9 +109,25 @@ export type GetBenchmarksRequest = {
82
109
  */
83
110
  source?: Source | undefined;
84
111
  /**
85
- * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
112
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.
86
113
  */
87
114
  taskType?: TaskType | undefined;
115
+ /**
116
+ * Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources' items as they are.
117
+ */
118
+ benchmarkType?: BenchmarkType | undefined;
119
+ /**
120
+ * Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.
121
+ */
122
+ includeRunConfig?: boolean | undefined;
123
+ /**
124
+ * OpenRouter search benchmarks only: filter by the search engine used.
125
+ */
126
+ searchEngine?: string | undefined;
127
+ /**
128
+ * OpenRouter search benchmarks only: filter by the request surface the lane ran on.
129
+ */
130
+ searchSurface?: SearchSurface | undefined;
88
131
  /**
89
132
  * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
90
133
  */
@@ -103,6 +146,10 @@ export declare const Source$outboundSchema: z.ZodType<string, Source>;
103
146
  /** @internal */
104
147
  export declare const TaskType$outboundSchema: z.ZodType<string, TaskType>;
105
148
  /** @internal */
149
+ export declare const BenchmarkType$outboundSchema: z.ZodType<string, BenchmarkType>;
150
+ /** @internal */
151
+ export declare const SearchSurface$outboundSchema: z.ZodType<string, SearchSurface>;
152
+ /** @internal */
106
153
  export declare const Arena$outboundSchema: z.ZodType<string, Arena>;
107
154
  /** @internal */
108
155
  export type GetBenchmarksRequest$Outbound = {
@@ -111,6 +158,10 @@ export type GetBenchmarksRequest$Outbound = {
111
158
  appCategories?: string | undefined;
112
159
  source?: string | undefined;
113
160
  task_type?: string | undefined;
161
+ benchmark_type?: string | undefined;
162
+ include_run_config: boolean;
163
+ search_engine?: string | undefined;
164
+ search_surface?: string | undefined;
114
165
  arena?: string | undefined;
115
166
  category?: string | undefined;
116
167
  max_results?: number | undefined;
@@ -14,12 +14,31 @@ export const Source = {
14
14
  Openrouter: "openrouter",
15
15
  };
16
16
  /**
17
- * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
17
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.
18
18
  */
19
19
  export const TaskType = {
20
20
  Coding: "coding",
21
21
  Intelligence: "intelligence",
22
22
  Agentic: "agentic",
23
+ Search: "search",
24
+ };
25
+ /**
26
+ * Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources' items as they are.
27
+ */
28
+ export const BenchmarkType = {
29
+ GpqaDiamond: "gpqa_diamond",
30
+ TauBenchVerifiedAirline: "tau_bench_verified_airline",
31
+ SearchBrowsecomp: "search_browsecomp",
32
+ SearchHle: "search_hle",
33
+ SearchDsqa: "search_dsqa",
34
+ SearchWidesearch: "search_widesearch",
35
+ };
36
+ /**
37
+ * OpenRouter search benchmarks only: filter by the request surface the lane ran on.
38
+ */
39
+ export const SearchSurface = {
40
+ ServerTool: "server-tool",
41
+ Plugin: "plugin",
23
42
  };
24
43
  /**
25
44
  * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
@@ -36,6 +55,10 @@ export const Source$outboundSchema = openEnums
36
55
  export const TaskType$outboundSchema = openEnums
37
56
  .outboundSchema(TaskType);
38
57
  /** @internal */
58
+ export const BenchmarkType$outboundSchema = openEnums.outboundSchema(BenchmarkType);
59
+ /** @internal */
60
+ export const SearchSurface$outboundSchema = openEnums.outboundSchema(SearchSurface);
61
+ /** @internal */
39
62
  export const Arena$outboundSchema = openEnums
40
63
  .outboundSchema(Arena);
41
64
  /** @internal */
@@ -45,6 +68,10 @@ export const GetBenchmarksRequest$outboundSchema = z.object({
45
68
  appCategories: z.string().optional(),
46
69
  source: Source$outboundSchema.optional(),
47
70
  taskType: TaskType$outboundSchema.optional(),
71
+ benchmarkType: BenchmarkType$outboundSchema.optional(),
72
+ includeRunConfig: z.boolean().default(false),
73
+ searchEngine: z.string().optional(),
74
+ searchSurface: SearchSurface$outboundSchema.optional(),
48
75
  arena: Arena$outboundSchema.optional(),
49
76
  category: z.string().optional(),
50
77
  maxResults: z.int().optional(),
@@ -52,6 +79,10 @@ export const GetBenchmarksRequest$outboundSchema = z.object({
52
79
  return remap$(v, {
53
80
  httpReferer: "HTTP-Referer",
54
81
  taskType: "task_type",
82
+ benchmarkType: "benchmark_type",
83
+ includeRunConfig: "include_run_config",
84
+ searchEngine: "search_engine",
85
+ searchSurface: "search_surface",
55
86
  maxResults: "max_results",
56
87
  });
57
88
  });
@@ -1,7 +1,18 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  import { UnifiedBenchmarkPricing } from "./unifiedbenchmarkpricing.js";
6
+ /**
7
+ * Benchmark source discriminator.
8
+ */
9
+ export declare const UnifiedBenchmarksAAItemSource: {
10
+ readonly ArtificialAnalysis: "artificial-analysis";
11
+ };
12
+ /**
13
+ * Benchmark source discriminator.
14
+ */
15
+ export type UnifiedBenchmarksAAItemSource = ClosedEnum<typeof UnifiedBenchmarksAAItemSource>;
5
16
  export type UnifiedBenchmarksAAItem = {
6
17
  /**
7
18
  * Artificial Analysis Agentic Index composite score. Higher is better.
@@ -30,9 +41,11 @@ export type UnifiedBenchmarksAAItem = {
30
41
  /**
31
42
  * Benchmark source discriminator.
32
43
  */
33
- source: "artificial-analysis";
44
+ source: UnifiedBenchmarksAAItemSource;
34
45
  };
35
46
  /** @internal */
47
+ export declare const UnifiedBenchmarksAAItemSource$inboundSchema: z.ZodEnum<typeof UnifiedBenchmarksAAItemSource>;
48
+ /** @internal */
36
49
  export declare const UnifiedBenchmarksAAItem$inboundSchema: z.ZodType<UnifiedBenchmarksAAItem, unknown>;
37
50
  export declare function unifiedBenchmarksAAItemFromJSON(jsonString: string): SafeParseResult<UnifiedBenchmarksAAItem, SDKValidationError>;
38
51
  //# sourceMappingURL=unifiedbenchmarksaaitem.d.ts.map
@@ -6,6 +6,14 @@ 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 { UnifiedBenchmarkPricing$inboundSchema, } from "./unifiedbenchmarkpricing.js";
9
+ /**
10
+ * Benchmark source discriminator.
11
+ */
12
+ export const UnifiedBenchmarksAAItemSource = {
13
+ ArtificialAnalysis: "artificial-analysis",
14
+ };
15
+ /** @internal */
16
+ export const UnifiedBenchmarksAAItemSource$inboundSchema = z.enum(UnifiedBenchmarksAAItemSource);
9
17
  /** @internal */
10
18
  export const UnifiedBenchmarksAAItem$inboundSchema = z.object({
11
19
  agentic_index: z.nullable(z.number()),
@@ -14,7 +22,7 @@ export const UnifiedBenchmarksAAItem$inboundSchema = z.object({
14
22
  intelligence_index: z.nullable(z.number()),
15
23
  model_permaslug: z.string(),
16
24
  pricing: z.nullable(UnifiedBenchmarkPricing$inboundSchema),
17
- source: z.literal("artificial-analysis"),
25
+ source: UnifiedBenchmarksAAItemSource$inboundSchema,
18
26
  }).transform((v) => {
19
27
  return remap$(v, {
20
28
  "agentic_index": "agenticIndex",
@@ -1,7 +1,18 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  import { UnifiedBenchmarkPricing } from "./unifiedbenchmarkpricing.js";
6
+ /**
7
+ * Benchmark source discriminator.
8
+ */
9
+ export declare const UnifiedBenchmarksDAItemSource: {
10
+ readonly DesignArena: "design-arena";
11
+ };
12
+ /**
13
+ * Benchmark source discriminator.
14
+ */
15
+ export type UnifiedBenchmarksDAItemSource = ClosedEnum<typeof UnifiedBenchmarksDAItemSource>;
5
16
  /**
6
17
  * Placement distribution from tournament matches.
7
18
  */
@@ -44,7 +55,7 @@ export type UnifiedBenchmarksDAItem = {
44
55
  /**
45
56
  * Benchmark source discriminator.
46
57
  */
47
- source: "design-arena";
58
+ source: UnifiedBenchmarksDAItemSource;
48
59
  /**
49
60
  * Placement distribution from tournament matches.
50
61
  */
@@ -55,6 +66,8 @@ export type UnifiedBenchmarksDAItem = {
55
66
  winRate: number;
56
67
  };
57
68
  /** @internal */
69
+ export declare const UnifiedBenchmarksDAItemSource$inboundSchema: z.ZodEnum<typeof UnifiedBenchmarksDAItemSource>;
70
+ /** @internal */
58
71
  export declare const TournamentStats$inboundSchema: z.ZodType<TournamentStats, unknown>;
59
72
  export declare function tournamentStatsFromJSON(jsonString: string): SafeParseResult<TournamentStats, SDKValidationError>;
60
73
  /** @internal */
@@ -6,6 +6,14 @@ 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 { UnifiedBenchmarkPricing$inboundSchema, } from "./unifiedbenchmarkpricing.js";
9
+ /**
10
+ * Benchmark source discriminator.
11
+ */
12
+ export const UnifiedBenchmarksDAItemSource = {
13
+ DesignArena: "design-arena",
14
+ };
15
+ /** @internal */
16
+ export const UnifiedBenchmarksDAItemSource$inboundSchema = z.enum(UnifiedBenchmarksDAItemSource);
9
17
  /** @internal */
10
18
  export const TournamentStats$inboundSchema = z.object({
11
19
  first_place: z.nullable(z.int()),
@@ -33,7 +41,7 @@ export const UnifiedBenchmarksDAItem$inboundSchema = z.object({
33
41
  elo: z.number(),
34
42
  model_permaslug: z.string(),
35
43
  pricing: z.nullable(UnifiedBenchmarkPricing$inboundSchema),
36
- source: z.literal("design-arena"),
44
+ source: UnifiedBenchmarksDAItemSource$inboundSchema,
37
45
  tournament_stats: z.lazy(() => TournamentStats$inboundSchema),
38
46
  win_rate: z.number(),
39
47
  }).transform((v) => {
@@ -5,7 +5,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
6
  * The source filter applied, or null when all sources are returned.
7
7
  */
8
- export declare const SourceEnum: {
8
+ export declare const UnifiedBenchmarksMetaSource: {
9
9
  readonly ArtificialAnalysis: "artificial-analysis";
10
10
  readonly DesignArena: "design-arena";
11
11
  readonly Openrouter: "openrouter";
@@ -13,7 +13,7 @@ export declare const SourceEnum: {
13
13
  /**
14
14
  * The source filter applied, or null when all sources are returned.
15
15
  */
16
- export type SourceEnum = OpenEnum<typeof SourceEnum>;
16
+ export type UnifiedBenchmarksMetaSource = OpenEnum<typeof UnifiedBenchmarksMetaSource>;
17
17
  /**
18
18
  * Dataset version.
19
19
  */
@@ -40,7 +40,7 @@ export type UnifiedBenchmarksMeta = {
40
40
  /**
41
41
  * The source filter applied, or null when all sources are returned.
42
42
  */
43
- source: SourceEnum | null;
43
+ source: UnifiedBenchmarksMetaSource | null;
44
44
  /**
45
45
  * URL of the upstream data source, or null when results span multiple sources.
46
46
  */
@@ -55,7 +55,7 @@ export type UnifiedBenchmarksMeta = {
55
55
  version: UnifiedBenchmarksMetaVersion;
56
56
  };
57
57
  /** @internal */
58
- export declare const SourceEnum$inboundSchema: z.ZodType<SourceEnum, unknown>;
58
+ export declare const UnifiedBenchmarksMetaSource$inboundSchema: z.ZodType<UnifiedBenchmarksMetaSource, unknown>;
59
59
  /** @internal */
60
60
  export declare const UnifiedBenchmarksMetaVersion$inboundSchema: z.ZodEnum<typeof UnifiedBenchmarksMetaVersion>;
61
61
  /** @internal */
@@ -9,7 +9,7 @@ import * as openEnums from "../types/enums.js";
9
9
  /**
10
10
  * The source filter applied, or null when all sources are returned.
11
11
  */
12
- export const SourceEnum = {
12
+ export const UnifiedBenchmarksMetaSource = {
13
13
  ArtificialAnalysis: "artificial-analysis",
14
14
  DesignArena: "design-arena",
15
15
  Openrouter: "openrouter",
@@ -21,7 +21,7 @@ export const UnifiedBenchmarksMetaVersion = {
21
21
  V1: "v1",
22
22
  };
23
23
  /** @internal */
24
- export const SourceEnum$inboundSchema = openEnums.inboundSchema(SourceEnum);
24
+ export const UnifiedBenchmarksMetaSource$inboundSchema = openEnums.inboundSchema(UnifiedBenchmarksMetaSource);
25
25
  /** @internal */
26
26
  export const UnifiedBenchmarksMetaVersion$inboundSchema = z.enum(UnifiedBenchmarksMetaVersion);
27
27
  /** @internal */
@@ -29,7 +29,7 @@ export const UnifiedBenchmarksMeta$inboundSchema = z.object({
29
29
  as_of: z.string(),
30
30
  citation: z.nullable(z.string()),
31
31
  model_count: z.int(),
32
- source: z.nullable(SourceEnum$inboundSchema),
32
+ source: z.nullable(UnifiedBenchmarksMetaSource$inboundSchema),
33
33
  source_url: z.nullable(z.string()),
34
34
  task_type: z.nullable(z.string()),
35
35
  version: UnifiedBenchmarksMetaVersion$inboundSchema,
@@ -1,18 +1,28 @@
1
1
  import * as z from "zod/v4";
2
- import { OpenEnum } from "../types/enums.js";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
6
  * OpenRouter benchmark evaluation type.
7
7
  */
8
- export declare const BenchmarkType: {
8
+ export declare const UnifiedBenchmarksORItemBenchmarkType: {
9
9
  readonly GpqaDiamond: "gpqa_diamond";
10
10
  readonly TauBenchVerifiedAirline: "tau_bench_verified_airline";
11
11
  };
12
12
  /**
13
13
  * OpenRouter benchmark evaluation type.
14
14
  */
15
- export type BenchmarkType = OpenEnum<typeof BenchmarkType>;
15
+ export type UnifiedBenchmarksORItemBenchmarkType = OpenEnum<typeof UnifiedBenchmarksORItemBenchmarkType>;
16
+ /**
17
+ * Benchmark source discriminator.
18
+ */
19
+ export declare const UnifiedBenchmarksORItemSource: {
20
+ readonly Openrouter: "openrouter";
21
+ };
22
+ /**
23
+ * Benchmark source discriminator.
24
+ */
25
+ export type UnifiedBenchmarksORItemSource = ClosedEnum<typeof UnifiedBenchmarksORItemSource>;
16
26
  export type UnifiedBenchmarksORItem = {
17
27
  /**
18
28
  * Aggregate accuracy score from 0 to 1. Higher is better.
@@ -29,7 +39,7 @@ export type UnifiedBenchmarksORItem = {
29
39
  /**
30
40
  * OpenRouter benchmark evaluation type.
31
41
  */
32
- benchmarkType: BenchmarkType;
42
+ benchmarkType: UnifiedBenchmarksORItemBenchmarkType;
33
43
  /**
34
44
  * Human-readable model name.
35
45
  */
@@ -45,14 +55,16 @@ export type UnifiedBenchmarksORItem = {
45
55
  /**
46
56
  * Benchmark source discriminator.
47
57
  */
48
- source: "openrouter";
58
+ source: UnifiedBenchmarksORItemSource;
49
59
  /**
50
60
  * Total benchmark tasks across runs.
51
61
  */
52
62
  totalTasks: number;
53
63
  };
54
64
  /** @internal */
55
- export declare const BenchmarkType$inboundSchema: z.ZodType<BenchmarkType, unknown>;
65
+ export declare const UnifiedBenchmarksORItemBenchmarkType$inboundSchema: z.ZodType<UnifiedBenchmarksORItemBenchmarkType, unknown>;
66
+ /** @internal */
67
+ export declare const UnifiedBenchmarksORItemSource$inboundSchema: z.ZodEnum<typeof UnifiedBenchmarksORItemSource>;
56
68
  /** @internal */
57
69
  export declare const UnifiedBenchmarksORItem$inboundSchema: z.ZodType<UnifiedBenchmarksORItem, unknown>;
58
70
  export declare function unifiedBenchmarksORItemFromJSON(jsonString: string): SafeParseResult<UnifiedBenchmarksORItem, SDKValidationError>;
@@ -9,22 +9,30 @@ import * as openEnums from "../types/enums.js";
9
9
  /**
10
10
  * OpenRouter benchmark evaluation type.
11
11
  */
12
- export const BenchmarkType = {
12
+ export const UnifiedBenchmarksORItemBenchmarkType = {
13
13
  GpqaDiamond: "gpqa_diamond",
14
14
  TauBenchVerifiedAirline: "tau_bench_verified_airline",
15
15
  };
16
+ /**
17
+ * Benchmark source discriminator.
18
+ */
19
+ export const UnifiedBenchmarksORItemSource = {
20
+ Openrouter: "openrouter",
21
+ };
22
+ /** @internal */
23
+ export const UnifiedBenchmarksORItemBenchmarkType$inboundSchema = openEnums.inboundSchema(UnifiedBenchmarksORItemBenchmarkType);
16
24
  /** @internal */
17
- export const BenchmarkType$inboundSchema = openEnums.inboundSchema(BenchmarkType);
25
+ export const UnifiedBenchmarksORItemSource$inboundSchema = z.enum(UnifiedBenchmarksORItemSource);
18
26
  /** @internal */
19
27
  export const UnifiedBenchmarksORItem$inboundSchema = z.object({
20
28
  accuracy: z.number(),
21
29
  accuracy_stddev: z.nullable(z.number()),
22
30
  avg_cost_per_task: z.nullable(z.number()),
23
- benchmark_type: BenchmarkType$inboundSchema,
31
+ benchmark_type: UnifiedBenchmarksORItemBenchmarkType$inboundSchema,
24
32
  display_name: z.string(),
25
33
  last_run_timestamp: z.string(),
26
34
  model_permaslug: z.string(),
27
- source: z.literal("openrouter"),
35
+ source: UnifiedBenchmarksORItemSource$inboundSchema,
28
36
  total_tasks: z.int(),
29
37
  }).transform((v) => {
30
38
  return remap$(v, {
@@ -1,14 +1,14 @@
1
1
  import * as z from "zod/v4";
2
- import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
3
2
  import { Result as SafeParseResult } from "../types/fp.js";
4
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
4
  import { UnifiedBenchmarksAAItem } from "./unifiedbenchmarksaaitem.js";
6
5
  import { UnifiedBenchmarksDAItem } from "./unifiedbenchmarksdaitem.js";
7
6
  import { UnifiedBenchmarksMeta } from "./unifiedbenchmarksmeta.js";
8
7
  import { UnifiedBenchmarksORItem } from "./unifiedbenchmarksoritem.js";
9
- export type UnifiedBenchmarksResponseData = UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | discriminatedUnionTypes.Unknown<"source">;
8
+ import { UnifiedBenchmarksSearchItem } from "./unifiedbenchmarkssearchitem.js";
9
+ export type UnifiedBenchmarksResponseData = UnifiedBenchmarksSearchItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | UnifiedBenchmarksAAItem;
10
10
  export type UnifiedBenchmarksResponse = {
11
- data: Array<UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | discriminatedUnionTypes.Unknown<"source">>;
11
+ data: Array<UnifiedBenchmarksSearchItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | UnifiedBenchmarksAAItem>;
12
12
  meta: UnifiedBenchmarksMeta;
13
13
  };
14
14
  /** @internal */
@@ -4,27 +4,29 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
- import { discriminatedUnion } from "../types/discriminatedUnion.js";
8
7
  import { UnifiedBenchmarksAAItem$inboundSchema, } from "./unifiedbenchmarksaaitem.js";
9
8
  import { UnifiedBenchmarksDAItem$inboundSchema, } from "./unifiedbenchmarksdaitem.js";
10
9
  import { UnifiedBenchmarksMeta$inboundSchema, } from "./unifiedbenchmarksmeta.js";
11
10
  import { UnifiedBenchmarksORItem$inboundSchema, } from "./unifiedbenchmarksoritem.js";
11
+ import { UnifiedBenchmarksSearchItem$inboundSchema, } from "./unifiedbenchmarkssearchitem.js";
12
12
  /** @internal */
13
- export const UnifiedBenchmarksResponseData$inboundSchema = discriminatedUnion("source", {
14
- ["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema,
15
- ["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema,
16
- openrouter: UnifiedBenchmarksORItem$inboundSchema,
17
- });
13
+ export const UnifiedBenchmarksResponseData$inboundSchema = z.union([
14
+ UnifiedBenchmarksSearchItem$inboundSchema,
15
+ UnifiedBenchmarksDAItem$inboundSchema,
16
+ UnifiedBenchmarksORItem$inboundSchema,
17
+ UnifiedBenchmarksAAItem$inboundSchema,
18
+ ]);
18
19
  export function unifiedBenchmarksResponseDataFromJSON(jsonString) {
19
20
  return safeParse(jsonString, (x) => UnifiedBenchmarksResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedBenchmarksResponseData' from JSON`);
20
21
  }
21
22
  /** @internal */
22
23
  export const UnifiedBenchmarksResponse$inboundSchema = z.object({
23
- data: z.array(discriminatedUnion("source", {
24
- ["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema,
25
- ["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema,
26
- openrouter: UnifiedBenchmarksORItem$inboundSchema,
27
- })),
24
+ data: z.array(z.union([
25
+ UnifiedBenchmarksSearchItem$inboundSchema,
26
+ UnifiedBenchmarksDAItem$inboundSchema,
27
+ UnifiedBenchmarksORItem$inboundSchema,
28
+ UnifiedBenchmarksAAItem$inboundSchema,
29
+ ])),
28
30
  meta: UnifiedBenchmarksMeta$inboundSchema,
29
31
  });
30
32
  export function unifiedBenchmarksResponseFromJSON(jsonString) {
@@ -0,0 +1,116 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { UnifiedBenchmarksSearchRunConfig } from "./unifiedbenchmarkssearchrunconfig.js";
6
+ /**
7
+ * OpenRouter search benchmark.
8
+ */
9
+ export declare const UnifiedBenchmarksSearchItemBenchmarkType: {
10
+ readonly SearchBrowsecomp: "search_browsecomp";
11
+ readonly SearchHle: "search_hle";
12
+ readonly SearchDsqa: "search_dsqa";
13
+ readonly SearchWidesearch: "search_widesearch";
14
+ };
15
+ /**
16
+ * OpenRouter search benchmark.
17
+ */
18
+ export type UnifiedBenchmarksSearchItemBenchmarkType = OpenEnum<typeof UnifiedBenchmarksSearchItemBenchmarkType>;
19
+ /**
20
+ * Identifies the meaning of `primary_score`: `f1_by_item` for WideSearch, `accuracy` for all other search benchmarks.
21
+ */
22
+ export declare const PrimaryMetric: {
23
+ readonly Accuracy: "accuracy";
24
+ readonly F1ByItem: "f1_by_item";
25
+ };
26
+ /**
27
+ * Identifies the meaning of `primary_score`: `f1_by_item` for WideSearch, `accuracy` for all other search benchmarks.
28
+ */
29
+ export type PrimaryMetric = OpenEnum<typeof PrimaryMetric>;
30
+ /**
31
+ * Request surface the published configuration went through.
32
+ */
33
+ export declare const SearchSurface: {
34
+ readonly ServerTool: "server-tool";
35
+ readonly Plugin: "plugin";
36
+ };
37
+ /**
38
+ * Request surface the published configuration went through.
39
+ */
40
+ export type SearchSurface = OpenEnum<typeof SearchSurface>;
41
+ /**
42
+ * Benchmark source discriminator.
43
+ */
44
+ export declare const UnifiedBenchmarksSearchItemSource: {
45
+ readonly Openrouter: "openrouter";
46
+ };
47
+ /**
48
+ * Benchmark source discriminator.
49
+ */
50
+ export type UnifiedBenchmarksSearchItemSource = ClosedEnum<typeof UnifiedBenchmarksSearchItemSource>;
51
+ export type UnifiedBenchmarksSearchItem = {
52
+ /**
53
+ * Average cost per task in USD, or null if unavailable.
54
+ */
55
+ avgCostPerTask: number | null;
56
+ /**
57
+ * Average wall-clock latency per task in milliseconds, or null if unavailable.
58
+ */
59
+ avgLatencyPerTaskMs: number | null;
60
+ /**
61
+ * OpenRouter search benchmark.
62
+ */
63
+ benchmarkType: UnifiedBenchmarksSearchItemBenchmarkType;
64
+ /**
65
+ * Human-readable model name.
66
+ */
67
+ displayName: string;
68
+ /**
69
+ * Timestamp of the newest qualifying run in the published configuration's lane.
70
+ */
71
+ lastRunTimestamp: string;
72
+ /**
73
+ * Stable OpenRouter model identifier.
74
+ */
75
+ modelPermaslug: string;
76
+ /**
77
+ * Identifies the meaning of `primary_score`: `f1_by_item` for WideSearch, `accuracy` for all other search benchmarks.
78
+ */
79
+ primaryMetric: PrimaryMetric;
80
+ /**
81
+ * The benchmark's headline score from 0 to 1. Its meaning is identified by `primary_metric`: item-weighted F1 for WideSearch or strict accuracy for the other search benchmarks. Higher is better.
82
+ */
83
+ primaryScore: number;
84
+ /**
85
+ * Published lane configuration, included only when include_run_config=true. Only the agent turn count, reasoning effort, and temperature are exposed; other harness settings are intentionally not part of the public contract.
86
+ */
87
+ runConfig?: UnifiedBenchmarksSearchRunConfig | undefined;
88
+ /**
89
+ * Search engine the published configuration used.
90
+ */
91
+ searchEngine: string;
92
+ /**
93
+ * Request surface the published configuration went through.
94
+ */
95
+ searchSurface: SearchSurface;
96
+ /**
97
+ * Benchmark source discriminator.
98
+ */
99
+ source: UnifiedBenchmarksSearchItemSource;
100
+ /**
101
+ * Tasks evaluated across the published configuration's runs.
102
+ */
103
+ totalTasks: number;
104
+ };
105
+ /** @internal */
106
+ export declare const UnifiedBenchmarksSearchItemBenchmarkType$inboundSchema: z.ZodType<UnifiedBenchmarksSearchItemBenchmarkType, unknown>;
107
+ /** @internal */
108
+ export declare const PrimaryMetric$inboundSchema: z.ZodType<PrimaryMetric, unknown>;
109
+ /** @internal */
110
+ export declare const SearchSurface$inboundSchema: z.ZodType<SearchSurface, unknown>;
111
+ /** @internal */
112
+ export declare const UnifiedBenchmarksSearchItemSource$inboundSchema: z.ZodEnum<typeof UnifiedBenchmarksSearchItemSource>;
113
+ /** @internal */
114
+ export declare const UnifiedBenchmarksSearchItem$inboundSchema: z.ZodType<UnifiedBenchmarksSearchItem, unknown>;
115
+ export declare function unifiedBenchmarksSearchItemFromJSON(jsonString: string): SafeParseResult<UnifiedBenchmarksSearchItem, SDKValidationError>;
116
+ //# sourceMappingURL=unifiedbenchmarkssearchitem.d.ts.map
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e2eb8d09d854
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
+ import { UnifiedBenchmarksSearchRunConfig$inboundSchema, } from "./unifiedbenchmarkssearchrunconfig.js";
10
+ /**
11
+ * OpenRouter search benchmark.
12
+ */
13
+ export const UnifiedBenchmarksSearchItemBenchmarkType = {
14
+ SearchBrowsecomp: "search_browsecomp",
15
+ SearchHle: "search_hle",
16
+ SearchDsqa: "search_dsqa",
17
+ SearchWidesearch: "search_widesearch",
18
+ };
19
+ /**
20
+ * Identifies the meaning of `primary_score`: `f1_by_item` for WideSearch, `accuracy` for all other search benchmarks.
21
+ */
22
+ export const PrimaryMetric = {
23
+ Accuracy: "accuracy",
24
+ F1ByItem: "f1_by_item",
25
+ };
26
+ /**
27
+ * Request surface the published configuration went through.
28
+ */
29
+ export const SearchSurface = {
30
+ ServerTool: "server-tool",
31
+ Plugin: "plugin",
32
+ };
33
+ /**
34
+ * Benchmark source discriminator.
35
+ */
36
+ export const UnifiedBenchmarksSearchItemSource = {
37
+ Openrouter: "openrouter",
38
+ };
39
+ /** @internal */
40
+ export const UnifiedBenchmarksSearchItemBenchmarkType$inboundSchema = openEnums.inboundSchema(UnifiedBenchmarksSearchItemBenchmarkType);
41
+ /** @internal */
42
+ export const PrimaryMetric$inboundSchema = openEnums.inboundSchema(PrimaryMetric);
43
+ /** @internal */
44
+ export const SearchSurface$inboundSchema = openEnums.inboundSchema(SearchSurface);
45
+ /** @internal */
46
+ export const UnifiedBenchmarksSearchItemSource$inboundSchema = z.enum(UnifiedBenchmarksSearchItemSource);
47
+ /** @internal */
48
+ export const UnifiedBenchmarksSearchItem$inboundSchema = z.object({
49
+ avg_cost_per_task: z.nullable(z.number()),
50
+ avg_latency_per_task_ms: z.nullable(z.number()),
51
+ benchmark_type: UnifiedBenchmarksSearchItemBenchmarkType$inboundSchema,
52
+ display_name: z.string(),
53
+ last_run_timestamp: z.string(),
54
+ model_permaslug: z.string(),
55
+ primary_metric: PrimaryMetric$inboundSchema,
56
+ primary_score: z.number(),
57
+ run_config: UnifiedBenchmarksSearchRunConfig$inboundSchema.optional(),
58
+ search_engine: z.string(),
59
+ search_surface: SearchSurface$inboundSchema,
60
+ source: UnifiedBenchmarksSearchItemSource$inboundSchema,
61
+ total_tasks: z.int(),
62
+ }).transform((v) => {
63
+ return remap$(v, {
64
+ "avg_cost_per_task": "avgCostPerTask",
65
+ "avg_latency_per_task_ms": "avgLatencyPerTaskMs",
66
+ "benchmark_type": "benchmarkType",
67
+ "display_name": "displayName",
68
+ "last_run_timestamp": "lastRunTimestamp",
69
+ "model_permaslug": "modelPermaslug",
70
+ "primary_metric": "primaryMetric",
71
+ "primary_score": "primaryScore",
72
+ "run_config": "runConfig",
73
+ "search_engine": "searchEngine",
74
+ "search_surface": "searchSurface",
75
+ "total_tasks": "totalTasks",
76
+ });
77
+ });
78
+ export function unifiedBenchmarksSearchItemFromJSON(jsonString) {
79
+ return safeParse(jsonString, (x) => UnifiedBenchmarksSearchItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedBenchmarksSearchItem' from JSON`);
80
+ }
81
+ //# sourceMappingURL=unifiedbenchmarkssearchitem.js.map
@@ -0,0 +1,24 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Published lane configuration, included only when include_run_config=true. Only the agent turn count, reasoning effort, and temperature are exposed; other harness settings are intentionally not part of the public contract.
6
+ */
7
+ export type UnifiedBenchmarksSearchRunConfig = {
8
+ /**
9
+ * Agent-turn count for the published lane, or null for plugin lanes.
10
+ */
11
+ maxAgentTurns: number | null;
12
+ /**
13
+ * Reasoning effort configured for the published lane, or null when omitted.
14
+ */
15
+ reasoningEffort: string | null;
16
+ /**
17
+ * Sampling temperature configured for the published lane, or null when omitted.
18
+ */
19
+ temperature: number | null;
20
+ };
21
+ /** @internal */
22
+ export declare const UnifiedBenchmarksSearchRunConfig$inboundSchema: z.ZodType<UnifiedBenchmarksSearchRunConfig, unknown>;
23
+ export declare function unifiedBenchmarksSearchRunConfigFromJSON(jsonString: string): SafeParseResult<UnifiedBenchmarksSearchRunConfig, SDKValidationError>;
24
+ //# sourceMappingURL=unifiedbenchmarkssearchrunconfig.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3dc944947337
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 UnifiedBenchmarksSearchRunConfig$inboundSchema = z.object({
10
+ max_agent_turns: z.nullable(z.int()),
11
+ reasoning_effort: z.nullable(z.string()),
12
+ temperature: z.nullable(z.number()),
13
+ }).transform((v) => {
14
+ return remap$(v, {
15
+ "max_agent_turns": "maxAgentTurns",
16
+ "reasoning_effort": "reasoningEffort",
17
+ });
18
+ });
19
+ export function unifiedBenchmarksSearchRunConfigFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => UnifiedBenchmarksSearchRunConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedBenchmarksSearchRunConfig' from JSON`);
21
+ }
22
+ //# sourceMappingURL=unifiedbenchmarkssearchrunconfig.js.map
@@ -6,7 +6,7 @@ export declare class Benchmarks extends ClientSDK {
6
6
  * List Benchmarks
7
7
  *
8
8
  * @remarks
9
- * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench and GPQA evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
9
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter's search benchmarks, which publish each model's highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
10
10
  */
11
11
  getBenchmarks(request?: operations.GetBenchmarksRequest | undefined, options?: RequestOptions): Promise<models.UnifiedBenchmarksResponse>;
12
12
  }
@@ -10,7 +10,7 @@ export class Benchmarks extends ClientSDK {
10
10
  * List Benchmarks
11
11
  *
12
12
  * @remarks
13
- * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench and GPQA evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
13
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter's search benchmarks, which publish each model's highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
14
14
  */
15
15
  async getBenchmarks(request, options) {
16
16
  return unwrapAsync(benchmarksGetBenchmarks(this, request, options));
@@ -7,7 +7,7 @@ export declare class Generations extends ClientSDK {
7
7
  */
8
8
  getGeneration(request: operations.GetGenerationRequest, options?: RequestOptions): Promise<models.GenerationResponse>;
9
9
  /**
10
- * Get stored prompt and completion content for a generation
10
+ * Get stored prompt, completion, and error content for a generation
11
11
  */
12
12
  listGenerationContent(request: operations.ListGenerationContentRequest, options?: RequestOptions): Promise<models.GenerationContentResponse>;
13
13
  /**
@@ -15,7 +15,7 @@ export class Generations extends ClientSDK {
15
15
  return unwrapAsync(generationsGetGeneration(this, request, options));
16
16
  }
17
17
  /**
18
- * Get stored prompt and completion content for a generation
18
+ * Get stored prompt, completion, and error content for a generation
19
19
  */
20
20
  async listGenerationContent(request, options) {
21
21
  return unwrapAsync(generationsListGenerationContent(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.23",
5
+ "version": "1.2.25",
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.2.23",
3
+ "version": "1.2.25",
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",
75
75
  "prepublishOnly": "npm run build",
76
+ "compile": "tsc",
77
+ "postinstall": "node scripts/check-types.js || true",
76
78
  "test": "vitest --run --project unit",
77
79
  "test:e2e": "vitest --run --project e2e",
78
- "test:watch": "vitest --watch --project unit",
79
- "typecheck:transit": "exit 0",
80
+ "typecheck": "tsc --noEmit",
80
81
  "prepare": "npm run build",
81
82
  "test:transit": "exit 0",
82
- "typecheck": "tsc --noEmit",
83
- "compile": "tsc",
84
- "postinstall": "node scripts/check-types.js || true"
83
+ "test:watch": "vitest --watch --project unit",
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {