@openrouter/sdk 0.13.14 → 0.13.16
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/providerpreferences.d.ts +13 -1
- package/esm/models/publicendpoint.d.ts +46 -0
- package/esm/models/publicendpoint.js +2 -0
- package/esm/models/publicpricing.d.ts +46 -0
- package/esm/models/publicpricing.js +2 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
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: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.16";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.16 2.884.4 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: "0.13.
|
|
29
|
+
sdkVersion: "0.13.16",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.16 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -32,13 +32,25 @@ export type Ignore = ProviderName | string;
|
|
|
32
32
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
33
33
|
*/
|
|
34
34
|
export type MaxPrice = {
|
|
35
|
+
/**
|
|
36
|
+
* Maximum price in USD per audio unit
|
|
37
|
+
*/
|
|
35
38
|
audio?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum price in USD per million completion tokens
|
|
41
|
+
*/
|
|
36
42
|
completion?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Maximum price in USD per image
|
|
45
|
+
*/
|
|
37
46
|
image?: string | undefined;
|
|
38
47
|
/**
|
|
39
|
-
*
|
|
48
|
+
* Maximum price in USD per million prompt tokens
|
|
40
49
|
*/
|
|
41
50
|
prompt?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Maximum price in USD per request
|
|
53
|
+
*/
|
|
42
54
|
request?: string | undefined;
|
|
43
55
|
};
|
|
44
56
|
export type Only = ProviderName | string;
|
|
@@ -7,19 +7,65 @@ import { Parameter } from "./parameter.js";
|
|
|
7
7
|
import { PercentileStats } from "./percentilestats.js";
|
|
8
8
|
import { ProviderName } from "./providername.js";
|
|
9
9
|
export type Pricing = {
|
|
10
|
+
/**
|
|
11
|
+
* Price in USD per audio input token
|
|
12
|
+
*/
|
|
10
13
|
audio?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Price in USD per audio output token
|
|
16
|
+
*/
|
|
11
17
|
audioOutput?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Price in USD per token for completion (output) generation
|
|
20
|
+
*/
|
|
12
21
|
completion: string;
|
|
22
|
+
/**
|
|
23
|
+
* Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)
|
|
24
|
+
*/
|
|
13
25
|
discount?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Price in USD per input image
|
|
28
|
+
*/
|
|
14
29
|
image?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Price in USD per output image
|
|
32
|
+
*/
|
|
15
33
|
imageOutput?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Price in USD per image token
|
|
36
|
+
*/
|
|
16
37
|
imageToken?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Price in USD per cached audio input token
|
|
40
|
+
*/
|
|
17
41
|
inputAudioCache?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Price in USD per cached input token (read)
|
|
44
|
+
*/
|
|
18
45
|
inputCacheRead?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.
|
|
48
|
+
*/
|
|
19
49
|
inputCacheWrite?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.
|
|
52
|
+
*/
|
|
53
|
+
inputCacheWrite1h?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Price in USD per internal reasoning token
|
|
56
|
+
*/
|
|
20
57
|
internalReasoning?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Price in USD per token for prompt (input) processing
|
|
60
|
+
*/
|
|
21
61
|
prompt: string;
|
|
62
|
+
/**
|
|
63
|
+
* Price in USD per request
|
|
64
|
+
*/
|
|
22
65
|
request?: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Price in USD per web search
|
|
68
|
+
*/
|
|
23
69
|
webSearch?: string | undefined;
|
|
24
70
|
};
|
|
25
71
|
export declare const PublicEndpointQuantization: {
|
|
@@ -33,6 +33,7 @@ export const Pricing$inboundSchema = z.object({
|
|
|
33
33
|
input_audio_cache: z.string().optional(),
|
|
34
34
|
input_cache_read: z.string().optional(),
|
|
35
35
|
input_cache_write: z.string().optional(),
|
|
36
|
+
input_cache_write_1h: z.string().optional(),
|
|
36
37
|
internal_reasoning: z.string().optional(),
|
|
37
38
|
prompt: z.string(),
|
|
38
39
|
request: z.string().optional(),
|
|
@@ -45,6 +46,7 @@ export const Pricing$inboundSchema = z.object({
|
|
|
45
46
|
"input_audio_cache": "inputAudioCache",
|
|
46
47
|
"input_cache_read": "inputCacheRead",
|
|
47
48
|
"input_cache_write": "inputCacheWrite",
|
|
49
|
+
"input_cache_write_1h": "inputCacheWrite1h",
|
|
48
50
|
"internal_reasoning": "internalReasoning",
|
|
49
51
|
"web_search": "webSearch",
|
|
50
52
|
});
|
|
@@ -5,19 +5,65 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
* Pricing information for the model
|
|
6
6
|
*/
|
|
7
7
|
export type PublicPricing = {
|
|
8
|
+
/**
|
|
9
|
+
* Price in USD per audio input token
|
|
10
|
+
*/
|
|
8
11
|
audio?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Price in USD per audio output token
|
|
14
|
+
*/
|
|
9
15
|
audioOutput?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Price in USD per token for completion (output) generation
|
|
18
|
+
*/
|
|
10
19
|
completion: string;
|
|
20
|
+
/**
|
|
21
|
+
* Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)
|
|
22
|
+
*/
|
|
11
23
|
discount?: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Price in USD per input image
|
|
26
|
+
*/
|
|
12
27
|
image?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Price in USD per output image
|
|
30
|
+
*/
|
|
13
31
|
imageOutput?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Price in USD per image token
|
|
34
|
+
*/
|
|
14
35
|
imageToken?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Price in USD per cached audio input token
|
|
38
|
+
*/
|
|
15
39
|
inputAudioCache?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Price in USD per cached input token (read)
|
|
42
|
+
*/
|
|
16
43
|
inputCacheRead?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.
|
|
46
|
+
*/
|
|
17
47
|
inputCacheWrite?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.
|
|
50
|
+
*/
|
|
51
|
+
inputCacheWrite1h?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Price in USD per internal reasoning token
|
|
54
|
+
*/
|
|
18
55
|
internalReasoning?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Price in USD per token for prompt (input) processing
|
|
58
|
+
*/
|
|
19
59
|
prompt: string;
|
|
60
|
+
/**
|
|
61
|
+
* Price in USD per request
|
|
62
|
+
*/
|
|
20
63
|
request?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Price in USD per web search
|
|
66
|
+
*/
|
|
21
67
|
webSearch?: string | undefined;
|
|
22
68
|
};
|
|
23
69
|
/** @internal */
|
|
@@ -18,6 +18,7 @@ export const PublicPricing$inboundSchema = z
|
|
|
18
18
|
input_audio_cache: z.string().optional(),
|
|
19
19
|
input_cache_read: z.string().optional(),
|
|
20
20
|
input_cache_write: z.string().optional(),
|
|
21
|
+
input_cache_write_1h: z.string().optional(),
|
|
21
22
|
internal_reasoning: z.string().optional(),
|
|
22
23
|
prompt: z.string(),
|
|
23
24
|
request: z.string().optional(),
|
|
@@ -30,6 +31,7 @@ export const PublicPricing$inboundSchema = z
|
|
|
30
31
|
"input_audio_cache": "inputAudioCache",
|
|
31
32
|
"input_cache_read": "inputCacheRead",
|
|
32
33
|
"input_cache_write": "inputCacheWrite",
|
|
34
|
+
"input_cache_write_1h": "inputCacheWrite1h",
|
|
33
35
|
"internal_reasoning": "internalReasoning",
|
|
34
36
|
"web_search": "webSearch",
|
|
35
37
|
});
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.16",
|
|
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": [
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"compile": "tsc",
|
|
77
77
|
"prepare": "npm run build",
|
|
78
|
+
"test": "vitest --run --project unit",
|
|
78
79
|
"test:e2e": "vitest --run --project e2e",
|
|
80
|
+
"test:watch": "vitest --watch --project unit",
|
|
81
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
79
82
|
"test:transit": "exit 0",
|
|
80
83
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"typecheck:transit": "exit 0"
|
|
82
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
83
|
-
"test": "vitest --run --project unit",
|
|
84
|
-
"test:watch": "vitest --watch --project unit"
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|