@openrouter/sdk 1.1.17 → 1.1.18
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.
- package/esm/funcs/benchmarksGetBenchmarks.d.ts +1 -1
- package/esm/funcs/benchmarksGetBenchmarks.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/operations/getbenchmarks.d.ts +1 -0
- package/esm/models/operations/getbenchmarks.js +1 -0
- package/esm/models/unifiedbenchmarksmeta.d.ts +1 -0
- package/esm/models/unifiedbenchmarksmeta.js +1 -0
- package/esm/models/unifiedbenchmarksoritem.d.ts +59 -0
- package/esm/models/unifiedbenchmarksoritem.js +43 -0
- package/esm/models/unifiedbenchmarksresponse.d.ts +3 -2
- package/esm/models/unifiedbenchmarksresponse.js +3 -0
- package/esm/sdk/benchmarks.d.ts +1 -1
- package/esm/sdk/benchmarks.js +1 -1
- package/jsr.json +1 -1
- 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). 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 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.
|
|
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). 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 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.
|
|
21
21
|
*/
|
|
22
22
|
export function benchmarksGetBenchmarks(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.1.
|
|
52
|
+
readonly sdkVersion: "1.1.18";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.1.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.1.18 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.1.
|
|
29
|
+
sdkVersion: "1.1.18",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.1.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.1.18 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -523,6 +523,7 @@ export * from "./unifiedbenchmarkpricing.js";
|
|
|
523
523
|
export * from "./unifiedbenchmarksaaitem.js";
|
|
524
524
|
export * from "./unifiedbenchmarksdaitem.js";
|
|
525
525
|
export * from "./unifiedbenchmarksmeta.js";
|
|
526
|
+
export * from "./unifiedbenchmarksoritem.js";
|
|
526
527
|
export * from "./unifiedbenchmarksresponse.js";
|
|
527
528
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
528
529
|
export * from "./updatebyokkeyrequest.js";
|
package/esm/models/index.js
CHANGED
|
@@ -527,6 +527,7 @@ export * from "./unifiedbenchmarkpricing.js";
|
|
|
527
527
|
export * from "./unifiedbenchmarksaaitem.js";
|
|
528
528
|
export * from "./unifiedbenchmarksdaitem.js";
|
|
529
529
|
export * from "./unifiedbenchmarksmeta.js";
|
|
530
|
+
export * from "./unifiedbenchmarksoritem.js";
|
|
530
531
|
export * from "./unifiedbenchmarksresponse.js";
|
|
531
532
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
532
533
|
export * from "./updatebyokkeyrequest.js";
|
|
@@ -27,6 +27,7 @@ export type GetBenchmarksGlobals = {
|
|
|
27
27
|
export declare const Source: {
|
|
28
28
|
readonly ArtificialAnalysis: "artificial-analysis";
|
|
29
29
|
readonly DesignArena: "design-arena";
|
|
30
|
+
readonly Openrouter: "openrouter";
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
|
|
@@ -11,6 +11,7 @@ import * as openEnums from "../../types/enums.js";
|
|
|
11
11
|
export const Source = {
|
|
12
12
|
ArtificialAnalysis: "artificial-analysis",
|
|
13
13
|
DesignArena: "design-arena",
|
|
14
|
+
Openrouter: "openrouter",
|
|
14
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.
|
|
@@ -8,6 +8,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
8
8
|
export declare const SourceEnum: {
|
|
9
9
|
readonly ArtificialAnalysis: "artificial-analysis";
|
|
10
10
|
readonly DesignArena: "design-arena";
|
|
11
|
+
readonly Openrouter: "openrouter";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* The source filter applied, or null when all sources are returned.
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* OpenRouter benchmark evaluation type.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BenchmarkType: {
|
|
9
|
+
readonly GpqaDiamond: "gpqa_diamond";
|
|
10
|
+
readonly TauBenchVerifiedAirline: "tau_bench_verified_airline";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* OpenRouter benchmark evaluation type.
|
|
14
|
+
*/
|
|
15
|
+
export type BenchmarkType = OpenEnum<typeof BenchmarkType>;
|
|
16
|
+
export type UnifiedBenchmarksORItem = {
|
|
17
|
+
/**
|
|
18
|
+
* Aggregate accuracy score from 0 to 1. Higher is better.
|
|
19
|
+
*/
|
|
20
|
+
accuracy: number;
|
|
21
|
+
/**
|
|
22
|
+
* Standard deviation of run accuracy, or null for a single run.
|
|
23
|
+
*/
|
|
24
|
+
accuracyStddev: number | null;
|
|
25
|
+
/**
|
|
26
|
+
* Average cost per task in USD, or null if unavailable.
|
|
27
|
+
*/
|
|
28
|
+
avgCostPerTask: number | null;
|
|
29
|
+
/**
|
|
30
|
+
* OpenRouter benchmark evaluation type.
|
|
31
|
+
*/
|
|
32
|
+
benchmarkType: BenchmarkType;
|
|
33
|
+
/**
|
|
34
|
+
* Human-readable model name.
|
|
35
|
+
*/
|
|
36
|
+
displayName: string;
|
|
37
|
+
/**
|
|
38
|
+
* Timestamp of the most recent public benchmark run.
|
|
39
|
+
*/
|
|
40
|
+
lastRunTimestamp: string;
|
|
41
|
+
/**
|
|
42
|
+
* Stable OpenRouter model identifier.
|
|
43
|
+
*/
|
|
44
|
+
modelPermaslug: string;
|
|
45
|
+
/**
|
|
46
|
+
* Benchmark source discriminator.
|
|
47
|
+
*/
|
|
48
|
+
source: "openrouter";
|
|
49
|
+
/**
|
|
50
|
+
* Total benchmark tasks across runs.
|
|
51
|
+
*/
|
|
52
|
+
totalTasks: number;
|
|
53
|
+
};
|
|
54
|
+
/** @internal */
|
|
55
|
+
export declare const BenchmarkType$inboundSchema: z.ZodType<BenchmarkType, unknown>;
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare const UnifiedBenchmarksORItem$inboundSchema: z.ZodType<UnifiedBenchmarksORItem, unknown>;
|
|
58
|
+
export declare function unifiedBenchmarksORItemFromJSON(jsonString: string): SafeParseResult<UnifiedBenchmarksORItem, SDKValidationError>;
|
|
59
|
+
//# sourceMappingURL=unifiedbenchmarksoritem.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: be2fd0591b6b
|
|
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
|
+
* OpenRouter benchmark evaluation type.
|
|
11
|
+
*/
|
|
12
|
+
export const BenchmarkType = {
|
|
13
|
+
GpqaDiamond: "gpqa_diamond",
|
|
14
|
+
TauBenchVerifiedAirline: "tau_bench_verified_airline",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const BenchmarkType$inboundSchema = openEnums.inboundSchema(BenchmarkType);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const UnifiedBenchmarksORItem$inboundSchema = z.object({
|
|
20
|
+
accuracy: z.number(),
|
|
21
|
+
accuracy_stddev: z.nullable(z.number()),
|
|
22
|
+
avg_cost_per_task: z.nullable(z.number()),
|
|
23
|
+
benchmark_type: BenchmarkType$inboundSchema,
|
|
24
|
+
display_name: z.string(),
|
|
25
|
+
last_run_timestamp: z.string(),
|
|
26
|
+
model_permaslug: z.string(),
|
|
27
|
+
source: z.literal("openrouter"),
|
|
28
|
+
total_tasks: z.int(),
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
"accuracy_stddev": "accuracyStddev",
|
|
32
|
+
"avg_cost_per_task": "avgCostPerTask",
|
|
33
|
+
"benchmark_type": "benchmarkType",
|
|
34
|
+
"display_name": "displayName",
|
|
35
|
+
"last_run_timestamp": "lastRunTimestamp",
|
|
36
|
+
"model_permaslug": "modelPermaslug",
|
|
37
|
+
"total_tasks": "totalTasks",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function unifiedBenchmarksORItemFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => UnifiedBenchmarksORItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedBenchmarksORItem' from JSON`);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=unifiedbenchmarksoritem.js.map
|
|
@@ -5,9 +5,10 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
import { UnifiedBenchmarksAAItem } from "./unifiedbenchmarksaaitem.js";
|
|
6
6
|
import { UnifiedBenchmarksDAItem } from "./unifiedbenchmarksdaitem.js";
|
|
7
7
|
import { UnifiedBenchmarksMeta } from "./unifiedbenchmarksmeta.js";
|
|
8
|
-
|
|
8
|
+
import { UnifiedBenchmarksORItem } from "./unifiedbenchmarksoritem.js";
|
|
9
|
+
export type UnifiedBenchmarksResponseData = UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | discriminatedUnionTypes.Unknown<"source">;
|
|
9
10
|
export type UnifiedBenchmarksResponse = {
|
|
10
|
-
data: Array<UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem | discriminatedUnionTypes.Unknown<"source">>;
|
|
11
|
+
data: Array<UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem | UnifiedBenchmarksORItem | discriminatedUnionTypes.Unknown<"source">>;
|
|
11
12
|
meta: UnifiedBenchmarksMeta;
|
|
12
13
|
};
|
|
13
14
|
/** @internal */
|
|
@@ -8,10 +8,12 @@ import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
|
8
8
|
import { UnifiedBenchmarksAAItem$inboundSchema, } from "./unifiedbenchmarksaaitem.js";
|
|
9
9
|
import { UnifiedBenchmarksDAItem$inboundSchema, } from "./unifiedbenchmarksdaitem.js";
|
|
10
10
|
import { UnifiedBenchmarksMeta$inboundSchema, } from "./unifiedbenchmarksmeta.js";
|
|
11
|
+
import { UnifiedBenchmarksORItem$inboundSchema, } from "./unifiedbenchmarksoritem.js";
|
|
11
12
|
/** @internal */
|
|
12
13
|
export const UnifiedBenchmarksResponseData$inboundSchema = discriminatedUnion("source", {
|
|
13
14
|
["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema,
|
|
14
15
|
["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema,
|
|
16
|
+
openrouter: UnifiedBenchmarksORItem$inboundSchema,
|
|
15
17
|
});
|
|
16
18
|
export function unifiedBenchmarksResponseDataFromJSON(jsonString) {
|
|
17
19
|
return safeParse(jsonString, (x) => UnifiedBenchmarksResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedBenchmarksResponseData' from JSON`);
|
|
@@ -21,6 +23,7 @@ export const UnifiedBenchmarksResponse$inboundSchema = z.object({
|
|
|
21
23
|
data: z.array(discriminatedUnion("source", {
|
|
22
24
|
["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema,
|
|
23
25
|
["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema,
|
|
26
|
+
openrouter: UnifiedBenchmarksORItem$inboundSchema,
|
|
24
27
|
})),
|
|
25
28
|
meta: UnifiedBenchmarksMeta$inboundSchema,
|
|
26
29
|
});
|
package/esm/sdk/benchmarks.d.ts
CHANGED
|
@@ -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). 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 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.
|
|
10
10
|
*/
|
|
11
11
|
getBenchmarks(request?: operations.GetBenchmarksRequest | undefined, options?: RequestOptions): Promise<models.UnifiedBenchmarksResponse>;
|
|
12
12
|
}
|
package/esm/sdk/benchmarks.js
CHANGED
|
@@ -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). 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 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.
|
|
14
14
|
*/
|
|
15
15
|
async getBenchmarks(request, options) {
|
|
16
16
|
return unwrapAsync(benchmarksGetBenchmarks(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
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
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"prepare": "npm run build",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
79
76
|
"test:e2e": "vitest --run --project e2e",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
77
|
"test:watch": "vitest --watch --project unit",
|
|
82
78
|
"compile": "tsc",
|
|
79
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
80
|
+
"test:transit": "exit 0",
|
|
83
81
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
|
+
"prepare": "npm run build",
|
|
84
|
+
"test": "vitest --run --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|