@openrouter/sdk 1.2.79 → 1.2.81
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/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/publicendpoint.d.ts +5 -0
- package/esm/models/publicendpoint.js +3 -0
- package/esm/models/toolchoicesupport.d.ts +28 -0
- package/esm/models/toolchoicesupport.js +17 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
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.81";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.81 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.81",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.81 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -72,6 +72,7 @@ export declare const BYOKProviderSlug: {
|
|
|
72
72
|
readonly Nextbit: "nextbit";
|
|
73
73
|
readonly Novita: "novita";
|
|
74
74
|
readonly Nvidia: "nvidia";
|
|
75
|
+
readonly Ollama: "ollama";
|
|
75
76
|
readonly OpenInference: "open-inference";
|
|
76
77
|
readonly Openai: "openai";
|
|
77
78
|
readonly Parasail: "parasail";
|
|
@@ -284,6 +284,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
284
284
|
octoai?: {
|
|
285
285
|
[k: string]: any;
|
|
286
286
|
} | undefined;
|
|
287
|
+
ollama?: {
|
|
288
|
+
[k: string]: any;
|
|
289
|
+
} | undefined;
|
|
287
290
|
openInference?: {
|
|
288
291
|
[k: string]: any;
|
|
289
292
|
} | undefined;
|
|
@@ -740,6 +743,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
740
743
|
octoai?: {
|
|
741
744
|
[k: string]: any;
|
|
742
745
|
} | undefined;
|
|
746
|
+
ollama?: {
|
|
747
|
+
[k: string]: any;
|
|
748
|
+
} | undefined;
|
|
743
749
|
"open-inference"?: {
|
|
744
750
|
[k: string]: any;
|
|
745
751
|
} | undefined;
|
|
@@ -111,6 +111,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
111
111
|
novita: z.record(z.string(), z.any()).optional(),
|
|
112
112
|
nvidia: z.record(z.string(), z.any()).optional(),
|
|
113
113
|
octoai: z.record(z.string(), z.any()).optional(),
|
|
114
|
+
ollama: z.record(z.string(), z.any()).optional(),
|
|
114
115
|
openInference: z.record(z.string(), z.any()).optional(),
|
|
115
116
|
openai: z.record(z.string(), z.any()).optional(),
|
|
116
117
|
parasail: z.record(z.string(), z.any()).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -558,6 +558,7 @@ export * from "./textdoneevent.js";
|
|
|
558
558
|
export * from "./textextendedconfig.js";
|
|
559
559
|
export * from "./toolcallstatus.js";
|
|
560
560
|
export * from "./toolchoiceallowed.js";
|
|
561
|
+
export * from "./toolchoicesupport.js";
|
|
561
562
|
export * from "./toolsearchservertool.js";
|
|
562
563
|
export * from "./toolsearchservertoolconfig.js";
|
|
563
564
|
export * from "./toomanyrequestsresponseerrordata.js";
|
package/esm/models/index.js
CHANGED
|
@@ -562,6 +562,7 @@ export * from "./textdoneevent.js";
|
|
|
562
562
|
export * from "./textextendedconfig.js";
|
|
563
563
|
export * from "./toolcallstatus.js";
|
|
564
564
|
export * from "./toolchoiceallowed.js";
|
|
565
|
+
export * from "./toolchoicesupport.js";
|
|
565
566
|
export * from "./toolsearchservertool.js";
|
|
566
567
|
export * from "./toolsearchservertoolconfig.js";
|
|
567
568
|
export * from "./toomanyrequestsresponseerrordata.js";
|
|
@@ -96,6 +96,7 @@ export declare const Provider: {
|
|
|
96
96
|
readonly Nextbit: "nextbit";
|
|
97
97
|
readonly Novita: "novita";
|
|
98
98
|
readonly Nvidia: "nvidia";
|
|
99
|
+
readonly Ollama: "ollama";
|
|
99
100
|
readonly OpenInference: "open-inference";
|
|
100
101
|
readonly Openai: "openai";
|
|
101
102
|
readonly Parasail: "parasail";
|
|
@@ -71,6 +71,7 @@ export declare const ProviderName: {
|
|
|
71
71
|
readonly NextBit: "NextBit";
|
|
72
72
|
readonly Novita: "Novita";
|
|
73
73
|
readonly Nvidia: "Nvidia";
|
|
74
|
+
readonly Ollama: "Ollama";
|
|
74
75
|
readonly OpenAI: "OpenAI";
|
|
75
76
|
readonly OpenInference: "OpenInference";
|
|
76
77
|
readonly Parasail: "Parasail";
|
|
@@ -279,6 +279,9 @@ export type ProviderOptions = {
|
|
|
279
279
|
octoai?: {
|
|
280
280
|
[k: string]: any;
|
|
281
281
|
} | undefined;
|
|
282
|
+
ollama?: {
|
|
283
|
+
[k: string]: any;
|
|
284
|
+
} | undefined;
|
|
282
285
|
openInference?: {
|
|
283
286
|
[k: string]: any;
|
|
284
287
|
} | undefined;
|
|
@@ -690,6 +693,9 @@ export type ProviderOptions$Outbound = {
|
|
|
690
693
|
octoai?: {
|
|
691
694
|
[k: string]: any;
|
|
692
695
|
} | undefined;
|
|
696
|
+
ollama?: {
|
|
697
|
+
[k: string]: any;
|
|
698
|
+
} | undefined;
|
|
693
699
|
"open-inference"?: {
|
|
694
700
|
[k: string]: any;
|
|
695
701
|
} | undefined;
|
|
@@ -98,6 +98,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
98
98
|
novita: z.record(z.string(), z.any()).optional(),
|
|
99
99
|
nvidia: z.record(z.string(), z.any()).optional(),
|
|
100
100
|
octoai: z.record(z.string(), z.any()).optional(),
|
|
101
|
+
ollama: z.record(z.string(), z.any()).optional(),
|
|
101
102
|
openInference: z.record(z.string(), z.any()).optional(),
|
|
102
103
|
openai: z.record(z.string(), z.any()).optional(),
|
|
103
104
|
parasail: z.record(z.string(), z.any()).optional(),
|
|
@@ -103,6 +103,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
103
103
|
readonly NextBit: "NextBit";
|
|
104
104
|
readonly Novita: "Novita";
|
|
105
105
|
readonly Nvidia: "Nvidia";
|
|
106
|
+
readonly Ollama: "Ollama";
|
|
106
107
|
readonly OpenAI: "OpenAI";
|
|
107
108
|
readonly OpenInference: "OpenInference";
|
|
108
109
|
readonly Parasail: "Parasail";
|
|
@@ -7,6 +7,7 @@ import { PercentileStats } from "./percentilestats.js";
|
|
|
7
7
|
import { PricingOverride } from "./pricingoverride.js";
|
|
8
8
|
import { ProviderName } from "./providername.js";
|
|
9
9
|
import { Quantization } from "./quantization.js";
|
|
10
|
+
import { ToolChoiceSupport } from "./toolchoicesupport.js";
|
|
10
11
|
export type Pricing = {
|
|
11
12
|
/**
|
|
12
13
|
* Price in USD per audio input token
|
|
@@ -99,6 +100,10 @@ export type PublicEndpoint = {
|
|
|
99
100
|
status?: EndpointStatus | undefined;
|
|
100
101
|
supportedParameters: Array<Parameter>;
|
|
101
102
|
supportsImplicitCaching: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing.
|
|
105
|
+
*/
|
|
106
|
+
supportsToolChoice: ToolChoiceSupport;
|
|
102
107
|
/**
|
|
103
108
|
* Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true.
|
|
104
109
|
*/
|
|
@@ -11,6 +11,7 @@ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
|
|
|
11
11
|
import { PricingOverride$inboundSchema, } from "./pricingoverride.js";
|
|
12
12
|
import { ProviderName$inboundSchema } from "./providername.js";
|
|
13
13
|
import { Quantization$inboundSchema } from "./quantization.js";
|
|
14
|
+
import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
|
|
14
15
|
/** @internal */
|
|
15
16
|
export const Pricing$inboundSchema = z.object({
|
|
16
17
|
audio: z.string().optional(),
|
|
@@ -60,6 +61,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
60
61
|
status: EndpointStatus$inboundSchema.optional(),
|
|
61
62
|
supported_parameters: z.array(Parameter$inboundSchema),
|
|
62
63
|
supports_implicit_caching: z.boolean(),
|
|
64
|
+
supports_tool_choice: ToolChoiceSupport$inboundSchema,
|
|
63
65
|
supports_voice_cloning: z.boolean().default(false),
|
|
64
66
|
tag: z.string(),
|
|
65
67
|
throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
@@ -77,6 +79,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
77
79
|
"provider_name": "providerName",
|
|
78
80
|
"supported_parameters": "supportedParameters",
|
|
79
81
|
"supports_implicit_caching": "supportsImplicitCaching",
|
|
82
|
+
"supports_tool_choice": "supportsToolChoice",
|
|
80
83
|
"supports_voice_cloning": "supportsVoiceCloning",
|
|
81
84
|
"throughput_last_30m": "throughputLast30m",
|
|
82
85
|
"uptime_last_1d": "uptimeLast1d",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing.
|
|
6
|
+
*/
|
|
7
|
+
export type ToolChoiceSupport = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the endpoint supports `"tool_choice": "auto"`.
|
|
10
|
+
*/
|
|
11
|
+
auto: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the endpoint supports naming a function, `"tool_choice": {"type": "function", ...}`.
|
|
14
|
+
*/
|
|
15
|
+
function: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the endpoint supports `"tool_choice": "none"`.
|
|
18
|
+
*/
|
|
19
|
+
none: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the endpoint supports `"tool_choice": "required"`.
|
|
22
|
+
*/
|
|
23
|
+
required: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ToolChoiceSupport$inboundSchema: z.ZodType<ToolChoiceSupport, unknown>;
|
|
27
|
+
export declare function toolChoiceSupportFromJSON(jsonString: string): SafeParseResult<ToolChoiceSupport, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=toolchoicesupport.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ccb12dd7321c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ToolChoiceSupport$inboundSchema = z.object({
|
|
9
|
+
auto: z.boolean(),
|
|
10
|
+
function: z.boolean(),
|
|
11
|
+
none: z.boolean(),
|
|
12
|
+
required: z.boolean(),
|
|
13
|
+
});
|
|
14
|
+
export function toolChoiceSupportFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => ToolChoiceSupport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolChoiceSupport' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=toolchoicesupport.js.map
|
|
@@ -300,6 +300,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
300
300
|
octoai?: {
|
|
301
301
|
[k: string]: any;
|
|
302
302
|
} | undefined;
|
|
303
|
+
ollama?: {
|
|
304
|
+
[k: string]: any;
|
|
305
|
+
} | undefined;
|
|
303
306
|
openInference?: {
|
|
304
307
|
[k: string]: any;
|
|
305
308
|
} | undefined;
|
|
@@ -790,6 +793,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
790
793
|
octoai?: {
|
|
791
794
|
[k: string]: any;
|
|
792
795
|
} | undefined;
|
|
796
|
+
ollama?: {
|
|
797
|
+
[k: string]: any;
|
|
798
|
+
} | undefined;
|
|
793
799
|
"open-inference"?: {
|
|
794
800
|
[k: string]: any;
|
|
795
801
|
} | undefined;
|
|
@@ -129,6 +129,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
129
129
|
novita: z.record(z.string(), z.any()).optional(),
|
|
130
130
|
nvidia: z.record(z.string(), z.any()).optional(),
|
|
131
131
|
octoai: z.record(z.string(), z.any()).optional(),
|
|
132
|
+
ollama: z.record(z.string(), z.any()).optional(),
|
|
132
133
|
openInference: z.record(z.string(), z.any()).optional(),
|
|
133
134
|
openai: z.record(z.string(), z.any()).optional(),
|
|
134
135
|
parasail: z.record(z.string(), z.any()).optional(),
|
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.81",
|
|
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
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
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
|
-
"
|
|
76
|
+
"test:transit": "exit 0",
|
|
77
|
+
"typecheck:transit": "exit 0",
|
|
77
78
|
"prepare": "npm run build",
|
|
78
79
|
"test": "vitest --run --project unit",
|
|
79
80
|
"test:e2e": "vitest --run --project e2e",
|
|
81
|
+
"test:watch": "vitest --watch --project unit",
|
|
80
82
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"typecheck:transit": "exit 0",
|
|
82
83
|
"compile": "tsc",
|
|
83
|
-
"
|
|
84
|
-
"test:watch": "vitest --watch --project unit"
|
|
84
|
+
"postinstall": "node scripts/check-types.js || true"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|