@openrouter/sdk 1.2.128 → 1.2.129
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/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.2.
|
|
53
|
+
readonly sdkVersion: "1.2.129";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.129 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.2.
|
|
32
|
+
sdkVersion: "1.2.129",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.129 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -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";
|
|
@@ -44,6 +45,12 @@ export type GetCurrentKeyRequest = {
|
|
|
44
45
|
*/
|
|
45
46
|
appCategories?: string | undefined;
|
|
46
47
|
};
|
|
48
|
+
export declare const AllowedDataRegion: {
|
|
49
|
+
readonly Global: "global";
|
|
50
|
+
readonly Europe: "europe";
|
|
51
|
+
readonly Us: "us";
|
|
52
|
+
};
|
|
53
|
+
export type AllowedDataRegion = OpenEnum<typeof AllowedDataRegion>;
|
|
47
54
|
/**
|
|
48
55
|
* Legacy rate limit information about a key. Will always return -1.
|
|
49
56
|
*
|
|
@@ -67,6 +74,10 @@ export type RateLimit = {
|
|
|
67
74
|
* Current API key information
|
|
68
75
|
*/
|
|
69
76
|
export type GetCurrentKeyData = {
|
|
77
|
+
/**
|
|
78
|
+
* Data regions permitted for this API key by the guardrail policies on the key and the account regional-routing entitlement. Empty when no region is permitted. Reflects region policy only: other key restrictions, such as management keys being blocked from inference, still apply.
|
|
79
|
+
*/
|
|
80
|
+
allowedDataRegions: Array<AllowedDataRegion>;
|
|
70
81
|
/**
|
|
71
82
|
* Total external BYOK usage (in USD) for the API key
|
|
72
83
|
*/
|
|
@@ -171,6 +182,8 @@ export type GetCurrentKeyRequest$Outbound = {
|
|
|
171
182
|
export declare const GetCurrentKeyRequest$outboundSchema: z.ZodType<GetCurrentKeyRequest$Outbound, GetCurrentKeyRequest>;
|
|
172
183
|
export declare function getCurrentKeyRequestToJSON(getCurrentKeyRequest: GetCurrentKeyRequest): string;
|
|
173
184
|
/** @internal */
|
|
185
|
+
export declare const AllowedDataRegion$inboundSchema: z.ZodType<AllowedDataRegion, unknown>;
|
|
186
|
+
/** @internal */
|
|
174
187
|
export declare const RateLimit$inboundSchema: z.ZodType<RateLimit, unknown>;
|
|
175
188
|
export declare function rateLimitFromJSON(jsonString: string): SafeParseResult<RateLimit, SDKValidationError>;
|
|
176
189
|
/** @internal */
|
|
@@ -5,7 +5,13 @@
|
|
|
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
|
+
export const AllowedDataRegion = {
|
|
11
|
+
Global: "global",
|
|
12
|
+
Europe: "europe",
|
|
13
|
+
Us: "us",
|
|
14
|
+
};
|
|
9
15
|
/** @internal */
|
|
10
16
|
export const GetCurrentKeyRequest$outboundSchema = z.object({
|
|
11
17
|
httpReferer: z.string().optional(),
|
|
@@ -20,6 +26,8 @@ export function getCurrentKeyRequestToJSON(getCurrentKeyRequest) {
|
|
|
20
26
|
return JSON.stringify(GetCurrentKeyRequest$outboundSchema.parse(getCurrentKeyRequest));
|
|
21
27
|
}
|
|
22
28
|
/** @internal */
|
|
29
|
+
export const AllowedDataRegion$inboundSchema = openEnums.inboundSchema(AllowedDataRegion);
|
|
30
|
+
/** @internal */
|
|
23
31
|
export const RateLimit$inboundSchema = z.object({
|
|
24
32
|
interval: z.string(),
|
|
25
33
|
note: z.string(),
|
|
@@ -30,6 +38,7 @@ export function rateLimitFromJSON(jsonString) {
|
|
|
30
38
|
}
|
|
31
39
|
/** @internal */
|
|
32
40
|
export const GetCurrentKeyData$inboundSchema = z.object({
|
|
41
|
+
allowed_data_regions: z.array(AllowedDataRegion$inboundSchema),
|
|
33
42
|
byok_usage: z.number(),
|
|
34
43
|
byok_usage_daily: z.number(),
|
|
35
44
|
byok_usage_monthly: z.number(),
|
|
@@ -52,6 +61,7 @@ export const GetCurrentKeyData$inboundSchema = z.object({
|
|
|
52
61
|
usage_weekly: z.number(),
|
|
53
62
|
}).transform((v) => {
|
|
54
63
|
return remap$(v, {
|
|
64
|
+
"allowed_data_regions": "allowedDataRegions",
|
|
55
65
|
"byok_usage": "byokUsage",
|
|
56
66
|
"byok_usage_daily": "byokUsageDaily",
|
|
57
67
|
"byok_usage_monthly": "byokUsageMonthly",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.129",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
77
|
"prepare": "npm run build",
|
|
78
|
+
"test": "vitest --run --project unit",
|
|
78
79
|
"test:e2e": "vitest --run --project e2e",
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
79
81
|
"test:transit": "exit 0",
|
|
80
82
|
"test:watch": "vitest --watch --project unit",
|
|
81
|
-
"typecheck": "tsc --noEmit",
|
|
82
83
|
"typecheck:transit": "exit 0",
|
|
83
|
-
"compile": "tsc"
|
|
84
|
-
"test": "vitest --run --project unit"
|
|
84
|
+
"compile": "tsc"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|