@openrouter/sdk 0.12.10 → 0.12.12

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: "0.12.10";
52
+ readonly sdkVersion: "0.12.12";
53
53
  readonly genVersion: "2.879.1";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.12.10 2.879.1 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.12.12 2.879.1 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: "0.12.10",
29
+ sdkVersion: "0.12.12",
30
30
  genVersion: "2.879.1",
31
- userAgent: "speakeasy-sdk/typescript 0.12.10 2.879.1 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.12.12 2.879.1 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -236,7 +236,6 @@ export * from "./streameventsresponseoutputitemadded.js";
236
236
  export * from "./streameventsresponseoutputitemdone.js";
237
237
  export * from "./streamlogprob.js";
238
238
  export * from "./streamlogprobtoplogprob.js";
239
- export * from "./textconfig.js";
240
239
  export * from "./textdeltaevent.js";
241
240
  export * from "./textdoneevent.js";
242
241
  export * from "./textextendedconfig.js";
@@ -240,7 +240,6 @@ export * from "./streameventsresponseoutputitemadded.js";
240
240
  export * from "./streameventsresponseoutputitemdone.js";
241
241
  export * from "./streamlogprob.js";
242
242
  export * from "./streamlogprobtoplogprob.js";
243
- export * from "./textconfig.js";
244
243
  export * from "./textdeltaevent.js";
245
244
  export * from "./textdoneevent.js";
246
245
  export * from "./textextendedconfig.js";
@@ -23,7 +23,7 @@ import { PreviewWebSearchServerTool } from "./previewwebsearchservertool.js";
23
23
  import { ResponsesErrorField } from "./responseserrorfield.js";
24
24
  import { ShellServerTool } from "./shellservertool.js";
25
25
  import { StoredPromptTemplate } from "./storedprompttemplate.js";
26
- import { TextConfig } from "./textconfig.js";
26
+ import { TextExtendedConfig } from "./textextendedconfig.js";
27
27
  import { Truncation } from "./truncation.js";
28
28
  import { Usage } from "./usage.js";
29
29
  import { WebSearchServerTool } from "./websearchservertool.js";
