@openrouter/sdk 1.2.59 → 1.2.60
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 +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/pricingoverride.d.ts +17 -0
- package/esm/models/pricingoverride.js +15 -0
- package/jsr.json +1 -1
- package/package.json +9 -9
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.60";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.60 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.60",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.60 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,17 @@
|
|
|
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";
|
|
5
|
+
export declare const UtcDay: {
|
|
6
|
+
readonly Monday: "monday";
|
|
7
|
+
readonly Tuesday: "tuesday";
|
|
8
|
+
readonly Wednesday: "wednesday";
|
|
9
|
+
readonly Thursday: "thursday";
|
|
10
|
+
readonly Friday: "friday";
|
|
11
|
+
readonly Saturday: "saturday";
|
|
12
|
+
readonly Sunday: "sunday";
|
|
13
|
+
};
|
|
14
|
+
export type UtcDay = OpenEnum<typeof UtcDay>;
|
|
4
15
|
/**
|
|
5
16
|
* A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.
|
|
6
17
|
*/
|
|
@@ -37,6 +48,10 @@ export type PricingOverride = {
|
|
|
37
48
|
* Overridden price in USD per token for prompt (input) processing
|
|
38
49
|
*/
|
|
39
50
|
prompt?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day.
|
|
53
|
+
*/
|
|
54
|
+
utcDays?: Array<UtcDay> | undefined;
|
|
40
55
|
/**
|
|
41
56
|
* Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)
|
|
42
57
|
*/
|
|
@@ -47,6 +62,8 @@ export type PricingOverride = {
|
|
|
47
62
|
utcStart?: number | undefined;
|
|
48
63
|
};
|
|
49
64
|
/** @internal */
|
|
65
|
+
export declare const UtcDay$inboundSchema: z.ZodType<UtcDay, unknown>;
|
|
66
|
+
/** @internal */
|
|
50
67
|
export declare const PricingOverride$inboundSchema: z.ZodType<PricingOverride, unknown>;
|
|
51
68
|
export declare function pricingOverrideFromJSON(jsonString: string): SafeParseResult<PricingOverride, SDKValidationError>;
|
|
52
69
|
//# sourceMappingURL=pricingoverride.d.ts.map
|
|
@@ -5,6 +5,19 @@
|
|
|
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";
|
|
9
|
+
export const UtcDay = {
|
|
10
|
+
Monday: "monday",
|
|
11
|
+
Tuesday: "tuesday",
|
|
12
|
+
Wednesday: "wednesday",
|
|
13
|
+
Thursday: "thursday",
|
|
14
|
+
Friday: "friday",
|
|
15
|
+
Saturday: "saturday",
|
|
16
|
+
Sunday: "sunday",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const UtcDay$inboundSchema = openEnums
|
|
20
|
+
.inboundSchema(UtcDay);
|
|
8
21
|
/** @internal */
|
|
9
22
|
export const PricingOverride$inboundSchema = z.object({
|
|
10
23
|
audio: z.string().optional(),
|
|
@@ -15,6 +28,7 @@ export const PricingOverride$inboundSchema = z.object({
|
|
|
15
28
|
input_cache_write_1h: z.string().optional(),
|
|
16
29
|
min_prompt_tokens: z.number().optional(),
|
|
17
30
|
prompt: z.string().optional(),
|
|
31
|
+
utc_days: z.array(UtcDay$inboundSchema).optional(),
|
|
18
32
|
utc_end: z.number().optional(),
|
|
19
33
|
utc_start: z.number().optional(),
|
|
20
34
|
}).transform((v) => {
|
|
@@ -24,6 +38,7 @@ export const PricingOverride$inboundSchema = z.object({
|
|
|
24
38
|
"input_cache_write": "inputCacheWrite",
|
|
25
39
|
"input_cache_write_1h": "inputCacheWrite1h",
|
|
26
40
|
"min_prompt_tokens": "minPromptTokens",
|
|
41
|
+
"utc_days": "utcDays",
|
|
27
42
|
"utc_end": "utcEnd",
|
|
28
43
|
"utc_start": "utcStart",
|
|
29
44
|
});
|
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.60",
|
|
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",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"typecheck:transit": "exit 0",
|
|
77
|
+
"compile": "tsc",
|
|
78
|
+
"test": "vitest --run --project unit",
|
|
76
79
|
"test:e2e": "vitest --run --project e2e",
|
|
77
|
-
"test:transit": "exit 0",
|
|
78
80
|
"typecheck": "tsc --noEmit",
|
|
79
|
-
"
|
|
81
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
80
82
|
"prepare": "npm run build",
|
|
81
|
-
"test": "
|
|
82
|
-
"test:watch": "vitest --watch --project unit"
|
|
83
|
-
"typecheck:transit": "exit 0",
|
|
84
|
-
"postinstall": "node scripts/check-types.js || true"
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|