@openrouter/sdk 1.3.33 → 1.3.34

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.
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
50
50
  export declare const SDK_METADATA: {
51
51
  readonly language: "typescript";
52
52
  readonly openapiDocVersion: "1.0.0";
53
- readonly sdkVersion: "1.3.33";
53
+ readonly sdkVersion: "1.3.34";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.3.33 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.34 2.914.0 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.3.33",
32
+ sdkVersion: "1.3.34",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.3.33 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.34 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -6,6 +6,7 @@ export declare const AnthropicWebFetchToolResultErrorErrorCode: {
6
6
  readonly InvalidToolInput: "invalid_tool_input";
7
7
  readonly UrlTooLong: "url_too_long";
8
8
  readonly UrlNotAllowed: "url_not_allowed";
9
+ readonly UrlNotInPriorContext: "url_not_in_prior_context";
9
10
  readonly UrlNotAccessible: "url_not_accessible";
10
11
  readonly UnsupportedContentType: "unsupported_content_type";
11
12
  readonly TooManyRequests: "too_many_requests";
@@ -10,6 +10,7 @@ export const AnthropicWebFetchToolResultErrorErrorCode = {
10
10
  InvalidToolInput: "invalid_tool_input",
11
11
  UrlTooLong: "url_too_long",
12
12
  UrlNotAllowed: "url_not_allowed",
13
+ UrlNotInPriorContext: "url_not_in_prior_context",
13
14
  UrlNotAccessible: "url_not_accessible",
14
15
  UnsupportedContentType: "unsupported_content_type",
15
16
  TooManyRequests: "too_many_requests",
@@ -28,6 +28,7 @@ export declare const MessagesMessageParamErrorCode: {
28
28
  readonly MaxUsesExceeded: "max_uses_exceeded";
29
29
  readonly TooManyRequests: "too_many_requests";
30
30
  readonly QueryTooLong: "query_too_long";
31
+ readonly RequestTooLarge: "request_too_large";
31
32
  };
32
33
  export type MessagesMessageParamErrorCode = OpenEnum<typeof MessagesMessageParamErrorCode>;
33
34
  export declare const MessagesMessageParamTypeWebSearchToolResultError: {
@@ -24,6 +24,7 @@ export const MessagesMessageParamErrorCode = {
24
24
  MaxUsesExceeded: "max_uses_exceeded",
25
25
  TooManyRequests: "too_many_requests",
26
26
  QueryTooLong: "query_too_long",
27
+ RequestTooLarge: "request_too_large",
27
28
  };
28
29
  export const MessagesMessageParamTypeWebSearchToolResultError = {
29
30
  WebSearchToolResultError: "web_search_tool_result_error",
@@ -8,6 +8,12 @@ import { PricingOverride } from "./pricingoverride.js";
8
8
  import { ProviderName } from "./providername.js";
9
9
  import { Quantization } from "./quantization.js";
10
10
  import { ToolChoiceSupport } from "./toolchoicesupport.js";
11
+ export type NativeTools = {
12
+ /**
13
+ * The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini.
14
+ */
15
+ type: string;
16
+ };
11
17
  export type Decisions = {
12
18
  latency: PercentileStats | null;
13
19
  /**
@@ -180,6 +186,12 @@ export type PublicEndpoint = {
180
186
  modelId: string;
181
187
  modelName: string;
182
188
  name: string;
189
+ /**
190
+ * The server tools this endpoint accepts as the provider's own built-in tool (`engine: "native"`) instead of an OpenRouter engine, keyed by canonical `openrouter:*` name. Each value names the provider tool type the request is translated to. Where that tool runs (provider-side, or returned to the client as with Anthropic bash) is documented per tool. Empty when the provider has none.
191
+ */
192
+ nativeTools: {
193
+ [k: string]: NativeTools;
194
+ };
183
195
  /**
184
196
  * Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie.
185
197
  */
@@ -219,6 +231,9 @@ export type PublicEndpoint = {
219
231
  uptimeLast5m: number | null;
220
232
  };
221
233
  /** @internal */
234
+ export declare const NativeTools$inboundSchema: z.ZodType<NativeTools, unknown>;
235
+ export declare function nativeToolsFromJSON(jsonString: string): SafeParseResult<NativeTools, SDKValidationError>;
236
+ /** @internal */
222
237
  export declare const Decisions$inboundSchema: z.ZodType<Decisions, unknown>;
223
238
  export declare function decisionsFromJSON(jsonString: string): SafeParseResult<Decisions, SDKValidationError>;
224
239
  /** @internal */
@@ -13,6 +13,14 @@ import { ProviderName$inboundSchema } from "./providername.js";
13
13
  import { Quantization$inboundSchema } from "./quantization.js";
14
14
  import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
15
15
  /** @internal */
16
+ export const NativeTools$inboundSchema = z
17
+ .object({
18
+ type: z.string(),
19
+ });
20
+ export function nativeToolsFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => NativeTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NativeTools' from JSON`);
22
+ }
23
+ /** @internal */
16
24
  export const Decisions$inboundSchema = z.object({
17
25
  latency: z.nullable(PercentileStats$inboundSchema),
18
26
  request_count: z.nullable(z.int()),
@@ -194,6 +202,7 @@ export const PublicEndpoint$inboundSchema = z.object({
194
202
  model_id: z.string(),
195
203
  model_name: z.string(),
196
204
  name: z.string(),
205
+ native_tools: z.record(z.string(), z.lazy(() => NativeTools$inboundSchema)),
197
206
  perf_last_30m_by_workload: z.lazy(() => PerfLast30mByWorkload$inboundSchema)
198
207
  .optional(),
199
208
  pricing: z.lazy(() => Pricing$inboundSchema),
@@ -219,6 +228,7 @@ export const PublicEndpoint$inboundSchema = z.object({
219
228
  "max_prompt_tokens": "maxPromptTokens",
220
229
  "model_id": "modelId",
221
230
  "model_name": "modelName",
231
+ "native_tools": "nativeTools",
222
232
  "perf_last_30m_by_workload": "perfLast30mByWorkload",
223
233
  "provider_name": "providerName",
224
234
  "supported_parameters": "supportedParameters",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.33",
5
+ "version": "1.3.34",
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.3.33",
3
+ "version": "1.3.34",
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
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "typecheck": "tsc --noEmit",
77
+ "typecheck:transit": "exit 0",
78
+ "compile": "tsc && node scripts/unbarrel-imports.js",
76
79
  "postinstall": "node scripts/check-types.js || true",
77
80
  "prepare": "npm run build",
78
81
  "test": "vitest --run --project unit",
79
82
  "test:e2e": "vitest --run --project e2e",
80
- "test:watch": "vitest --watch --project unit",
81
- "typecheck:transit": "exit 0",
82
83
  "test:transit": "exit 0",
83
- "typecheck": "tsc --noEmit",
84
- "compile": "tsc && node scripts/unbarrel-imports.js"
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87