@@ -85,7 +85,7 @@ export type OpenResponsesResult = {
85
85
  /**
86
86
  * Text output configuration including format and verbosity
87
87
  */
88
- text?: TextConfig | undefined;
88
+ text?: TextExtendedConfig | undefined;
89
89
  toolChoice: OpenAIResponsesToolChoiceUnion;
90
90
  tools: Array<OpenResponsesResultToolFunction | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | FileSearchServerTool | ComputerUseServerTool | CodeInterpreterServerTool | McpServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | CustomTool | discriminatedUnionTypes.Unknown<"type">>;
91
91
  topLogprobs?: number | null | undefined;
@@ -26,7 +26,7 @@ import { PreviewWebSearchServerTool$inboundSchema, } from "./previewwebsearchser
26
26
  import { ResponsesErrorField$inboundSchema, } from "./responseserrorfield.js";
27
27
  import { ShellServerTool$inboundSchema, } from "./shellservertool.js";
28
28
  import { StoredPromptTemplate$inboundSchema, } from "./storedprompttemplate.js";
29
- import { TextConfig$inboundSchema } from "./textconfig.js";
29
+ import { TextExtendedConfig$inboundSchema, } from "./textextendedconfig.js";
30
30
  import { Truncation$inboundSchema } from "./truncation.js";
31
31
  import { Usage$inboundSchema } from "./usage.js";
32
32
  import { WebSearchServerTool$inboundSchema, } from "./websearchservertool.js";
@@ -94,7 +94,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
94
94
  status: OpenAIResponsesResponseStatus$inboundSchema,
95
95
  store: z.boolean().optional(),
96
96
  temperature: z.nullable(z.number()),
97
- text: TextConfig$inboundSchema.optional(),
97
+ text: TextExtendedConfig$inboundSchema.optional(),
98
98
  tool_choice: OpenAIResponsesToolChoiceUnion$inboundSchema,
99
99
  tools: z.array(discriminatedUnion("type", {
100
100
  function: z.lazy(() => OpenResponsesResultToolFunction$inboundSchema),
@@ -218,6 +218,10 @@ export type GetGenerationData = {
218
218
  * User-Agent header from the request
219
219
  */
220
220
  userAgent: string | null;
221
+ /**
222
+ * The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel)
223
+ */
224
+ webSearchEngine: string | null;
221
225
  };
222
226
  /**
223
227
  * Generation response
@@ -73,6 +73,7 @@ export const GetGenerationData$inboundSchema = z.object({
73
73
  upstream_inference_cost: z.nullable(z.number()),
74
74
  usage: z.number(),
75
75
  user_agent: z.nullable(z.string()),
76
+ web_search_engine: z.nullable(z.string()),
76
77
  }).transform((v) => {
77
78
  return remap$(v, {
78
79
  "api_type": "apiType",
@@ -105,6 +106,7 @@ export const GetGenerationData$inboundSchema = z.object({
105
106
  "upstream_id": "upstreamId",
106
107
  "upstream_inference_cost": "upstreamInferenceCost",
107
108
  "user_agent": "userAgent",
109
+ "web_search_engine": "webSearchEngine",
108
110
  });
109
111
  });
110
112
  export function getGenerationDataFromJSON(jsonString) {
@@ -1,12 +1,16 @@
1
1
  import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
3
5
  import { Formats, Formats$Outbound } from "./formats.js";
4
- export declare const TextExtendedConfigVerbosity: {
5
- readonly High: "high";
6
+ export declare const Verbosity: {
6
7
  readonly Low: "low";
7
8
  readonly Medium: "medium";
9
+ readonly High: "high";
10
+ readonly Xhigh: "xhigh";
11
+ readonly Max: "max";
8
12
  };
9
- export type TextExtendedConfigVerbosity = OpenEnum<typeof TextExtendedConfigVerbosity>;
13
+ export type Verbosity = OpenEnum<typeof Verbosity>;
10
14
  /**
11
15
  * Text output configuration including format and verbosity
12
16
  */
@@ -15,10 +19,14 @@ export type TextExtendedConfig = {
15
19
  * Text response format configuration
16
20
  */
17
21
  format?: Formats | undefined;
18
- verbosity?: TextExtendedConfigVerbosity | null | undefined;
22
+ verbosity?: Verbosity | null | undefined;
19
23
  };
20
24
  /** @internal */
21
- export declare const TextExtendedConfigVerbosity$outboundSchema: z.ZodType<string, TextExtendedConfigVerbosity>;
25
+ export declare const Verbosity$inboundSchema: z.ZodType<Verbosity, unknown>;
26
+ /** @internal */
27
+ export declare const Verbosity$outboundSchema: z.ZodType<string, Verbosity>;
28
+ /** @internal */
29
+ export declare const TextExtendedConfig$inboundSchema: z.ZodType<TextExtendedConfig, unknown>;
22
30
  /** @internal */
23
31
  export type TextExtendedConfig$Outbound = {
24
32
  format?: Formats$Outbound | undefined;
@@ -27,4 +35,5 @@ export type TextExtendedConfig$Outbound = {
27
35
  /** @internal */
28
36
  export declare const TextExtendedConfig$outboundSchema: z.ZodType<TextExtendedConfig$Outbound, TextExtendedConfig>;
29
37
  export declare function textExtendedConfigToJSON(textExtendedConfig: TextExtendedConfig): string;
38
+ export declare function textExtendedConfigFromJSON(jsonString: string): SafeParseResult<TextExtendedConfig, SDKValidationError>;
30
39
  //# sourceMappingURL=textextendedconfig.d.ts.map
@@ -3,21 +3,36 @@
3
3
  * @generated-id: e264e7981200
4
4
  */
5
5
  import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
6
7
  import * as openEnums from "../types/enums.js";
7
- import { Formats$outboundSchema, } from "./formats.js";
8
- export const TextExtendedConfigVerbosity = {
9
- High: "high",
8
+ import { Formats$inboundSchema, Formats$outboundSchema, } from "./formats.js";
9
+ export const Verbosity = {
10
10
  Low: "low",
11
11
  Medium: "medium",
12
+ High: "high",
13
+ Xhigh: "xhigh",
14
+ Max: "max",
12
15
  };
13
16
  /** @internal */
14
- export const TextExtendedConfigVerbosity$outboundSchema = openEnums.outboundSchema(TextExtendedConfigVerbosity);
17
+ export const Verbosity$inboundSchema = openEnums
18
+ .inboundSchema(Verbosity);
19
+ /** @internal */
20
+ export const Verbosity$outboundSchema = openEnums
21
+ .outboundSchema(Verbosity);
22
+ /** @internal */
23
+ export const TextExtendedConfig$inboundSchema = z.object({
24
+ format: Formats$inboundSchema.optional(),
25
+ verbosity: z.nullable(Verbosity$inboundSchema).optional(),
26
+ });
15
27
  /** @internal */
16
28
  export const TextExtendedConfig$outboundSchema = z.object({
17
29
  format: Formats$outboundSchema.optional(),
18
- verbosity: z.nullable(TextExtendedConfigVerbosity$outboundSchema).optional(),
30
+ verbosity: z.nullable(Verbosity$outboundSchema).optional(),
19
31
  });
20
32
  export function textExtendedConfigToJSON(textExtendedConfig) {
21
33
  return JSON.stringify(TextExtendedConfig$outboundSchema.parse(textExtendedConfig));
22
34
  }
35
+ export function textExtendedConfigFromJSON(jsonString) {
36
+ return safeParse(jsonString, (x) => TextExtendedConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextExtendedConfig' from JSON`);
37
+ }
23
38
  //# sourceMappingURL=textextendedconfig.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.12.10",
5
+ "version": "0.12.12",
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": "0.12.10",
3
+ "version": "0.12.12",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [
@@ -69,15 +69,15 @@
69
69
  "lint": "eslint --cache --max-warnings=0 src",
70
70
  "build": "tsc",
71
71
  "prepublishOnly": "npm run build",
72
- "test:watch": "vitest --watch --project unit",
73
- "prepare": "npm run build",
74
72
  "test:e2e": "vitest --run --project e2e",
75
- "typecheck": "tsc --noEmit",
76
73
  "typecheck:transit": "exit 0",
77
74
  "compile": "tsc",
78
- "postinstall": "node scripts/check-types.js || true",
79
75
  "test": "vitest --run --project unit",
80
- "test:transit": "exit 0"
76
+ "test:transit": "exit 0",
77
+ "test:watch": "vitest --watch --project unit",
78
+ "typecheck": "tsc --noEmit",
79
+ "postinstall": "node scripts/check-types.js || true",
80
+ "prepare": "npm run build"
81
81
  },
82
82
  "peerDependencies": {},
83
83
  "devDependencies": {
@@ -1,27 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { OpenEnum } from "../types/enums.js";
3
- import { Result as SafeParseResult } from "../types/fp.js";
4
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
- import { Formats } from "./formats.js";
6
- export declare const TextConfigVerbosity: {
7
- readonly High: "high";
8
- readonly Low: "low";
9
- readonly Medium: "medium";
10
- };
11
- export type TextConfigVerbosity = OpenEnum<typeof TextConfigVerbosity>;
12
- /**
13
- * Text output configuration including format and verbosity
14
- */
15
- export type TextConfig = {
16
- /**
17
- * Text response format configuration
18
- */
19
- format?: Formats | undefined;
20
- verbosity?: TextConfigVerbosity | null | undefined;
21
- };
22
- /** @internal */
23
- export declare const TextConfigVerbosity$inboundSchema: z.ZodType<TextConfigVerbosity, unknown>;
24
- /** @internal */
25
- export declare const TextConfig$inboundSchema: z.ZodType<TextConfig, unknown>;
26
- export declare function textConfigFromJSON(jsonString: string): SafeParseResult<TextConfig, SDKValidationError>;
27
- //# sourceMappingURL=textconfig.d.ts.map
@@ -1,25 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 1a4d7bc40860
4
- */
5
- import * as z from "zod/v4";
6
- import { safeParse } from "../lib/schemas.js";
7
- import * as openEnums from "../types/enums.js";
8
- import { Formats$inboundSchema } from "./formats.js";
9
- export const TextConfigVerbosity = {
10
- High: "high",
11
- Low: "low",
12
- Medium: "medium",
13
- };
14
- /** @internal */
15
- export const TextConfigVerbosity$inboundSchema = openEnums.inboundSchema(TextConfigVerbosity);
16
- /** @internal */
17
- export const TextConfig$inboundSchema = z
18
- .object({
19
- format: Formats$inboundSchema.optional(),
20
- verbosity: z.nullable(TextConfigVerbosity$inboundSchema).optional(),
21
- });
22
- export function textConfigFromJSON(jsonString) {
23
- return safeParse(jsonString, (x) => TextConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextConfig' from JSON`);
24
- }
25
- //# sourceMappingURL=textconfig.js.map