@openrouter/sdk 1.2.125 → 1.2.126
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/imagegenerationrequest.d.ts +6 -0
- package/esm/models/imagegenerationrequest.js +2 -0
- package/esm/models/operations/createembeddings.d.ts +5 -0
- package/esm/models/operations/createembeddings.js +1 -0
- package/esm/models/operations/creatererank.d.ts +5 -0
- package/esm/models/operations/creatererank.js +1 -0
- package/esm/models/speechrequest.d.ts +6 -0
- package/esm/models/speechrequest.js +2 -0
- package/esm/models/sttrequest.d.ts +6 -0
- package/esm/models/sttrequest.js +2 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +2 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
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.126";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.126 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.126",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.126 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { ContentPartImage, ContentPartImage$Outbound } from "./contentpartimage.js";
|
|
4
4
|
import { ImageGenerationProviderPreferences, ImageGenerationProviderPreferences$Outbound } from "./imagegenerationproviderpreferences.js";
|
|
5
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
5
6
|
/**
|
|
6
7
|
* Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
|
|
7
8
|
*/
|
|
@@ -148,6 +149,10 @@ export type ImageGenerationRequest = {
|
|
|
148
149
|
* If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.
|
|
149
150
|
*/
|
|
150
151
|
stream?: boolean | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
154
|
+
*/
|
|
155
|
+
trace?: TraceConfig | undefined;
|
|
151
156
|
/**
|
|
152
157
|
* A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier.
|
|
153
158
|
*/
|
|
@@ -179,6 +184,7 @@ export type ImageGenerationRequest$Outbound = {
|
|
|
179
184
|
seed?: number | undefined;
|
|
180
185
|
size?: string | undefined;
|
|
181
186
|
stream?: boolean | undefined;
|
|
187
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
182
188
|
user?: string | undefined;
|
|
183
189
|
};
|
|
184
190
|
/** @internal */
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { ContentPartImage$outboundSchema, } from "./contentpartimage.js";
|
|
9
9
|
import { ImageGenerationProviderPreferences$outboundSchema, } from "./imagegenerationproviderpreferences.js";
|
|
10
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
10
11
|
/**
|
|
11
12
|
* Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
|
|
12
13
|
*/
|
|
@@ -99,6 +100,7 @@ export const ImageGenerationRequest$outboundSchema = z.object({
|
|
|
99
100
|
seed: z.int().optional(),
|
|
100
101
|
size: z.string().optional(),
|
|
101
102
|
stream: z.boolean().optional(),
|
|
103
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
102
104
|
user: z.string().optional(),
|
|
103
105
|
}).transform((v) => {
|
|
104
106
|
return remap$(v, {
|
|
@@ -79,6 +79,10 @@ export type CreateEmbeddingsRequestBody = {
|
|
|
79
79
|
*/
|
|
80
80
|
model: string;
|
|
81
81
|
provider?: models.ProviderPreferences | null | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
84
|
+
*/
|
|
85
|
+
trace?: models.TraceConfig | undefined;
|
|
82
86
|
/**
|
|
83
87
|
* A unique identifier for the end-user
|
|
84
88
|
*/
|
|
@@ -259,6 +263,7 @@ export type CreateEmbeddingsRequestBody$Outbound = {
|
|
|
259
263
|
input_type?: string | undefined;
|
|
260
264
|
model: string;
|
|
261
265
|
provider?: models.ProviderPreferences$Outbound | null | undefined;
|
|
266
|
+
trace?: models.TraceConfig$Outbound | undefined;
|
|
262
267
|
user?: string | undefined;
|
|
263
268
|
};
|
|
264
269
|
/** @internal */
|
|
@@ -100,6 +100,7 @@ export const CreateEmbeddingsRequestBody$outboundSchema = z.object({
|
|
|
100
100
|
inputType: z.string().optional(),
|
|
101
101
|
model: z.string(),
|
|
102
102
|
provider: z.nullable(models.ProviderPreferences$outboundSchema).optional(),
|
|
103
|
+
trace: models.TraceConfig$outboundSchema.optional(),
|
|
103
104
|
user: z.string().optional(),
|
|
104
105
|
}).transform((v) => {
|
|
105
106
|
return remap$(v, {
|
|
@@ -61,6 +61,10 @@ export type CreateRerankRequestBody = {
|
|
|
61
61
|
* Number of most relevant documents to return
|
|
62
62
|
*/
|
|
63
63
|
topN?: number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
66
|
+
*/
|
|
67
|
+
trace?: models.TraceConfig | undefined;
|
|
64
68
|
/**
|
|
65
69
|
* A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
|
|
66
70
|
*/
|
|
@@ -181,6 +185,7 @@ export type CreateRerankRequestBody$Outbound = {
|
|
|
181
185
|
provider?: models.ProviderPreferences$Outbound | null | undefined;
|
|
182
186
|
query: string;
|
|
183
187
|
top_n?: number | undefined;
|
|
188
|
+
trace?: models.TraceConfig$Outbound | undefined;
|
|
184
189
|
user?: string | undefined;
|
|
185
190
|
};
|
|
186
191
|
/** @internal */
|
|
@@ -27,6 +27,7 @@ export const CreateRerankRequestBody$outboundSchema = z.object({
|
|
|
27
27
|
provider: z.nullable(models.ProviderPreferences$outboundSchema).optional(),
|
|
28
28
|
query: z.string(),
|
|
29
29
|
topN: z.int().optional(),
|
|
30
|
+
trace: models.TraceConfig$outboundSchema.optional(),
|
|
30
31
|
user: z.string().optional(),
|
|
31
32
|
}).transform((v) => {
|
|
32
33
|
return remap$(v, {
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js";
|
|
4
4
|
import { SpeechInputReference, SpeechInputReference$Outbound } from "./speechinputreference.js";
|
|
5
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
5
6
|
/**
|
|
6
7
|
* Provider-specific passthrough configuration
|
|
7
8
|
*/
|
|
@@ -50,6 +51,10 @@ export type SpeechRequest = {
|
|
|
50
51
|
* Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.
|
|
51
52
|
*/
|
|
52
53
|
speed?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
56
|
+
*/
|
|
57
|
+
trace?: TraceConfig | undefined;
|
|
53
58
|
/**
|
|
54
59
|
* A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
|
|
55
60
|
*/
|
|
@@ -76,6 +81,7 @@ export type SpeechRequest$Outbound = {
|
|
|
76
81
|
provider?: SpeechRequestProvider$Outbound | undefined;
|
|
77
82
|
response_format: string;
|
|
78
83
|
speed?: number | undefined;
|
|
84
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
79
85
|
user?: string | undefined;
|
|
80
86
|
voice?: string | undefined;
|
|
81
87
|
};
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { ProviderOptions$outboundSchema, } from "./provideroptions.js";
|
|
9
9
|
import { SpeechInputReference$outboundSchema, } from "./speechinputreference.js";
|
|
10
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
10
11
|
/**
|
|
11
12
|
* Audio output format
|
|
12
13
|
*/
|
|
@@ -31,6 +32,7 @@ export const SpeechRequest$outboundSchema = z.object({
|
|
|
31
32
|
provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(),
|
|
32
33
|
responseFormat: SpeechRequestResponseFormat$outboundSchema.default("pcm"),
|
|
33
34
|
speed: z.number().optional(),
|
|
35
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
34
36
|
user: z.string().optional(),
|
|
35
37
|
voice: z.string().optional(),
|
|
36
38
|
}).transform((v) => {
|
|
@@ -3,6 +3,7 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js";
|
|
4
4
|
import { STTInputAudio, STTInputAudio$Outbound } from "./sttinputaudio.js";
|
|
5
5
|
import { STTTimestampGranularity } from "./stttimestampgranularity.js";
|
|
6
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
6
7
|
/**
|
|
7
8
|
* Provider-specific passthrough configuration
|
|
8
9
|
*/
|
|
@@ -55,6 +56,10 @@ export type STTRequest = {
|
|
|
55
56
|
* Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json".
|
|
56
57
|
*/
|
|
57
58
|
timestampGranularities?: Array<STTTimestampGranularity> | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
61
|
+
*/
|
|
62
|
+
trace?: TraceConfig | undefined;
|
|
58
63
|
/**
|
|
59
64
|
* A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
|
|
60
65
|
*/
|
|
@@ -78,6 +83,7 @@ export type STTRequest$Outbound = {
|
|
|
78
83
|
response_format?: string | undefined;
|
|
79
84
|
temperature?: number | undefined;
|
|
80
85
|
timestamp_granularities?: Array<string> | undefined;
|
|
86
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
81
87
|
user?: string | undefined;
|
|
82
88
|
};
|
|
83
89
|
/** @internal */
|
package/esm/models/sttrequest.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as openEnums from "../types/enums.js";
|
|
|
8
8
|
import { ProviderOptions$outboundSchema, } from "./provideroptions.js";
|
|
9
9
|
import { STTInputAudio$outboundSchema, } from "./sttinputaudio.js";
|
|
10
10
|
import { STTTimestampGranularity$outboundSchema, } from "./stttimestampgranularity.js";
|
|
11
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
11
12
|
/**
|
|
12
13
|
* Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.
|
|
13
14
|
*/
|
|
@@ -34,6 +35,7 @@ export const STTRequest$outboundSchema = z.object({
|
|
|
34
35
|
temperature: z.number().optional(),
|
|
35
36
|
timestampGranularities: z.array(STTTimestampGranularity$outboundSchema)
|
|
36
37
|
.optional(),
|
|
38
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
37
39
|
user: z.string().optional(),
|
|
38
40
|
}).transform((v) => {
|
|
39
41
|
return remap$(v, {
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { FrameImage, FrameImage$Outbound } from "./frameimage.js";
|
|
4
4
|
import { InputReference, InputReference$Outbound } from "./inputreference.js";
|
|
5
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
5
6
|
/**
|
|
6
7
|
* Aspect ratio of the generated video
|
|
7
8
|
*/
|
|
@@ -520,6 +521,10 @@ export type VideoGenerationRequest = {
|
|
|
520
521
|
* Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio.
|
|
521
522
|
*/
|
|
522
523
|
size?: string | undefined;
|
|
524
|
+
/**
|
|
525
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
526
|
+
*/
|
|
527
|
+
trace?: TraceConfig | undefined;
|
|
523
528
|
/**
|
|
524
529
|
* Upscale factor for video upscaling models only. This parameter is not supported by video generation models.
|
|
525
530
|
*/
|
|
@@ -984,6 +989,7 @@ export type VideoGenerationRequest$Outbound = {
|
|
|
984
989
|
resolution?: string | undefined;
|
|
985
990
|
seed?: number | undefined;
|
|
986
991
|
size?: string | undefined;
|
|
992
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
987
993
|
upscale_factor?: number | undefined;
|
|
988
994
|
user?: string | undefined;
|
|
989
995
|
};
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { FrameImage$outboundSchema, } from "./frameimage.js";
|
|
9
9
|
import { InputReference$outboundSchema, } from "./inputreference.js";
|
|
10
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
10
11
|
/**
|
|
11
12
|
* Aspect ratio of the generated video
|
|
12
13
|
*/
|
|
@@ -241,6 +242,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
|
|
|
241
242
|
resolution: VideoGenerationRequestResolution$outboundSchema.optional(),
|
|
242
243
|
seed: z.int().optional(),
|
|
243
244
|
size: z.string().optional(),
|
|
245
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
244
246
|
upscaleFactor: z.number().optional(),
|
|
245
247
|
user: z.string().optional(),
|
|
246
248
|
}).transform((v) => {
|
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.126",
|
|
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,13 +73,13 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"compile": "tsc",
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
78
76
|
"prepare": "npm run build",
|
|
77
|
+
"test": "vitest --run --project unit",
|
|
79
78
|
"test:e2e": "vitest --run --project e2e",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
79
|
"typecheck": "tsc --noEmit",
|
|
82
|
-
"
|
|
80
|
+
"compile": "tsc",
|
|
81
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
82
|
+
"test:transit": "exit 0",
|
|
83
83
|
"test:watch": "vitest --watch --project unit",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|