@openrouter/sdk 1.0.10 → 1.0.11

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.
@@ -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: "1.0.10";
52
+ readonly sdkVersion: "1.0.11";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.0.10 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.0.11 2.914.0 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: "1.0.10",
29
+ sdkVersion: "1.0.11",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.0.10 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.0.11 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -13,6 +13,10 @@ export type AutoRouterPlugin = {
13
13
  */
14
14
  enabled?: boolean | undefined;
15
15
  id: "auto-router";
16
+ /**
17
+ * When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false.
18
+ */
19
+ pinModel?: boolean | undefined;
16
20
  };
17
21
  /** @internal */
18
22
  export type AutoRouterPlugin$Outbound = {
@@ -20,6 +24,7 @@ export type AutoRouterPlugin$Outbound = {
20
24
  cost_quality_tradeoff?: number | undefined;
21
25
  enabled?: boolean | undefined;
22
26
  id: "auto-router";
27
+ pin_model?: boolean | undefined;
23
28
  };
24
29
  /** @internal */
25
30
  export declare const AutoRouterPlugin$outboundSchema: z.ZodType<AutoRouterPlugin$Outbound, AutoRouterPlugin>;
@@ -10,10 +10,12 @@ export const AutoRouterPlugin$outboundSchema = z.object({
10
10
  costQualityTradeoff: z.int().optional(),
11
11
  enabled: z.boolean().optional(),
12
12
  id: z.literal("auto-router"),
13
+ pinModel: z.boolean().optional(),
13
14
  }).transform((v) => {
14
15
  return remap$(v, {
15
16
  allowedModels: "allowed_models",
16
17
  costQualityTradeoff: "cost_quality_tradeoff",
18
+ pinModel: "pin_model",
17
19
  });
18
20
  });
19
21
  export function autoRouterPluginToJSON(autoRouterPlugin) {
@@ -31,6 +31,10 @@ export type ChatAssistantMessage = {
31
31
  * Generated images from image generation models
32
32
  */
33
33
  images?: Array<ChatAssistantImages> | undefined;
34
+ /**
35
+ * Model that generated this assistant message
36
+ */
37
+ model?: string | undefined;
34
38
  /**
35
39
  * Optional name for the assistant
36
40
  */
@@ -72,6 +76,7 @@ export type ChatAssistantMessage$Outbound = {
72
76
  audio?: ChatAudioOutput$Outbound | undefined;
73
77
  content?: string | Array<ChatContentItems$Outbound> | null | undefined;
74
78
  images?: Array<ChatAssistantImages$Outbound> | undefined;
79
+ model?: string | undefined;
75
80
  name?: string | undefined;
76
81
  reasoning?: string | null | undefined;
77
82
  reasoning_details?: Array<ReasoningDetailUnion$Outbound> | undefined;
@@ -32,6 +32,7 @@ export const ChatAssistantMessage$inboundSchema = z.object({
32
32
  audio: ChatAudioOutput$inboundSchema.optional(),
33
33
  content: z.nullable(z.union([z.string(), z.array(ChatContentItems$inboundSchema)])).optional(),
34
34
  images: z.array(ChatAssistantImages$inboundSchema).optional(),
35
+ model: z.string().optional(),
35
36
  name: z.string().optional(),
36
37
  reasoning: z.nullable(z.string()).optional(),
37
38
  reasoning_details: z.array(ReasoningDetailUnion$inboundSchema).optional(),
@@ -49,6 +50,7 @@ export const ChatAssistantMessage$outboundSchema = z.object({
49
50
  audio: ChatAudioOutput$outboundSchema.optional(),
50
51
  content: z.nullable(z.union([z.string(), z.array(ChatContentItems$outboundSchema)])).optional(),
51
52
  images: z.array(ChatAssistantImages$outboundSchema).optional(),
53
+ model: z.string().optional(),
52
54
  name: z.string().optional(),
53
55
  reasoning: z.nullable(z.string()).optional(),
54
56
  reasoningDetails: z.array(ReasoningDetailUnion$outboundSchema).optional(),
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.0.10",
5
+ "version": "1.0.11",
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.0.10",
3
+ "version": "1.0.11",
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
- "provenance": true,
25
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -73,14 +73,14 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "postinstall": "node scripts/check-types.js || true",
77
- "test": "vitest --run --project unit",
78
76
  "test:e2e": "vitest --run --project e2e",
77
+ "typecheck:transit": "exit 0",
78
+ "compile": "tsc",
79
+ "test": "vitest --run --project unit",
79
80
  "test:transit": "exit 0",
80
81
  "test:watch": "vitest --watch --project unit",
81
82
  "typecheck": "tsc --noEmit",
82
- "typecheck:transit": "exit 0",
83
- "compile": "tsc",
83
+ "postinstall": "node scripts/check-types.js || true",
84
84
  "prepare": "npm run build"
85
85
  },
86
86
  "peerDependencies": {},