@x12i/ai-gateway 10.2.0 → 10.2.1

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.
package/README.md CHANGED
@@ -88,7 +88,7 @@ console.log(response.content, response.metadata?.costUsd, response.metadata?.tok
88
88
  ### Providers without manual `register()`
89
89
 
90
90
  - **OpenRouter:** Set **`OPENROUTER_API_KEY`** in `.env`. The gateway always passes this key to the router when set. **By default, OpenRouter is preferred** for routing (including when you also have direct keys such as `OPENAI_API_KEY`). **`@x12i/ai-tools`** resolves concrete model ids + provider via `resolveInvokeModel()` (catalog normalization, OpenRouter vs direct transport, router proxy flags). Pass catalog model ids such as `openai/gpt-4o-mini` or `{ provider: 'openrouter', model: 'deepseek/deepseek-v4-pro' }`. Composite display slugs like `openrouter/deepseek/deepseek-v4-pro` are split at ingress (see **Invoke model ingress** below). Profile/choice aliases (`cheap/default`, …) must be resolved upstream (ai-tasks / `resolveAIProfile`) — the gateway rejects them with **`GATEWAY_ALIAS_MODEL_REJECTED`**.
91
- - **`USE_OPENROUTER=false`:** Do **not** prefer OpenRouter when a direct provider API key exists — use the direct provider instead. OpenRouter is **still** used as **fallback** when the request targets a provider without a direct key (e.g. `anthropic` without `ANTHROPIC_API_KEY`). It does not disable OpenRouter while `OPENROUTER_API_KEY` is set.
91
+ - **`PREFER_OPENROUTER=false`:** Do **not** prefer OpenRouter when a direct provider API key exists — use the direct provider instead. OpenRouter is **still** used as **fallback** when the request targets a provider without a direct key (e.g. `anthropic` without `ANTHROPIC_API_KEY`). It does not disable OpenRouter while `OPENROUTER_API_KEY` is set.
92
92
  - **Direct providers:** Set `OPENAI_API_KEY`, `GROK_API_KEY`, etc. Registered lazily on first invoke.
93
93
 
94
94
  Details: [OpenRouter env](./docs/OPENROUTER_ENV.md).
@@ -191,7 +191,7 @@ Instructions must be **complete caller text** — the gateway no longer injects
191
191
  | `AI_GATEWAY_VERBOSE` | Full payload lines (still requires `AI_GATEWAY_LOGS_LEVEL=verbose`) |
192
192
  | `LOGXER_PACKAGE_LEVELS` | Bulk stack levels, e.g. `AI_GATEWAY:info,AI_PROVIDER_ROUTER:debug` |
193
193
  | `OPENROUTER_API_KEY` | OpenRouter key; always wired when set (required for OpenRouter transport) |
194
- | `USE_OPENROUTER` | Optional; default **prefer** OpenRouter when key is set. `false` = use direct provider keys when present; OpenRouter still used as fallback when a provider has no key |
194
+ | `PREFER_OPENROUTER` | Optional; default **prefer** OpenRouter when key is set. `false` = use direct provider keys when present; OpenRouter still used as fallback when a provider has no key |
195
195
  | Other provider keys | `OPENAI_API_KEY`, `GROK_API_KEY`, etc. |
196
196
 
197
197
  Logging details: [Logger initialization](./docs/LOGGER_INITIALIZATION.md). Package identity and audit checklist: [LOGXER_INTEGRATION_CHECKLIST.md](./docs/LOGXER_INTEGRATION_CHECKLIST.md).
@@ -256,7 +256,7 @@ Implemented in **`resolveCostCompletionWithAiTools`** only ( **`CostCalculator.c
256
256
 
257
257
  - **No Catalox / Firestore** — catalogs come from ai-tools open-assets JSON (optional **`bundledOnly`**).
258
258
 
259
- Gateway exports the model orchestrator from `@x12i/ai-tools` ≥ **3.0.0** (`resolveInvokeModel`, `useOpenRouter`, …). Profile/choice keys (`cheap/default`, …) must be resolved **before** invoke — the gateway does not run alias resolution. Shortcuts like `cheapest` / bare `cheap` are rejected at ingress or catalog resolution.
259
+ Gateway exports the model orchestrator from `@x12i/ai-tools` ≥ **3.3.0** (`resolveInvokeModel`, `preferOpenRouter`, …). Profile/choice keys (`cheap/default`, …) must be resolved **before** invoke — the gateway does not run alias resolution. Shortcuts like `cheapest` / bare `cheap` are rejected at ingress or catalog resolution.
260
260
 
261
261
  Gateway billing helpers (exported for tests/integrators): `resolveCostCompletionWithAiTools`, `buildGatewayPricingRecord`, `catalogPricingSucceeded`, `buildTraceUsageSummary`, `enrichTraceAttemptsWithBilling`.
262
262
 
@@ -358,7 +358,7 @@ Full index: **[docs/README.md](./docs/README.md)**. Upstream gaps: **[docs/upstr
358
358
  |----------|--------|
359
359
  | [AI_GATEWAY_INVOKE_EXECUTION_METADATA.md](./docs/AI_GATEWAY_INVOKE_EXECUTION_METADATA.md) | Metadata, cost, trace, Activix completion |
360
360
  | [IDENTITY_OBJECT_CONTRACT.md](./docs/IDENTITY_OBJECT_CONTRACT.md) | Identity / `runContext` |
361
- | [OPENROUTER_ENV.md](./docs/OPENROUTER_ENV.md) | `OPENROUTER_API_KEY` and `USE_OPENROUTER` |
361
+ | [OPENROUTER_ENV.md](./docs/OPENROUTER_ENV.md) | `OPENROUTER_API_KEY` and `PREFER_OPENROUTER` |
362
362
  | [UPSTREAM_PROFILE_RESOLUTION_AND_OPENROUTER_FALLBACK.md](./docs/UPSTREAM_PROFILE_RESOLUTION_AND_OPENROUTER_FALLBACK.md) | Profile routing + OpenRouter fallback |
363
363
  | [UPSTREAM_TEMPLATE_RENDERING_AND_PARSER_V4.md](./docs/UPSTREAM_TEMPLATE_RENDERING_AND_PARSER_V4.md) | Parser v4 + `template-rendering.json` |
364
364
  | [GRAPH_EXECUTION_SUPPORT.md](./docs/GRAPH_EXECUTION_SUPPORT.md) | Graph / node identity |
@@ -9,7 +9,7 @@ export type AiToolsClientBundle = AiToolsInvokeClient;
9
9
  export { resolveInvokeModel, applyOpenRouterInvokeRouting, buildInvokeModelResolverOptions, enrichModelResolutionError, mapResolutionToRouterConfig, ModelProfileUnroutableError, ModelProfileInputRejectedError, MODEL_PROFILE_UNROUTABLE, getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, createAiToolsInvokeClient, } from '@x12i/ai-tools';
10
10
  /** @deprecated Use `applyOpenRouterInvokeRouting` (ai-tools v3). */
11
11
  export { applyOpenRouterInvokeRouting as applyOpenRouterInvokePolicy } from '@x12i/ai-tools';
12
- export { resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
12
+ export { resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
13
13
  export type { InvokeModelResolutionDiagnostics, InvokeModelResolutionInput, InvokeModelResolutionOptions, InvokeModelResolutionResult, InvokeRouterConfigSlice, AiToolsInvokeClient, } from '@x12i/ai-tools';
14
14
  /** @deprecated Use buildInvokeModelResolverOptions */
15
15
  export declare function buildModelResolverOptions(config: GatewayConfig, routingEnv?: OpenRouterRoutingConfig): import("@x12i/ai-tools").ModelResolverOptions;
@@ -4,11 +4,11 @@
4
4
  */
5
5
  import { getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, CostCalculator, } from '@x12i/ai-tools';
6
6
  import { gatewayLogDebug, withActivityIdentity } from './gateway-log-meta.js';
7
- import { resolveUseOpenRouter } from './openrouter-routing.js';
7
+ import { resolvePreferOpenRouter } from './openrouter-routing.js';
8
8
  export { resolveInvokeModel, applyOpenRouterInvokeRouting, buildInvokeModelResolverOptions, enrichModelResolutionError, mapResolutionToRouterConfig, ModelProfileUnroutableError, ModelProfileInputRejectedError, MODEL_PROFILE_UNROUTABLE, getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, createAiToolsInvokeClient, } from '@x12i/ai-tools';
9
9
  /** @deprecated Use `applyOpenRouterInvokeRouting` (ai-tools v3). */
10
10
  export { applyOpenRouterInvokeRouting as applyOpenRouterInvokePolicy } from '@x12i/ai-tools';
11
- export { resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
11
+ export { resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
12
12
  let bootstrapFailedLogged = false;
13
13
  function invokeClientOptions(config) {
14
14
  return {
@@ -29,7 +29,7 @@ function withCatalogLaneCalculator(client, config) {
29
29
  resolverOptions: buildInvokeModelResolverOptions({
30
30
  routingEnv: client.routingEnv,
31
31
  catalogLane: lane,
32
- useOpenRouter: resolveUseOpenRouter(config),
32
+ preferOpenRouter: resolvePreferOpenRouter(config),
33
33
  })
34
34
  })
35
35
  };
@@ -38,7 +38,7 @@ function withCatalogLaneCalculator(client, config) {
38
38
  export function buildModelResolverOptions(config, routingEnv) {
39
39
  return buildInvokeModelResolverOptions({
40
40
  routingEnv,
41
- useOpenRouter: resolveUseOpenRouter(config),
41
+ preferOpenRouter: resolvePreferOpenRouter(config),
42
42
  });
43
43
  }
44
44
  /**
@@ -37,6 +37,6 @@ export declare function initializeGatewayComponents(config: GatewayConfig): {
37
37
  activityManager: ActivityManager;
38
38
  usageTracker: UsageTracker;
39
39
  messageBuilderConfig: MessageBuilderConfig;
40
- useOpenRouter: boolean;
40
+ preferOpenRouter: boolean;
41
41
  openRouterApiKey?: string;
42
42
  };
@@ -5,7 +5,7 @@
5
5
  import * as fs from 'fs';
6
6
  import * as path from 'path';
7
7
  import { fileURLToPath } from 'url';
8
- import { resolveOpenRouterApiKey, resolveUseOpenRouter, } from './openrouter-routing.js';
8
+ import { resolveOpenRouterApiKey, resolvePreferOpenRouter, } from './openrouter-routing.js';
9
9
  import { LLMProviderRouter } from '@x12i/ai-providers-router';
10
10
  import { createGatewayLogger } from './logger-factory.js';
11
11
  import { ActivityManager } from './activity-manager.js';
@@ -154,14 +154,14 @@ export function initializeGatewayComponents(config) {
154
154
  if (config.logging !== undefined)
155
155
  routerConfig.logging = config.logging;
156
156
  const openRouterKey = resolveOpenRouterApiKey(config);
157
- const useOpenRouter = resolveUseOpenRouter(config);
157
+ const preferOpenRouter = resolvePreferOpenRouter(config);
158
158
  if (openRouterKey) {
159
159
  routerConfig.openrouter = { apiKey: openRouterKey };
160
160
  routerConfig.openRouter = {
161
161
  enabled: true,
162
- prefer: useOpenRouter,
162
+ prefer: preferOpenRouter,
163
163
  };
164
- if (useOpenRouter) {
164
+ if (preferOpenRouter) {
165
165
  routerConfig.defaultMode = 'openrouter';
166
166
  }
167
167
  }
@@ -190,7 +190,7 @@ export function initializeGatewayComponents(config) {
190
190
  activityManager,
191
191
  usageTracker,
192
192
  messageBuilderConfig,
193
- useOpenRouter,
193
+ preferOpenRouter,
194
194
  openRouterApiKey: openRouterKey,
195
195
  };
196
196
  }
@@ -17,7 +17,7 @@ export type MergeConfigOptions = {
17
17
  catalog?: AiModelsCatalogClient | null;
18
18
  routingEnv?: OpenRouterRoutingConfig;
19
19
  openRouterApiKey?: string;
20
- useOpenRouter?: boolean;
20
+ preferOpenRouter?: boolean;
21
21
  };
22
22
  export { MODEL_PROFILE_UNROUTABLE, ModelProfileUnroutableError, ModelProfileInputRejectedError, } from '@x12i/ai-tools';
23
23
  /**
@@ -100,7 +100,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
100
100
  throw new ModelRequiredError();
101
101
  }
102
102
  const ingress = normalizeInvokeModelAtIngress(merged.provider, explicitModel, {
103
- useOpenRouter: mergeOptions?.useOpenRouter,
103
+ preferOpenRouter: mergeOptions?.preferOpenRouter,
104
104
  });
105
105
  if (ingress.changed) {
106
106
  logger.verbose('Invoke model normalized at ingress', {
@@ -121,7 +121,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
121
121
  catalog: mergeOptions.catalog,
122
122
  routingEnv: mergeOptions.routingEnv,
123
123
  openRouterApiKey: mergeOptions.openRouterApiKey,
124
- useOpenRouter: mergeOptions.useOpenRouter,
124
+ preferOpenRouter: mergeOptions.preferOpenRouter,
125
125
  defaultProvider: config.defaultEngine,
126
126
  resolveModels: true,
127
127
  modelsOnly: config.aiTools?.modelsOnly !== false,
@@ -163,7 +163,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
163
163
  resolveModels: false,
164
164
  routingEnv: mergeOptions.routingEnv,
165
165
  openRouterApiKey: mergeOptions.openRouterApiKey,
166
- useOpenRouter: mergeOptions.useOpenRouter,
166
+ preferOpenRouter: mergeOptions.preferOpenRouter,
167
167
  defaultProvider: config.defaultEngine,
168
168
  });
169
169
  merged.provider = resolved.router.provider;
package/dist/gateway.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare class AIGateway {
18
18
  private messageBuilderConfig?;
19
19
  private _autoRegisterDone;
20
20
  private _aiToolsClient;
21
- private readonly useOpenRouter;
21
+ private readonly preferOpenRouter;
22
22
  private readonly openRouterApiKey?;
23
23
  constructor(config?: GatewayConfig, activityManager?: ActivityManager);
24
24
  /**
package/dist/gateway.js CHANGED
@@ -59,7 +59,7 @@ export class AIGateway {
59
59
  messageBuilderConfig;
60
60
  _autoRegisterDone = false;
61
61
  _aiToolsClient = null;
62
- useOpenRouter;
62
+ preferOpenRouter;
63
63
  openRouterApiKey;
64
64
  constructor(config = {}, activityManager) {
65
65
  this.config = config;
@@ -69,7 +69,7 @@ export class AIGateway {
69
69
  this.router = components.router;
70
70
  this.activityManager = components.activityManager;
71
71
  this.messageBuilderConfig = components.messageBuilderConfig;
72
- this.useOpenRouter = components.useOpenRouter;
72
+ this.preferOpenRouter = components.preferOpenRouter;
73
73
  this.openRouterApiKey = components.openRouterApiKey;
74
74
  setGatewayRuntimeClients({
75
75
  activix: this.activityManager?.getTracker(),
@@ -100,7 +100,7 @@ export class AIGateway {
100
100
  catalog: aiTools?.catalog ?? null,
101
101
  routingEnv: aiTools?.routingEnv,
102
102
  openRouterApiKey: this.openRouterApiKey,
103
- useOpenRouter: this.useOpenRouter,
103
+ preferOpenRouter: this.preferOpenRouter,
104
104
  });
105
105
  // Activix start snapshot must match what the router receives (modelConfig-only callers omit request.config.model).
106
106
  request._mergedRouterConfig = mergedConfig;
@@ -288,7 +288,7 @@ export class AIGateway {
288
288
  catalog: aiTools?.catalog ?? null,
289
289
  routingEnv: aiTools?.routingEnv,
290
290
  openRouterApiKey: this.openRouterApiKey,
291
- useOpenRouter: this.useOpenRouter,
291
+ preferOpenRouter: this.preferOpenRouter,
292
292
  });
293
293
  request._mergedRouterConfig = mergedConfig;
294
294
  logResolvedModelRouting(this.logger, request, mergedConfig);
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ export { GATEWAY_LOG_ENV_PREFIX, GATEWAY_LOGXER_PACKAGE, GATEWAY_STACK_LOG_PREFI
42
42
  export { GatewayLogCode, gatewayErrorCode, gatewayInfoCode, gatewayWarnCode, gatewayAnomalyMeta, resolveLogDiagnosticsCatalogPath, exceptionEvidence, fieldEvidence } from './gateway-log-diagnostics.js';
43
43
  export type { GatewayLogCode as GatewayDiagnosticCode } from './gateway-log-diagnostics.js';
44
44
  /** Re-export @x12i/ai-tools invoke orchestrator (≥ 3.0.0) for engine callers. */
45
- export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
45
+ export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
46
46
  export type { AiToolsClientBundle, AiToolsInvokeClient, InvokeModelResolutionDiagnostics, InvokeModelResolutionInput, InvokeModelResolutionOptions, InvokeModelResolutionResult, InvokeRouterConfigSlice, } from './ai-tools-client.js';
47
47
  export { createLogxer, DebugLogAbstract, runWithLogContext, getStationRuntimeIdentity, mergeRuntimeIdentity, conditionEvidence, sourceEvidence, logReferenceEvidence, readAgentLoggingInstructions, resolveAgentLoggingInstructionsPath, applyPackageLogLevelsFromEnv, configurePackageLogLevels, mergePackageLogLevelsConfig, setPackageLogLevel, resolveStackLogLevelForPrefix, resolvePackageLogsLevel, parseLogxerPackageLevelsEnv, LOGXER_PACKAGE_LEVELS_ENV, LOGXER_PACKAGE_LOGS_DEFAULT_ENV } from '@x12i/logxer';
48
48
  export { ROUTER_LOG_ENV_PREFIX } from '@x12i/ai-providers-router';
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ export { createGatewayLogger, resolveGatewayVerboseEnabled } from './logger-fact
35
35
  export { GATEWAY_LOG_ENV_PREFIX, GATEWAY_LOGXER_PACKAGE, GATEWAY_STACK_LOG_PREFIXES, initializeGatewayPackageLogLevels, resetGatewayPackageLogLevelsInit } from './gateway-log-levels.js';
36
36
  export { GatewayLogCode, gatewayErrorCode, gatewayInfoCode, gatewayWarnCode, gatewayAnomalyMeta, resolveLogDiagnosticsCatalogPath, exceptionEvidence, fieldEvidence } from './gateway-log-diagnostics.js';
37
37
  /** Re-export @x12i/ai-tools invoke orchestrator (≥ 3.0.0) for engine callers. */
38
- export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
38
+ export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
39
39
  // Re-export logging (@x12i/logxer)
40
40
  export { createLogxer, DebugLogAbstract, runWithLogContext, getStationRuntimeIdentity, mergeRuntimeIdentity, conditionEvidence, sourceEvidence, logReferenceEvidence, readAgentLoggingInstructions, resolveAgentLoggingInstructionsPath, applyPackageLogLevelsFromEnv, configurePackageLogLevels, mergePackageLogLevelsConfig, setPackageLogLevel, resolveStackLogLevelForPrefix, resolvePackageLogsLevel, parseLogxerPackageLevelsEnv, LOGXER_PACKAGE_LEVELS_ENV, LOGXER_PACKAGE_LOGS_DEFAULT_ENV } from '@x12i/logxer';
41
41
  export { ROUTER_LOG_ENV_PREFIX } from '@x12i/ai-providers-router';
@@ -3,7 +3,7 @@
3
3
  * Defense in depth before catalog lookup / `resolveInvokeModel`.
4
4
  */
5
5
  export type InvokeModelIngressOptions = {
6
- useOpenRouter?: boolean;
6
+ preferOpenRouter?: boolean;
7
7
  };
8
8
  export type InvokeModelIngressResult = {
9
9
  provider: string;
@@ -33,8 +33,8 @@ export function normalizeInvokeModelAtIngress(provider, model, options = {}) {
33
33
  model: inputModel,
34
34
  provider: inputProvider,
35
35
  routing: 'auto',
36
- useOpenRouter: options.useOpenRouter,
37
- }, { useOpenRouter: options.useOpenRouter });
36
+ preferOpenRouter: options.preferOpenRouter,
37
+ }, { preferOpenRouter: options.preferOpenRouter });
38
38
  const changed = normalized.provider !== (inputProvider?.toLowerCase() ?? inputProvider) ||
39
39
  normalized.model !== inputModel;
40
40
  return {
@@ -1,16 +1,12 @@
1
1
  /**
2
- * Gateway-level OpenRouter key + USE_OPENROUTER flags mapped to @x12i/ai-tools v3 invoke helpers.
2
+ * Gateway-level OpenRouter key + PREFER_OPENROUTER flags mapped to @x12i/ai-tools invoke helpers.
3
3
  */
4
- import { readUseOpenRouterFromEnv } from '@x12i/ai-profiles';
4
+ import { readPreferOpenRouterFromEnv } from '@x12i/ai-profiles';
5
5
  import type { GatewayConfig } from './types.js';
6
- export { readUseOpenRouterFromEnv };
6
+ export { readPreferOpenRouterFromEnv };
7
7
  export declare function resolveOpenRouterApiKey(config?: GatewayConfig): string | undefined;
8
8
  /**
9
- * Effective OpenRouter preference for invoke-time routing (ai-tools `useOpenRouter`).
10
- * Constructor `openRouter.prefer` / `openRouter.enabled` override env `USE_OPENROUTER`.
9
+ * Effective OpenRouter preference for invoke-time routing (ai-tools `preferOpenRouter`).
10
+ * Constructor `openRouter.prefer` / `openRouter.enabled` override env `PREFER_OPENROUTER`.
11
11
  */
12
- export declare function resolveUseOpenRouter(config?: GatewayConfig): boolean;
13
- /** @deprecated Use {@link resolveUseOpenRouter} (ai-tools v3 renamed prefer → useOpenRouter). */
14
12
  export declare function resolvePreferOpenRouter(config?: GatewayConfig): boolean;
15
- /** @deprecated Use {@link readUseOpenRouterFromEnv} from `@x12i/ai-profiles`. */
16
- export declare function readPreferOpenRouterFromEnv(): boolean;
@@ -1,17 +1,17 @@
1
1
  /**
2
- * Gateway-level OpenRouter key + USE_OPENROUTER flags mapped to @x12i/ai-tools v3 invoke helpers.
2
+ * Gateway-level OpenRouter key + PREFER_OPENROUTER flags mapped to @x12i/ai-tools invoke helpers.
3
3
  */
4
- import { resolveOpenRouterApiKey as resolveOpenRouterApiKeyFromTools, resolveUseOpenRouterPreference, } from '@x12i/ai-tools';
5
- import { readUseOpenRouterFromEnv } from '@x12i/ai-profiles';
6
- export { readUseOpenRouterFromEnv };
4
+ import { resolveOpenRouterApiKey as resolveOpenRouterApiKeyFromTools, resolvePreferOpenRouterPreference, } from '@x12i/ai-tools';
5
+ import { readPreferOpenRouterFromEnv } from '@x12i/ai-profiles';
6
+ export { readPreferOpenRouterFromEnv };
7
7
  export function resolveOpenRouterApiKey(config = {}) {
8
8
  return resolveOpenRouterApiKeyFromTools(config.openrouter?.apiKey);
9
9
  }
10
10
  /**
11
- * Effective OpenRouter preference for invoke-time routing (ai-tools `useOpenRouter`).
12
- * Constructor `openRouter.prefer` / `openRouter.enabled` override env `USE_OPENROUTER`.
11
+ * Effective OpenRouter preference for invoke-time routing (ai-tools `preferOpenRouter`).
12
+ * Constructor `openRouter.prefer` / `openRouter.enabled` override env `PREFER_OPENROUTER`.
13
13
  */
14
- export function resolveUseOpenRouter(config = {}) {
14
+ export function resolvePreferOpenRouter(config = {}) {
15
15
  if (config.openRouter?.prefer === true)
16
16
  return true;
17
17
  if (config.openRouter?.prefer === false)
@@ -20,13 +20,5 @@ export function resolveUseOpenRouter(config = {}) {
20
20
  return true;
21
21
  if (config.openRouter?.enabled === false)
22
22
  return false;
23
- return resolveUseOpenRouterPreference();
24
- }
25
- /** @deprecated Use {@link resolveUseOpenRouter} (ai-tools v3 renamed prefer → useOpenRouter). */
26
- export function resolvePreferOpenRouter(config = {}) {
27
- return resolveUseOpenRouter(config);
28
- }
29
- /** @deprecated Use {@link readUseOpenRouterFromEnv} from `@x12i/ai-profiles`. */
30
- export function readPreferOpenRouterFromEnv() {
31
- return readUseOpenRouterFromEnv() ?? true;
23
+ return resolvePreferOpenRouterPreference();
32
24
  }
@@ -4,11 +4,11 @@
4
4
  */
5
5
  import { getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, CostCalculator, } from '@x12i/ai-tools';
6
6
  import { gatewayLogDebug, withActivityIdentity } from './gateway-log-meta.js';
7
- import { resolveUseOpenRouter } from './openrouter-routing.js';
7
+ import { resolvePreferOpenRouter } from './openrouter-routing.js';
8
8
  export { resolveInvokeModel, applyOpenRouterInvokeRouting, buildInvokeModelResolverOptions, enrichModelResolutionError, mapResolutionToRouterConfig, ModelProfileUnroutableError, ModelProfileInputRejectedError, MODEL_PROFILE_UNROUTABLE, getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, createAiToolsInvokeClient, } from '@x12i/ai-tools';
9
9
  /** @deprecated Use `applyOpenRouterInvokeRouting` (ai-tools v3). */
10
10
  export { applyOpenRouterInvokeRouting as applyOpenRouterInvokePolicy } from '@x12i/ai-tools';
11
- export { resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
11
+ export { resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
12
12
  let bootstrapFailedLogged = false;
13
13
  function invokeClientOptions(config) {
14
14
  return {
@@ -29,7 +29,7 @@ function withCatalogLaneCalculator(client, config) {
29
29
  resolverOptions: buildInvokeModelResolverOptions({
30
30
  routingEnv: client.routingEnv,
31
31
  catalogLane: lane,
32
- useOpenRouter: resolveUseOpenRouter(config),
32
+ preferOpenRouter: resolvePreferOpenRouter(config),
33
33
  })
34
34
  })
35
35
  };
@@ -38,7 +38,7 @@ function withCatalogLaneCalculator(client, config) {
38
38
  export function buildModelResolverOptions(config, routingEnv) {
39
39
  return buildInvokeModelResolverOptions({
40
40
  routingEnv,
41
- useOpenRouter: resolveUseOpenRouter(config),
41
+ preferOpenRouter: resolvePreferOpenRouter(config),
42
42
  });
43
43
  }
44
44
  /**
@@ -9,7 +9,7 @@ export type AiToolsClientBundle = AiToolsInvokeClient;
9
9
  export { resolveInvokeModel, applyOpenRouterInvokeRouting, buildInvokeModelResolverOptions, enrichModelResolutionError, mapResolutionToRouterConfig, ModelProfileUnroutableError, ModelProfileInputRejectedError, MODEL_PROFILE_UNROUTABLE, getAiToolsInvokeClient, resetAiToolsInvokeClientForTests as resetAiToolsInvokeClientForTestsUpstream, createAiToolsInvokeClient, } from '@x12i/ai-tools';
10
10
  /** @deprecated Use `applyOpenRouterInvokeRouting` (ai-tools v3). */
11
11
  export { applyOpenRouterInvokeRouting as applyOpenRouterInvokePolicy } from '@x12i/ai-tools';
12
- export { resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
12
+ export { resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, } from './openrouter-routing.js';
13
13
  export type { InvokeModelResolutionDiagnostics, InvokeModelResolutionInput, InvokeModelResolutionOptions, InvokeModelResolutionResult, InvokeRouterConfigSlice, AiToolsInvokeClient, } from '@x12i/ai-tools';
14
14
  /** @deprecated Use buildInvokeModelResolverOptions */
15
15
  export declare function buildModelResolverOptions(config: GatewayConfig, routingEnv?: OpenRouterRoutingConfig): import("@x12i/ai-tools").ModelResolverOptions;
@@ -5,7 +5,7 @@
5
5
  import * as fs from 'fs';
6
6
  import * as path from 'path';
7
7
  import { fileURLToPath } from 'url';
8
- import { resolveOpenRouterApiKey, resolveUseOpenRouter, } from './openrouter-routing.js';
8
+ import { resolveOpenRouterApiKey, resolvePreferOpenRouter, } from './openrouter-routing.js';
9
9
  import { LLMProviderRouter } from '@x12i/ai-providers-router';
10
10
  import { createGatewayLogger } from './logger-factory.js';
11
11
  import { ActivityManager } from './activity-manager.js';
@@ -154,14 +154,14 @@ export function initializeGatewayComponents(config) {
154
154
  if (config.logging !== undefined)
155
155
  routerConfig.logging = config.logging;
156
156
  const openRouterKey = resolveOpenRouterApiKey(config);
157
- const useOpenRouter = resolveUseOpenRouter(config);
157
+ const preferOpenRouter = resolvePreferOpenRouter(config);
158
158
  if (openRouterKey) {
159
159
  routerConfig.openrouter = { apiKey: openRouterKey };
160
160
  routerConfig.openRouter = {
161
161
  enabled: true,
162
- prefer: useOpenRouter,
162
+ prefer: preferOpenRouter,
163
163
  };
164
- if (useOpenRouter) {
164
+ if (preferOpenRouter) {
165
165
  routerConfig.defaultMode = 'openrouter';
166
166
  }
167
167
  }
@@ -190,7 +190,7 @@ export function initializeGatewayComponents(config) {
190
190
  activityManager,
191
191
  usageTracker,
192
192
  messageBuilderConfig,
193
- useOpenRouter,
193
+ preferOpenRouter,
194
194
  openRouterApiKey: openRouterKey,
195
195
  };
196
196
  }
@@ -37,6 +37,6 @@ export declare function initializeGatewayComponents(config: GatewayConfig): {
37
37
  activityManager: ActivityManager;
38
38
  usageTracker: UsageTracker;
39
39
  messageBuilderConfig: MessageBuilderConfig;
40
- useOpenRouter: boolean;
40
+ preferOpenRouter: boolean;
41
41
  openRouterApiKey?: string;
42
42
  };
@@ -100,7 +100,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
100
100
  throw new ModelRequiredError();
101
101
  }
102
102
  const ingress = normalizeInvokeModelAtIngress(merged.provider, explicitModel, {
103
- useOpenRouter: mergeOptions?.useOpenRouter,
103
+ preferOpenRouter: mergeOptions?.preferOpenRouter,
104
104
  });
105
105
  if (ingress.changed) {
106
106
  logger.verbose('Invoke model normalized at ingress', {
@@ -121,7 +121,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
121
121
  catalog: mergeOptions.catalog,
122
122
  routingEnv: mergeOptions.routingEnv,
123
123
  openRouterApiKey: mergeOptions.openRouterApiKey,
124
- useOpenRouter: mergeOptions.useOpenRouter,
124
+ preferOpenRouter: mergeOptions.preferOpenRouter,
125
125
  defaultProvider: config.defaultEngine,
126
126
  resolveModels: true,
127
127
  modelsOnly: config.aiTools?.modelsOnly !== false,
@@ -163,7 +163,7 @@ export async function mergeConfig(request, config, logger, mergeOptions) {
163
163
  resolveModels: false,
164
164
  routingEnv: mergeOptions.routingEnv,
165
165
  openRouterApiKey: mergeOptions.openRouterApiKey,
166
- useOpenRouter: mergeOptions.useOpenRouter,
166
+ preferOpenRouter: mergeOptions.preferOpenRouter,
167
167
  defaultProvider: config.defaultEngine,
168
168
  });
169
169
  merged.provider = resolved.router.provider;
@@ -17,7 +17,7 @@ export type MergeConfigOptions = {
17
17
  catalog?: AiModelsCatalogClient | null;
18
18
  routingEnv?: OpenRouterRoutingConfig;
19
19
  openRouterApiKey?: string;
20
- useOpenRouter?: boolean;
20
+ preferOpenRouter?: boolean;
21
21
  };
22
22
  export { MODEL_PROFILE_UNROUTABLE, ModelProfileUnroutableError, ModelProfileInputRejectedError, } from '@x12i/ai-tools';
23
23
  /**
@@ -59,7 +59,7 @@ export class AIGateway {
59
59
  messageBuilderConfig;
60
60
  _autoRegisterDone = false;
61
61
  _aiToolsClient = null;
62
- useOpenRouter;
62
+ preferOpenRouter;
63
63
  openRouterApiKey;
64
64
  constructor(config = {}, activityManager) {
65
65
  this.config = config;
@@ -69,7 +69,7 @@ export class AIGateway {
69
69
  this.router = components.router;
70
70
  this.activityManager = components.activityManager;
71
71
  this.messageBuilderConfig = components.messageBuilderConfig;
72
- this.useOpenRouter = components.useOpenRouter;
72
+ this.preferOpenRouter = components.preferOpenRouter;
73
73
  this.openRouterApiKey = components.openRouterApiKey;
74
74
  setGatewayRuntimeClients({
75
75
  activix: this.activityManager?.getTracker(),
@@ -100,7 +100,7 @@ export class AIGateway {
100
100
  catalog: aiTools?.catalog ?? null,
101
101
  routingEnv: aiTools?.routingEnv,
102
102
  openRouterApiKey: this.openRouterApiKey,
103
- useOpenRouter: this.useOpenRouter,
103
+ preferOpenRouter: this.preferOpenRouter,
104
104
  });
105
105
  // Activix start snapshot must match what the router receives (modelConfig-only callers omit request.config.model).
106
106
  request._mergedRouterConfig = mergedConfig;
@@ -288,7 +288,7 @@ export class AIGateway {
288
288
  catalog: aiTools?.catalog ?? null,
289
289
  routingEnv: aiTools?.routingEnv,
290
290
  openRouterApiKey: this.openRouterApiKey,
291
- useOpenRouter: this.useOpenRouter,
291
+ preferOpenRouter: this.preferOpenRouter,
292
292
  });
293
293
  request._mergedRouterConfig = mergedConfig;
294
294
  logResolvedModelRouting(this.logger, request, mergedConfig);
@@ -18,7 +18,7 @@ export declare class AIGateway {
18
18
  private messageBuilderConfig?;
19
19
  private _autoRegisterDone;
20
20
  private _aiToolsClient;
21
- private readonly useOpenRouter;
21
+ private readonly preferOpenRouter;
22
22
  private readonly openRouterApiKey?;
23
23
  constructor(config?: GatewayConfig, activityManager?: ActivityManager);
24
24
  /**
@@ -35,7 +35,7 @@ export { createGatewayLogger, resolveGatewayVerboseEnabled } from './logger-fact
35
35
  export { GATEWAY_LOG_ENV_PREFIX, GATEWAY_LOGXER_PACKAGE, GATEWAY_STACK_LOG_PREFIXES, initializeGatewayPackageLogLevels, resetGatewayPackageLogLevelsInit } from './gateway-log-levels.js';
36
36
  export { GatewayLogCode, gatewayErrorCode, gatewayInfoCode, gatewayWarnCode, gatewayAnomalyMeta, resolveLogDiagnosticsCatalogPath, exceptionEvidence, fieldEvidence } from './gateway-log-diagnostics.js';
37
37
  /** Re-export @x12i/ai-tools invoke orchestrator (≥ 3.0.0) for engine callers. */
38
- export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
38
+ export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
39
39
  // Re-export logging (@x12i/logxer)
40
40
  export { createLogxer, DebugLogAbstract, runWithLogContext, getStationRuntimeIdentity, mergeRuntimeIdentity, conditionEvidence, sourceEvidence, logReferenceEvidence, readAgentLoggingInstructions, resolveAgentLoggingInstructionsPath, applyPackageLogLevelsFromEnv, configurePackageLogLevels, mergePackageLogLevelsConfig, setPackageLogLevel, resolveStackLogLevelForPrefix, resolvePackageLogsLevel, parseLogxerPackageLevelsEnv, LOGXER_PACKAGE_LEVELS_ENV, LOGXER_PACKAGE_LOGS_DEFAULT_ENV } from '@x12i/logxer';
41
41
  export { ROUTER_LOG_ENV_PREFIX } from '@x12i/ai-providers-router';
@@ -42,7 +42,7 @@ export { GATEWAY_LOG_ENV_PREFIX, GATEWAY_LOGXER_PACKAGE, GATEWAY_STACK_LOG_PREFI
42
42
  export { GatewayLogCode, gatewayErrorCode, gatewayInfoCode, gatewayWarnCode, gatewayAnomalyMeta, resolveLogDiagnosticsCatalogPath, exceptionEvidence, fieldEvidence } from './gateway-log-diagnostics.js';
43
43
  export type { GatewayLogCode as GatewayDiagnosticCode } from './gateway-log-diagnostics.js';
44
44
  /** Re-export @x12i/ai-tools invoke orchestrator (≥ 3.0.0) for engine callers. */
45
- export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolveUseOpenRouter, resolvePreferOpenRouter, readUseOpenRouterFromEnv, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
45
+ export { resolveInvokeModel, applyModelResolution, applyOpenRouterInvokeRouting, applyOpenRouterInvokePolicy, mapResolutionToRouterConfig, buildInvokeModelResolverOptions, buildModelResolverOptions, enrichModelResolutionError, getAiToolsClient, resetAiToolsClientForTests, resolveOpenRouterApiKey, resolvePreferOpenRouter, readPreferOpenRouterFromEnv, getAiToolsInvokeClient, createAiToolsInvokeClient, } from './ai-tools-client.js';
46
46
  export type { AiToolsClientBundle, AiToolsInvokeClient, InvokeModelResolutionDiagnostics, InvokeModelResolutionInput, InvokeModelResolutionOptions, InvokeModelResolutionResult, InvokeRouterConfigSlice, } from './ai-tools-client.js';
47
47
  export { createLogxer, DebugLogAbstract, runWithLogContext, getStationRuntimeIdentity, mergeRuntimeIdentity, conditionEvidence, sourceEvidence, logReferenceEvidence, readAgentLoggingInstructions, resolveAgentLoggingInstructionsPath, applyPackageLogLevelsFromEnv, configurePackageLogLevels, mergePackageLogLevelsConfig, setPackageLogLevel, resolveStackLogLevelForPrefix, resolvePackageLogsLevel, parseLogxerPackageLevelsEnv, LOGXER_PACKAGE_LEVELS_ENV, LOGXER_PACKAGE_LOGS_DEFAULT_ENV } from '@x12i/logxer';
48
48
  export { ROUTER_LOG_ENV_PREFIX } from '@x12i/ai-providers-router';
@@ -33,8 +33,8 @@ export function normalizeInvokeModelAtIngress(provider, model, options = {}) {
33
33
  model: inputModel,
34
34
  provider: inputProvider,
35
35
  routing: 'auto',
36
- useOpenRouter: options.useOpenRouter,
37
- }, { useOpenRouter: options.useOpenRouter });
36
+ preferOpenRouter: options.preferOpenRouter,
37
+ }, { preferOpenRouter: options.preferOpenRouter });
38
38
  const changed = normalized.provider !== (inputProvider?.toLowerCase() ?? inputProvider) ||
39
39
  normalized.model !== inputModel;
40
40
  return {
@@ -3,7 +3,7 @@
3
3
  * Defense in depth before catalog lookup / `resolveInvokeModel`.
4
4
  */
5
5
  export type InvokeModelIngressOptions = {
6
- useOpenRouter?: boolean;
6
+ preferOpenRouter?: boolean;
7
7
  };
8
8
  export type InvokeModelIngressResult = {
9
9
  provider: string;
@@ -1,17 +1,17 @@
1
1
  /**
2
- * Gateway-level OpenRouter key + USE_OPENROUTER flags mapped to @x12i/ai-tools v3 invoke helpers.
2
+ * Gateway-level OpenRouter key + PREFER_OPENROUTER flags mapped to @x12i/ai-tools invoke helpers.
3
3
  */
4
- import { resolveOpenRouterApiKey as resolveOpenRouterApiKeyFromTools, resolveUseOpenRouterPreference, } from '@x12i/ai-tools';
5
- import { readUseOpenRouterFromEnv } from '@x12i/ai-profiles';
6
- export { readUseOpenRouterFromEnv };
4
+ import { resolveOpenRouterApiKey as resolveOpenRouterApiKeyFromTools, resolvePreferOpenRouterPreference, } from '@x12i/ai-tools';
5
+ import { readPreferOpenRouterFromEnv } from '@x12i/ai-profiles';
6
+ export { readPreferOpenRouterFromEnv };
7
7
  export function resolveOpenRouterApiKey(config = {}) {
8
8
  return resolveOpenRouterApiKeyFromTools(config.openrouter?.apiKey);
9
9
  }
10
10
  /**
11
- * Effective OpenRouter preference for invoke-time routing (ai-tools `useOpenRouter`).
12
- * Constructor `openRouter.prefer` / `openRouter.enabled` override env `USE_OPENROUTER`.
11
+ * Effective OpenRouter preference for invoke-time routing (ai-tools `preferOpenRouter`).
12
+ * Constructor `openRouter.prefer` / `openRouter.enabled` override env `PREFER_OPENROUTER`.
13
13
  */
14
- export function resolveUseOpenRouter(config = {}) {
14
+ export function resolvePreferOpenRouter(config = {}) {
15
15
  if (config.openRouter?.prefer === true)
16
16
  return true;
17
17
  if (config.openRouter?.prefer === false)
@@ -20,13 +20,5 @@ export function resolveUseOpenRouter(config = {}) {
20
20
  return true;
21
21
  if (config.openRouter?.enabled === false)
22
22
  return false;
23
- return resolveUseOpenRouterPreference();
24
- }
25
- /** @deprecated Use {@link resolveUseOpenRouter} (ai-tools v3 renamed prefer → useOpenRouter). */
26
- export function resolvePreferOpenRouter(config = {}) {
27
- return resolveUseOpenRouter(config);
28
- }
29
- /** @deprecated Use {@link readUseOpenRouterFromEnv} from `@x12i/ai-profiles`. */
30
- export function readPreferOpenRouterFromEnv() {
31
- return readUseOpenRouterFromEnv() ?? true;
23
+ return resolvePreferOpenRouterPreference();
32
24
  }
@@ -1,16 +1,12 @@
1
1
  /**
2
- * Gateway-level OpenRouter key + USE_OPENROUTER flags mapped to @x12i/ai-tools v3 invoke helpers.
2
+ * Gateway-level OpenRouter key + PREFER_OPENROUTER flags mapped to @x12i/ai-tools invoke helpers.
3
3
  */
4
- import { readUseOpenRouterFromEnv } from '@x12i/ai-profiles';
4
+ import { readPreferOpenRouterFromEnv } from '@x12i/ai-profiles';
5
5
  import type { GatewayConfig } from './types.js';
6
- export { readUseOpenRouterFromEnv };
6
+ export { readPreferOpenRouterFromEnv };
7
7
  export declare function resolveOpenRouterApiKey(config?: GatewayConfig): string | undefined;
8
8
  /**
9
- * Effective OpenRouter preference for invoke-time routing (ai-tools `useOpenRouter`).
10
- * Constructor `openRouter.prefer` / `openRouter.enabled` override env `USE_OPENROUTER`.
9
+ * Effective OpenRouter preference for invoke-time routing (ai-tools `preferOpenRouter`).
10
+ * Constructor `openRouter.prefer` / `openRouter.enabled` override env `PREFER_OPENROUTER`.
11
11
  */
12
- export declare function resolveUseOpenRouter(config?: GatewayConfig): boolean;
13
- /** @deprecated Use {@link resolveUseOpenRouter} (ai-tools v3 renamed prefer → useOpenRouter). */
14
12
  export declare function resolvePreferOpenRouter(config?: GatewayConfig): boolean;
15
- /** @deprecated Use {@link readUseOpenRouterFromEnv} from `@x12i/ai-profiles`. */
16
- export declare function readPreferOpenRouterFromEnv(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/ai-gateway",
3
- "version": "10.2.0",
3
+ "version": "10.2.1",
4
4
  "description": "AI Gateway - Unified interface for LLM provider routing and management",
5
5
  "type": "module",
6
6
  "exports": {
@@ -41,10 +41,10 @@
41
41
  "author": "x12i",
42
42
  "license": "mit",
43
43
  "dependencies": {
44
- "@x12i/activix": "^8.6.1",
45
- "@x12i/ai-profiles": "^3.2.0",
44
+ "@x12i/activix": "^8.6.2",
45
+ "@x12i/ai-profiles": "^3.3.0",
46
46
  "@x12i/ai-providers-router": "^4.9.2",
47
- "@x12i/ai-tools": "^3.1.0",
47
+ "@x12i/ai-tools": "^3.3.0",
48
48
  "@x12i/flex-md": "^4.8.0",
49
49
  "@x12i/logxer": "^4.6.0",
50
50
  "@x12i/rendrix": "^4.3.0"