@openrouter/sdk 1.1.10 → 1.1.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: "1.1.10";
52
+ readonly sdkVersion: "1.1.12";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.1.10 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.1.12 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.1.10",
29
+ sdkVersion: "1.1.12",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.1.10 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.1.12 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -18,7 +18,7 @@ export type UniqueInsight = {
18
18
  model: string;
19
19
  };
20
20
  /**
21
- * Structured analysis produced by the fusion judge model.
21
+ * Structured analysis produced by the fusion analyst model.
22
22
  */
23
23
  export type FusionAnalysisResult = {
24
24
  blindSpots: Array<string>;
@@ -3,11 +3,11 @@ import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
4
  import { FusionAnalysisResult } from "./fusionanalysisresult.js";
5
5
  /**
6
- * Emitted when the fusion judge completes with the structured analysis.
6
+ * Emitted when the fusion analyst completes with the structured analysis.
7
7
  */
8
8
  export type FusionCallAnalysisCompletedEvent = {
9
9
  /**
10
- * Structured analysis produced by the fusion judge model.
10
+ * Structured analysis produced by the fusion analyst model.
11
11
  */
12
12
  analysis: FusionAnalysisResult;
13
13
  itemId: string;
@@ -2,10 +2,19 @@ import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
4
  /**
5
- * Emitted when the fusion judge starts producing the structured analysis.
5
+ * Emitted when the fusion analyst starts producing the structured analysis.
6
6
  */
7
7
  export type FusionCallAnalysisInProgressEvent = {
8
+ /**
9
+ * Slug of the model producing the structured analysis.
10
+ */
11
+ analystModel: string;
8
12
  itemId: string;
13
+ /**
14
+ * Deprecated alias of `analyst_model`, kept so existing consumers keep working. Always carries the same value. Use `analyst_model`.
15
+ *
16
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
17
+ */
9
18
  judgeModel: string;
10
19
  outputIndex: number;
11
20
  sequenceNumber: number;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  /** @internal */
9
9
  export const FusionCallAnalysisInProgressEvent$inboundSchema = z.object({
10
+ analyst_model: z.string(),
10
11
  item_id: z.string(),
11
12
  judge_model: z.string(),
12
13
  output_index: z.int(),
@@ -14,6 +15,7 @@ export const FusionCallAnalysisInProgressEvent$inboundSchema = z.object({
14
15
  type: z.literal("response.fusion_call.analysis.in_progress"),
15
16
  }).transform((v) => {
16
17
  return remap$(v, {
18
+ "analyst_model": "analystModel",
17
19
  "item_id": "itemId",
18
20
  "judge_model": "judgeModel",
19
21
  "output_index": "outputIndex",
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  /**
4
- * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
4
+ * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
5
5
  */
6
6
  export declare const PresetEnum: {
7
7
  readonly GeneralHigh: "general-high";
@@ -9,7 +9,7 @@ export declare const PresetEnum: {
9
9
  readonly GeneralFast: "general-fast";
10
10
  };
11
11
  /**
12
- * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
12
+ * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
13
13
  */
14
14
  export type PresetEnum = OpenEnum<typeof PresetEnum>;
15
15
  export type Parameters2 = string | number | boolean;
@@ -33,7 +33,7 @@ export type FusionPluginTool = {
33
33
  };
34
34
  export type FusionPlugin = {
35
35
  /**
36
- * Slugs of models to run in parallel as the "expert panel" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest).
36
+ * Slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest).
37
37
  */
38
38
  analysisModels?: Array<string> | undefined;
39
39
  /**
@@ -42,19 +42,19 @@ export type FusionPlugin = {
42
42
  enabled?: boolean | undefined;
43
43
  id: "fusion";
44
44
  /**
45
- * Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.
45
+ * Maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.
46
46
  */
47
47
  maxToolCalls?: number | undefined;
48
48
  /**
49
- * Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset.
49
+ * Slug of the model that performs both the analyst step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset.
50
50
  */
51
51
  model?: string | undefined;
52
52
  /**
53
- * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
53
+ * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
54
54
  */
55
55
  preset?: PresetEnum | undefined;
56
56
  /**
57
- * Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).
57
+ * Server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).
58
58
  */
59
59
  tools?: Array<FusionPluginTool> | undefined;
60
60
  };
@@ -6,7 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
8
  /**
9
- * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
9
+ * A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
10
10
  */
11
11
  export const PresetEnum = {
12
12
  GeneralHigh: "general-high",
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
4
4
  /**
5
- * Reasoning effort level for panelist and judge inner calls.
5
+ * Reasoning effort level for panelist and analyst inner calls.
6
6
  */
7
7
  export declare const FusionServerToolConfigEffort: {
8
8
  readonly Max: "max";
@@ -14,19 +14,19 @@ export declare const FusionServerToolConfigEffort: {
14
14
  readonly None: "none";
15
15
  };
16
16
  /**
17
- * Reasoning effort level for panelist and judge inner calls.
17
+ * Reasoning effort level for panelist and analyst inner calls.
18
18
  */
19
19
  export type FusionServerToolConfigEffort = OpenEnum<typeof FusionServerToolConfigEffort>;
20
20
  /**
21
- * Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking.
21
+ * Reasoning configuration forwarded to panelist and analyst inner calls. Use this to control reasoning effort and token budget for models that support extended thinking.
22
22
  */
23
23
  export type FusionServerToolConfigReasoning = {
24
24
  /**
25
- * Reasoning effort level for panelist and judge inner calls.
25
+ * Reasoning effort level for panelist and analyst inner calls.
26
26
  */
27
27
  effort?: FusionServerToolConfigEffort | undefined;
28
28
  /**
29
- * Maximum number of reasoning tokens each panelist and judge model may use. Helps bound cost when models allocate too much budget to chain-of-thought.
29
+ * Maximum number of reasoning tokens each panelist and analyst model may use. Helps bound cost when models allocate too much budget to chain-of-thought.
30
30
  */
31
31
  maxTokens?: number | undefined;
32
32
  };
@@ -47,7 +47,7 @@ export type FusionServerToolConfigTool = {
47
47
  */
48
48
  export type FusionServerToolConfig = {
49
49
  /**
50
- * Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.
50
+ * Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then an analyst model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.
51
51
  */
52
52
  analysisModels?: Array<string> | undefined;
53
53
  /**
@@ -55,27 +55,27 @@ export type FusionServerToolConfig = {
55
55
  */
56
56
  cacheControl?: AnthropicCacheControlDirective | undefined;
57
57
  /**
58
- * Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 20000.
58
+ * Maximum number of output tokens (including reasoning tokens) each panelist and the analyst model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the analyst to 20000.
59
59
  */
60
60
  maxCompletionTokens?: number | undefined;
61
61
  /**
62
- * Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.
62
+ * Maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.
63
63
  */
64
64
  maxToolCalls?: number | undefined;
65
65
  /**
66
- * Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request.
66
+ * Slug of the analyst model that produces the structured analysis JSON. Defaults to the model used in the outer API request.
67
67
  */
68
68
  model?: string | undefined;
69
69
  /**
70
- * Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking.
70
+ * Reasoning configuration forwarded to panelist and analyst inner calls. Use this to control reasoning effort and token budget for models that support extended thinking.
71
71
  */
72
72
  reasoning?: FusionServerToolConfigReasoning | undefined;
73
73
  /**
74
- * Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.
74
+ * Temperature forwarded to panelist inner calls. The analyst always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.
75
75
  */
76
76
  temperature?: number | undefined;
77
77
  /**
78
- * Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).
78
+ * Server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).
79
79
  */
80
80
  tools?: Array<FusionServerToolConfigTool> | undefined;
81
81
  };
@@ -7,7 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
8
  import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
9
9
  /**
10
- * Reasoning effort level for panelist and judge inner calls.
10
+ * Reasoning effort level for panelist and analyst inner calls.
11
11
  */
12
12
  export const FusionServerToolConfigEffort = {
13
13
  Max: "max",
@@ -6,7 +6,7 @@ export declare const FusionServerToolOpenRouterType: {
6
6
  };
7
7
  export type FusionServerToolOpenRouterType = ClosedEnum<typeof FusionServerToolOpenRouterType>;
8
8
  /**
9
- * OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from.
9
+ * OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks an analyst model to summarize their collective output as structured JSON the outer model can synthesize from.
10
10
  */
11
11
  export type FusionServerToolOpenRouter = {
12
12
  /**
@@ -10,7 +10,7 @@ export type FusionSource = {
10
10
  */
11
11
  title: string;
12
12
  /**
13
- * URL of the web page a panel or the judge retrieved during the run.
13
+ * URL of the web page a panel or the analyst retrieved during the run.
14
14
  */
15
15
  url: string;
16
16
  };
@@ -32,7 +32,7 @@ export type OutputFusionServerToolItemType = ClosedEnum<typeof OutputFusionServe
32
32
  */
33
33
  export type OutputFusionServerToolItem = {
34
34
  /**
35
- * Structured analysis produced by the fusion judge model.
35
+ * Structured analysis produced by the fusion analyst model.
36
36
  */
37
37
  analysis?: FusionAnalysisResult | undefined;
38
38
  /**
@@ -44,7 +44,7 @@ export type OutputFusionServerToolItem = {
44
44
  */
45
45
  failedModels?: Array<FailedModel> | undefined;
46
46
  /**
47
- * Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion.
47
+ * Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. The four analysis-stage codes keep their pre-rename `judge_` spelling so existing consumers keep matching.
48
48
  */
49
49
  failureReason?: string | undefined;
50
50
  id?: string | undefined;
@@ -53,7 +53,7 @@ export type OutputFusionServerToolItem = {
53
53
  */
54
54
  responses?: Array<ResponseT> | undefined;
55
55
  /**
56
- * Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.
56
+ * Web pages the analysis panels and analyst retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.
57
57
  */
58
58
  sources?: Array<FusionSource> | undefined;
59
59
  status: ToolCallStatus;
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.1.10",
5
+ "version": "1.1.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": "1.1.10",
3
+ "version": "1.1.12",
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
- "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test": "vitest --run --project unit",
79
76
  "test:transit": "exit 0",
80
77
  "test:watch": "vitest --watch --project unit",
81
78
  "typecheck:transit": "exit 0",
79
+ "typecheck": "tsc --noEmit",
80
+ "compile": "tsc",
81
+ "postinstall": "node scripts/check-types.js || true",
82
82
  "prepare": "npm run build",
83
- "test:e2e": "vitest --run --project e2e",
84
- "typecheck": "tsc --noEmit"
83
+ "test": "vitest --run --project unit",
84
+ "test:e2e": "vitest --run --project e2e"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {