@openrouter/sdk 1.1.17 → 1.1.19
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/funcs/filesDelete.d.ts +1 -1
- package/esm/funcs/filesDelete.js +2 -1
- package/esm/funcs/filesDownload.d.ts +1 -1
- package/esm/funcs/filesDownload.js +2 -1
- package/esm/funcs/filesList.d.ts +1 -1
- package/esm/funcs/filesList.js +10 -3
- package/esm/funcs/filesRetrieve.d.ts +1 -1
- package/esm/funcs/filesRetrieve.js +2 -1
- package/esm/funcs/filesUpload.d.ts +1 -1
- package/esm/funcs/filesUpload.js +2 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/anthropicfile.d.ts +33 -0
- package/esm/models/anthropicfile.js +40 -0
- package/esm/models/anthropicfiledeleted.d.ts +22 -0
- package/esm/models/anthropicfiledeleted.js +26 -0
- package/esm/models/anthropicfilelist.d.ts +18 -0
- package/esm/models/anthropicfilelist.js +27 -0
- package/esm/models/filedeleteresponse.d.ts +6 -12
- package/esm/models/filedeleteresponse.js +9 -10
- package/esm/models/filelistresponse.d.ts +6 -12
- package/esm/models/filelistresponse.js +9 -16
- package/esm/models/fileprovider.d.ts +16 -0
- package/esm/models/fileprovider.js +15 -0
- package/esm/models/fileresponse.d.ts +21 -0
- package/esm/models/fileresponse.js +26 -0
- package/esm/models/index.d.ts +12 -1
- package/esm/models/index.js +12 -1
- package/esm/models/openaifile.d.ts +53 -0
- package/esm/models/openaifile.js +58 -0
- package/esm/models/openaifiledeleted.d.ts +23 -0
- package/esm/models/openaifiledeleted.js +27 -0
- package/esm/models/openaifilelist.d.ts +26 -0
- package/esm/models/openaifilelist.js +33 -0
- package/esm/models/openrouterfile.d.ts +33 -0
- package/esm/models/openrouterfile.js +39 -0
- package/esm/models/openrouterfiledeleted.d.ts +22 -0
- package/esm/models/openrouterfiledeleted.js +26 -0
- package/esm/models/openrouterfilelist.d.ts +22 -0
- package/esm/models/openrouterfilelist.js +28 -0
- package/esm/models/operations/deletefile.d.ts +6 -0
- package/esm/models/operations/deletefile.js +2 -0
- package/esm/models/operations/downloadfilecontent.d.ts +6 -0
- package/esm/models/operations/downloadfilecontent.js +2 -0
- package/esm/models/operations/getbenchmarks.d.ts +1 -0
- package/esm/models/operations/getbenchmarks.js +1 -0
- package/esm/models/operations/getfilemetadata.d.ts +6 -0
- package/esm/models/operations/getfilemetadata.js +2 -0
- package/esm/models/operations/listfiles.d.ts +39 -0
- package/esm/models/operations/listfiles.js +18 -0
- package/esm/models/operations/uploadfile.d.ts +6 -0
- package/esm/models/operations/uploadfile.js +2 -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/esm/sdk/files.d.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +4 -4
- package/esm/models/filemetadata.d.ts +0 -26
- package/esm/models/filemetadata.js +0 -33
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } 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 * as models from "../index.js";
|
|
@@ -23,6 +24,17 @@ export type ListFilesGlobals = {
|
|
|
23
24
|
*/
|
|
24
25
|
appCategories?: string | undefined;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Order: {
|
|
31
|
+
readonly Asc: "asc";
|
|
32
|
+
readonly Desc: "desc";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
36
|
+
*/
|
|
37
|
+
export type Order = OpenEnum<typeof Order>;
|
|
26
38
|
export type ListFilesRequest = {
|
|
27
39
|
/**
|
|
28
40
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -55,11 +67,33 @@ export type ListFilesRequest = {
|
|
|
55
67
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
56
68
|
*/
|
|
57
69
|
workspaceId?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
72
|
+
*/
|
|
73
|
+
provider?: models.FileProvider | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* OpenAI-style forward cursor: the id to list after.
|
|
76
|
+
*/
|
|
77
|
+
after?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Anthropic-style forward cursor: the id to list after.
|
|
80
|
+
*/
|
|
81
|
+
afterId?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Anthropic-style reverse cursor. Not supported by OpenRouter storage.
|
|
84
|
+
*/
|
|
85
|
+
beforeId?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
88
|
+
*/
|
|
89
|
+
order?: Order | undefined;
|
|
58
90
|
};
|
|
59
91
|
export type ListFilesResponse = {
|
|
60
92
|
result: models.FileListResponse;
|
|
61
93
|
};
|
|
62
94
|
/** @internal */
|
|
95
|
+
export declare const Order$outboundSchema: z.ZodType<string, Order>;
|
|
96
|
+
/** @internal */
|
|
63
97
|
export type ListFilesRequest$Outbound = {
|
|
64
98
|
"HTTP-Referer"?: string | undefined;
|
|
65
99
|
appTitle?: string | undefined;
|
|
@@ -67,6 +101,11 @@ export type ListFilesRequest$Outbound = {
|
|
|
67
101
|
limit?: number | undefined;
|
|
68
102
|
cursor?: string | undefined;
|
|
69
103
|
workspace_id?: string | undefined;
|
|
104
|
+
provider?: string | undefined;
|
|
105
|
+
after?: string | undefined;
|
|
106
|
+
after_id?: string | undefined;
|
|
107
|
+
before_id?: string | undefined;
|
|
108
|
+
order?: string | undefined;
|
|
70
109
|
};
|
|
71
110
|
/** @internal */
|
|
72
111
|
export declare const ListFilesRequest$outboundSchema: z.ZodType<ListFilesRequest$Outbound, ListFilesRequest>;
|
|
@@ -5,7 +5,18 @@
|
|
|
5
5
|
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
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
9
|
import * as models from "../index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
12
|
+
*/
|
|
13
|
+
export const Order = {
|
|
14
|
+
Asc: "asc",
|
|
15
|
+
Desc: "desc",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const Order$outboundSchema = openEnums
|
|
19
|
+
.outboundSchema(Order);
|
|
9
20
|
/** @internal */
|
|
10
21
|
export const ListFilesRequest$outboundSchema = z.object({
|
|
11
22
|
httpReferer: z.string().optional(),
|
|
@@ -14,10 +25,17 @@ export const ListFilesRequest$outboundSchema = z.object({
|
|
|
14
25
|
limit: z.int().optional(),
|
|
15
26
|
cursor: z.string().optional(),
|
|
16
27
|
workspaceId: z.string().optional(),
|
|
28
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
29
|
+
after: z.string().optional(),
|
|
30
|
+
afterId: z.string().optional(),
|
|
31
|
+
beforeId: z.string().optional(),
|
|
32
|
+
order: Order$outboundSchema.optional(),
|
|
17
33
|
}).transform((v) => {
|
|
18
34
|
return remap$(v, {
|
|
19
35
|
httpReferer: "HTTP-Referer",
|
|
20
36
|
workspaceId: "workspace_id",
|
|
37
|
+
afterId: "after_id",
|
|
38
|
+
beforeId: "before_id",
|
|
21
39
|
});
|
|
22
40
|
});
|
|
23
41
|
export function listFilesRequestToJSON(listFilesRequest) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
2
3
|
export type UploadFileGlobals = {
|
|
3
4
|
/**
|
|
4
5
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -51,6 +52,10 @@ export type UploadFileRequest = {
|
|
|
51
52
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
52
53
|
*/
|
|
53
54
|
workspaceId?: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
57
|
+
*/
|
|
58
|
+
provider?: models.FileProvider | undefined;
|
|
54
59
|
requestBody: UploadFileRequestBody;
|
|
55
60
|
};
|
|
56
61
|
/** @internal */
|
|
@@ -74,6 +79,7 @@ export type UploadFileRequest$Outbound = {
|
|
|
74
79
|
appTitle?: string | undefined;
|
|
75
80
|
appCategories?: string | undefined;
|
|
76
81
|
workspace_id?: string | undefined;
|
|
82
|
+
provider?: string | undefined;
|
|
77
83
|
RequestBody: UploadFileRequestBody$Outbound;
|
|
78
84
|
};
|
|
79
85
|
/** @internal */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { blobLikeSchema } from "../../types/blobs.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const UploadFileFile$outboundSchema = z.object({
|
|
10
11
|
fileName: z.string(),
|
|
@@ -31,6 +32,7 @@ export const UploadFileRequest$outboundSchema = z.object({
|
|
|
31
32
|
appTitle: z.string().optional(),
|
|
32
33
|
appCategories: z.string().optional(),
|
|
33
34
|
workspaceId: z.string().optional(),
|
|
35
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
34
36
|
requestBody: z.lazy(() => UploadFileRequestBody$outboundSchema),
|
|
35
37
|
}).transform((v) => {
|
|
36
38
|
return remap$(v, {
|
|
@@ -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/esm/sdk/files.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare class Files extends ClientSDK {
|
|
|
18
18
|
* @remarks
|
|
19
19
|
* Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.
|
|
20
20
|
*/
|
|
21
|
-
upload(request: operations.UploadFileRequest, options?: RequestOptions): Promise<models.
|
|
21
|
+
upload(request: operations.UploadFileRequest, options?: RequestOptions): Promise<models.FileResponse>;
|
|
22
22
|
/**
|
|
23
23
|
* Delete a file
|
|
24
24
|
*
|
|
@@ -32,7 +32,7 @@ export declare class Files extends ClientSDK {
|
|
|
32
32
|
* @remarks
|
|
33
33
|
* Retrieves metadata for a single file owned by the requesting workspace.
|
|
34
34
|
*/
|
|
35
|
-
retrieve(request: operations.GetFileMetadataRequest, options?: RequestOptions): Promise<models.
|
|
35
|
+
retrieve(request: operations.GetFileMetadataRequest, options?: RequestOptions): Promise<models.FileResponse>;
|
|
36
36
|
/**
|
|
37
37
|
* Download file content
|
|
38
38
|
*
|
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.19",
|
|
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,13 +73,13 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
76
|
+
"compile": "tsc",
|
|
77
77
|
"prepare": "npm run build",
|
|
78
78
|
"test": "vitest --run --project unit",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
79
|
"test:transit": "exit 0",
|
|
81
80
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
-
"
|
|
81
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
83
|
"typecheck": "tsc --noEmit",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const FileMetadataType: {
|
|
6
|
-
readonly File: "file";
|
|
7
|
-
};
|
|
8
|
-
export type FileMetadataType = ClosedEnum<typeof FileMetadataType>;
|
|
9
|
-
/**
|
|
10
|
-
* Metadata describing a stored file.
|
|
11
|
-
*/
|
|
12
|
-
export type FileMetadata = {
|
|
13
|
-
createdAt: string;
|
|
14
|
-
downloadable: boolean;
|
|
15
|
-
filename: string;
|
|
16
|
-
id: string;
|
|
17
|
-
mimeType: string;
|
|
18
|
-
sizeBytes: number;
|
|
19
|
-
type: FileMetadataType;
|
|
20
|
-
};
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare const FileMetadataType$inboundSchema: z.ZodEnum<typeof FileMetadataType>;
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare const FileMetadata$inboundSchema: z.ZodType<FileMetadata, unknown>;
|
|
25
|
-
export declare function fileMetadataFromJSON(jsonString: string): SafeParseResult<FileMetadata, SDKValidationError>;
|
|
26
|
-
//# sourceMappingURL=filemetadata.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 7a5c3a86d7a2
|
|
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
|
-
export const FileMetadataType = {
|
|
9
|
-
File: "file",
|
|
10
|
-
};
|
|
11
|
-
/** @internal */
|
|
12
|
-
export const FileMetadataType$inboundSchema = z.enum(FileMetadataType);
|
|
13
|
-
/** @internal */
|
|
14
|
-
export const FileMetadata$inboundSchema = z
|
|
15
|
-
.object({
|
|
16
|
-
created_at: z.string(),
|
|
17
|
-
downloadable: z.boolean(),
|
|
18
|
-
filename: z.string(),
|
|
19
|
-
id: z.string(),
|
|
20
|
-
mime_type: z.string(),
|
|
21
|
-
size_bytes: z.int(),
|
|
22
|
-
type: FileMetadataType$inboundSchema,
|
|
23
|
-
}).transform((v) => {
|
|
24
|
-
return remap$(v, {
|
|
25
|
-
"created_at": "createdAt",
|
|
26
|
-
"mime_type": "mimeType",
|
|
27
|
-
"size_bytes": "sizeBytes",
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
export function fileMetadataFromJSON(jsonString) {
|
|
31
|
-
return safeParse(jsonString, (x) => FileMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileMetadata' from JSON`);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=filemetadata.js.map
|