@openrouter/sdk 1.4.21 → 1.4.22
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.4.
|
|
53
|
+
readonly sdkVersion: "1.4.22";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.4.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.4.22 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.4.
|
|
32
|
+
sdkVersion: "1.4.22",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.4.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.4.22 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,9 +2,17 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ProviderName } from "./providername.js";
|
|
3
3
|
export type BatchProviderPreferencesOnly = ProviderName | string;
|
|
4
4
|
/**
|
|
5
|
-
* Batch provider routing preferences. Only `provider.only`
|
|
5
|
+
* Batch provider routing preferences. Only `provider.only` and `provider.allow_fallbacks` are supported.
|
|
6
6
|
*/
|
|
7
7
|
export type BatchProviderPreferences = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to allow backup providers to serve requests
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
|
|
13
|
+
* - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
|
14
|
+
*/
|
|
15
|
+
allowFallbacks?: boolean | null | undefined;
|
|
8
16
|
/**
|
|
9
17
|
* List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
|
|
10
18
|
*/
|
|
@@ -17,6 +25,7 @@ export declare const BatchProviderPreferencesOnly$outboundSchema: z.ZodType<Batc
|
|
|
17
25
|
export declare function batchProviderPreferencesOnlyToJSON(batchProviderPreferencesOnly: BatchProviderPreferencesOnly): string;
|
|
18
26
|
/** @internal */
|
|
19
27
|
export type BatchProviderPreferences$Outbound = {
|
|
28
|
+
allow_fallbacks?: boolean | null | undefined;
|
|
20
29
|
only?: Array<string | string> | null | undefined;
|
|
21
30
|
};
|
|
22
31
|
/** @internal */
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @generated-id: 250964898edb
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { ProviderName$outboundSchema } from "./providername.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const BatchProviderPreferencesOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
@@ -11,8 +12,13 @@ export function batchProviderPreferencesOnlyToJSON(batchProviderPreferencesOnly)
|
|
|
11
12
|
}
|
|
12
13
|
/** @internal */
|
|
13
14
|
export const BatchProviderPreferences$outboundSchema = z.object({
|
|
15
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
14
16
|
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
15
17
|
.optional(),
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return remap$(v, {
|
|
20
|
+
allowFallbacks: "allow_fallbacks",
|
|
21
|
+
});
|
|
16
22
|
});
|
|
17
23
|
export function batchProviderPreferencesToJSON(batchProviderPreferences) {
|
|
18
24
|
return JSON.stringify(BatchProviderPreferences$outboundSchema.parse(batchProviderPreferences));
|
|
@@ -29,7 +29,7 @@ export type BatchSubmitBody = {
|
|
|
29
29
|
endpoint: Endpoint;
|
|
30
30
|
model: string;
|
|
31
31
|
/**
|
|
32
|
-
* Batch provider routing preferences. Only `provider.only`
|
|
32
|
+
* Batch provider routing preferences. Only `provider.only` and `provider.allow_fallbacks` are supported.
|
|
33
33
|
*/
|
|
34
34
|
provider?: BatchProviderPreferences | null | undefined;
|
|
35
35
|
requests: Array<RequestT>;
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.22",
|
|
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,7 +73,6 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"prepare": "npm run build",
|
|
77
76
|
"test": "vitest --run --project unit",
|
|
78
77
|
"test:transit": "exit 0",
|
|
79
78
|
"typecheck": "tsc --noEmit",
|
|
@@ -81,7 +80,8 @@
|
|
|
81
80
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
82
81
|
"test:e2e": "vitest --run --project e2e",
|
|
83
82
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"postinstall": "node scripts/check-types.js || true"
|
|
83
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|