@openrouter/sdk 1.2.130 → 1.2.131

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.
@@ -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.130";
53
+ readonly sdkVersion: "1.2.131";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.130 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.131 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.130",
32
+ sdkVersion: "1.2.131",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.130 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.131 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -141,6 +141,10 @@ export type ImageGenerationRequest = {
141
141
  * If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.
142
142
  */
143
143
  seed?: number | undefined;
144
+ /**
145
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
146
+ */
147
+ sessionId?: string | undefined;
144
148
  /**
145
149
  * Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.
146
150
  */
@@ -182,6 +186,7 @@ export type ImageGenerationRequest$Outbound = {
182
186
  quality?: string | undefined;
183
187
  resolution?: string | undefined;
184
188
  seed?: number | undefined;
189
+ session_id?: string | undefined;
185
190
  size?: string | undefined;
186
191
  stream?: boolean | undefined;
187
192
  trace?: TraceConfig$Outbound | undefined;
@@ -98,6 +98,7 @@ export const ImageGenerationRequest$outboundSchema = z.object({
98
98
  quality: ImageGenerationRequestQuality$outboundSchema.optional(),
99
99
  resolution: ImageGenerationRequestResolution$outboundSchema.optional(),
100
100
  seed: z.int().optional(),
101
+ sessionId: z.string().optional(),
101
102
  size: z.string().optional(),
102
103
  stream: z.boolean().optional(),
103
104
  trace: TraceConfig$outboundSchema.optional(),
@@ -108,6 +109,7 @@ export const ImageGenerationRequest$outboundSchema = z.object({
108
109
  inputReferences: "input_references",
109
110
  outputCompression: "output_compression",
110
111
  outputFormat: "output_format",
112
+ sessionId: "session_id",
111
113
  });
112
114
  });
113
115
  export function imageGenerationRequestToJSON(imageGenerationRequest) {
@@ -79,6 +79,10 @@ export type CreateEmbeddingsRequestBody = {
79
79
  */
80
80
  model: string;
81
81
  provider?: models.ProviderPreferences | null | undefined;
82
+ /**
83
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
84
+ */
85
+ sessionId?: string | undefined;
82
86
  /**
83
87
  * 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
88
  */
@@ -263,6 +267,7 @@ export type CreateEmbeddingsRequestBody$Outbound = {
263
267
  input_type?: string | undefined;
264
268
  model: string;
265
269
  provider?: models.ProviderPreferences$Outbound | null | undefined;
270
+ session_id?: string | undefined;
266
271
  trace?: models.TraceConfig$Outbound | undefined;
267
272
  user?: string | undefined;
268
273
  };
@@ -100,12 +100,14 @@ 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
+ sessionId: z.string().optional(),
103
104
  trace: models.TraceConfig$outboundSchema.optional(),
104
105
  user: z.string().optional(),
105
106
  }).transform((v) => {
106
107
  return remap$(v, {
107
108
  encodingFormat: "encoding_format",
108
109
  inputType: "input_type",
110
+ sessionId: "session_id",
109
111
  });
110
112
  });
111
113
  export function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody) {
@@ -57,6 +57,10 @@ export type CreateRerankRequestBody = {
57
57
  * The search query to rerank documents against
58
58
  */
59
59
  query: string;
60
+ /**
61
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
62
+ */
63
+ sessionId?: string | undefined;
60
64
  /**
61
65
  * Number of most relevant documents to return
62
66
  */
@@ -184,6 +188,7 @@ export type CreateRerankRequestBody$Outbound = {
184
188
  model: string;
185
189
  provider?: models.ProviderPreferences$Outbound | null | undefined;
186
190
  query: string;
191
+ session_id?: string | undefined;
187
192
  top_n?: number | undefined;
188
193
  trace?: models.TraceConfig$Outbound | undefined;
189
194
  user?: string | undefined;
@@ -26,11 +26,13 @@ export const CreateRerankRequestBody$outboundSchema = z.object({
26
26
  model: z.string(),
27
27
  provider: z.nullable(models.ProviderPreferences$outboundSchema).optional(),
28
28
  query: z.string(),
29
+ sessionId: z.string().optional(),
29
30
  topN: z.int().optional(),
30
31
  trace: models.TraceConfig$outboundSchema.optional(),
31
32
  user: z.string().optional(),
32
33
  }).transform((v) => {
33
34
  return remap$(v, {
35
+ sessionId: "session_id",
34
36
  topN: "top_n",
35
37
  });
36
38
  });
@@ -47,6 +47,10 @@ export type SpeechRequest = {
47
47
  * Audio output format
48
48
  */
49
49
  responseFormat?: SpeechRequestResponseFormat | undefined;
50
+ /**
51
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
52
+ */
53
+ sessionId?: string | undefined;
50
54
  /**
51
55
  * Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.
52
56
  */
@@ -80,6 +84,7 @@ export type SpeechRequest$Outbound = {
80
84
  model: string;
81
85
  provider?: SpeechRequestProvider$Outbound | undefined;
82
86
  response_format: string;
87
+ session_id?: string | undefined;
83
88
  speed?: number | undefined;
84
89
  trace?: TraceConfig$Outbound | undefined;
85
90
  user?: string | undefined;
@@ -31,6 +31,7 @@ export const SpeechRequest$outboundSchema = z.object({
31
31
  model: z.string(),
32
32
  provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(),
33
33
  responseFormat: SpeechRequestResponseFormat$outboundSchema.default("pcm"),
34
+ sessionId: z.string().optional(),
34
35
  speed: z.number().optional(),
35
36
  trace: TraceConfig$outboundSchema.optional(),
36
37
  user: z.string().optional(),
@@ -39,6 +40,7 @@ export const SpeechRequest$outboundSchema = z.object({
39
40
  return remap$(v, {
40
41
  inputReferences: "input_references",
41
42
  responseFormat: "response_format",
43
+ sessionId: "session_id",
42
44
  });
43
45
  });
44
46
  export function speechRequestToJSON(speechRequest) {
@@ -48,6 +48,10 @@ export type STTRequest = {
48
48
  * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.
49
49
  */
50
50
  responseFormat?: STTRequestResponseFormat | undefined;
51
+ /**
52
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
53
+ */
54
+ sessionId?: string | undefined;
51
55
  /**
52
56
  * Sampling temperature for transcription
53
57
  */
@@ -81,6 +85,7 @@ export type STTRequest$Outbound = {
81
85
  model: string;
82
86
  provider?: STTRequestProvider$Outbound | undefined;
83
87
  response_format?: string | undefined;
88
+ session_id?: string | undefined;
84
89
  temperature?: number | undefined;
85
90
  timestamp_granularities?: Array<string> | undefined;
86
91
  trace?: TraceConfig$Outbound | undefined;
@@ -32,6 +32,7 @@ export const STTRequest$outboundSchema = z.object({
32
32
  model: z.string(),
33
33
  provider: z.lazy(() => STTRequestProvider$outboundSchema).optional(),
34
34
  responseFormat: STTRequestResponseFormat$outboundSchema.optional(),
35
+ sessionId: z.string().optional(),
35
36
  temperature: z.number().optional(),
36
37
  timestampGranularities: z.array(STTTimestampGranularity$outboundSchema)
37
38
  .optional(),
@@ -41,6 +42,7 @@ export const STTRequest$outboundSchema = z.object({
41
42
  return remap$(v, {
42
43
  inputAudio: "input_audio",
43
44
  responseFormat: "response_format",
45
+ sessionId: "session_id",
44
46
  timestampGranularities: "timestamp_granularities",
45
47
  });
46
48
  });
@@ -517,6 +517,10 @@ export type VideoGenerationRequest = {
517
517
  * If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.
518
518
  */
519
519
  seed?: number | undefined;
520
+ /**
521
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
522
+ */
523
+ sessionId?: string | undefined;
520
524
  /**
521
525
  * Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio.
522
526
  */
@@ -988,6 +992,7 @@ export type VideoGenerationRequest$Outbound = {
988
992
  provider?: VideoGenerationRequestProvider$Outbound | undefined;
989
993
  resolution?: string | undefined;
990
994
  seed?: number | undefined;
995
+ session_id?: string | undefined;
991
996
  size?: string | undefined;
992
997
  trace?: TraceConfig$Outbound | undefined;
993
998
  upscale_factor?: number | undefined;
@@ -241,6 +241,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
241
241
  .optional(),
242
242
  resolution: VideoGenerationRequestResolution$outboundSchema.optional(),
243
243
  seed: z.int().optional(),
244
+ sessionId: z.string().optional(),
244
245
  size: z.string().optional(),
245
246
  trace: TraceConfig$outboundSchema.optional(),
246
247
  upscaleFactor: z.number().optional(),
@@ -252,6 +253,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
252
253
  frameImages: "frame_images",
253
254
  generateAudio: "generate_audio",
254
255
  inputReferences: "input_references",
256
+ sessionId: "session_id",
255
257
  upscaleFactor: "upscale_factor",
256
258
  });
257
259
  });
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.130",
5
+ "version": "1.2.131",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.2.130",
3
+ "version": "1.2.131",
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,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
+ "typecheck": "tsc --noEmit",
76
77
  "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "prepare": "npm run build",
78
+ "test:e2e": "vitest --run --project e2e",
79
79
  "test:transit": "exit 0",
80
- "test:watch": "vitest --watch --project unit",
81
- "typecheck": "tsc --noEmit",
82
80
  "typecheck:transit": "exit 0",
81
+ "postinstall": "node scripts/check-types.js || true",
82
+ "prepare": "npm run build",
83
83
  "test": "vitest --run --project unit",
84
- "test:e2e": "vitest --run --project e2e"
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {