@openrouter/sdk 1.0.7 → 1.0.9

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.7";
52
+ readonly sdkVersion: "1.0.9";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.0.7 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.0.9 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.7",
29
+ sdkVersion: "1.0.9",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.0.7 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.0.9 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -267,7 +267,7 @@ export type ChatRequest = {
267
267
  */
268
268
  trace?: TraceConfig | undefined;
269
269
  /**
270
- * Unique user identifier
270
+ * Per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account.
271
271
  */
272
272
  user?: string | undefined;
273
273
  };
@@ -12,6 +12,10 @@ export type OutputImageGenerationCallItem = {
12
12
  result?: string | null | undefined;
13
13
  status: ImageGenerationStatus;
14
14
  type: OutputImageGenerationCallItemType;
15
+ /**
16
+ * The prompt (possibly rewritten) that the image was generated from.
17
+ */
18
+ prompt?: string | undefined;
15
19
  };
16
20
  /** @internal */
17
21
  export declare const OutputImageGenerationCallItemType$inboundSchema: z.ZodEnum<typeof OutputImageGenerationCallItemType>;
@@ -25,6 +29,7 @@ export type OutputImageGenerationCallItem$Outbound = {
25
29
  result: string | null;
26
30
  status: string;
27
31
  type: string;
32
+ prompt?: string | undefined;
28
33
  };
29
34
  /** @internal */
30
35
  export declare const OutputImageGenerationCallItem$outboundSchema: z.ZodType<OutputImageGenerationCallItem$Outbound, OutputImageGenerationCallItem>;
@@ -18,6 +18,7 @@ export const OutputImageGenerationCallItem$inboundSchema = z.object({
18
18
  result: z.nullable(z.string()).default(null),
19
19
  status: ImageGenerationStatus$inboundSchema,
20
20
  type: OutputImageGenerationCallItemType$inboundSchema,
21
+ prompt: z.string().optional(),
21
22
  });
22
23
  /** @internal */
23
24
  export const OutputImageGenerationCallItem$outboundSchema = z.object({
@@ -25,6 +26,7 @@ export const OutputImageGenerationCallItem$outboundSchema = z.object({
25
26
  result: z.nullable(z.string()).default(null),
26
27
  status: ImageGenerationStatus$outboundSchema,
27
28
  type: OutputImageGenerationCallItemType$outboundSchema,
29
+ prompt: z.string().optional(),
28
30
  });
29
31
  export function outputImageGenerationCallItemToJSON(outputImageGenerationCallItem) {
30
32
  return JSON.stringify(OutputImageGenerationCallItem$outboundSchema.parse(outputImageGenerationCallItem));
@@ -14,6 +14,10 @@ export type OutputImageGenerationServerToolItem = {
14
14
  id?: string | undefined;
15
15
  imageB64?: string | undefined;
16
16
  imageUrl?: string | undefined;
17
+ /**
18
+ * The prompt (possibly rewritten) that the image was generated from.
19
+ */
20
+ prompt?: string | undefined;
17
21
  /**
18
22
  * The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format
19
23
  */
@@ -33,6 +37,7 @@ export type OutputImageGenerationServerToolItem$Outbound = {
33
37
  id?: string | undefined;
34
38
  imageB64?: string | undefined;
35
39
  imageUrl?: string | undefined;
40
+ prompt?: string | undefined;
36
41
  result?: string | null | undefined;
37
42
  revisedPrompt?: string | undefined;
38
43
  status: string;
@@ -17,6 +17,7 @@ export const OutputImageGenerationServerToolItem$inboundSchema = z.object({
17
17
  id: z.string().optional(),
18
18
  imageB64: z.string().optional(),
19
19
  imageUrl: z.string().optional(),
20
+ prompt: z.string().optional(),
20
21
  result: z.nullable(z.string()).optional(),
21
22
  revisedPrompt: z.string().optional(),
22
23
  status: ToolCallStatus$inboundSchema,
@@ -27,6 +28,7 @@ export const OutputImageGenerationServerToolItem$outboundSchema = z.object({
27
28
  id: z.string().optional(),
28
29
  imageB64: z.string().optional(),
29
30
  imageUrl: z.string().optional(),
31
+ prompt: z.string().optional(),
30
32
  result: z.nullable(z.string()).optional(),
31
33
  revisedPrompt: z.string().optional(),
32
34
  status: ToolCallStatus$outboundSchema,
@@ -209,6 +209,9 @@ export type ResponsesRequest = {
209
209
  * Configuration for reasoning mode in the response
210
210
  */
211
211
  reasoning?: ReasoningConfig | null | undefined;
212
+ /**
213
+ * Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account.
214
+ */
212
215
  safetyIdentifier?: string | null | undefined;
213
216
  serviceTier?: ResponsesRequestServiceTier | null | undefined;
214
217
  /**
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.0.7",
5
+ "version": "1.0.9",
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.7",
3
+ "version": "1.0.9",
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
- "prepare": "npm run build",
76
+ "postinstall": "node scripts/check-types.js || true",
77
+ "test:e2e": "vitest --run --project e2e",
77
78
  "test:transit": "exit 0",
78
- "test:watch": "vitest --watch --project unit",
79
- "typecheck:transit": "exit 0",
79
+ "compile": "tsc",
80
+ "prepare": "npm run build",
80
81
  "test": "vitest --run --project unit",
81
- "test:e2e": "vitest --run --project e2e",
82
+ "test:watch": "vitest --watch --project unit",
82
83
  "typecheck": "tsc --noEmit",
83
- "compile": "tsc",
84
- "postinstall": "node scripts/check-types.js || true"
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {