@openrouter/sdk 1.2.60 → 1.2.62

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.
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Delete an API key
13
13
  *
14
14
  * @remarks
15
- * Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
+ * Delete an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
16
16
  */
17
17
  export declare function apiKeysDelete(client: OpenRouterCore, request: operations.DeleteKeysRequest, options?: RequestOptions): APIPromise<Result<operations.DeleteKeysResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=apiKeysDelete.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Delete an API key
17
17
  *
18
18
  * @remarks
19
- * Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Delete an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
20
20
  */
21
21
  export function apiKeysDelete(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Update an API key
13
13
  *
14
14
  * @remarks
15
- * Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
+ * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
16
16
  */
17
17
  export declare function apiKeysUpdate(client: OpenRouterCore, request: operations.UpdateKeysRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateKeysResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=apiKeysUpdate.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Update an API key
17
17
  *
18
18
  * @remarks
19
- * Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
20
20
  */
21
21
  export function apiKeysUpdate(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
@@ -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.2.60";
53
+ readonly sdkVersion: "1.2.62";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.60 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.62 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.2.60",
32
+ sdkVersion: "1.2.62",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.60 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.62 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,12 +1,18 @@
1
1
  import * as z from "zod/v4";
2
+ import { ContainerNetworkPolicy, ContainerNetworkPolicy$Outbound } from "./containernetworkpolicy.js";
2
3
  /**
3
4
  * An OpenRouter-managed, auto-provisioned ephemeral container.
4
5
  */
5
6
  export type ContainerAutoEnvironment = {
7
+ /**
8
+ * Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
9
+ */
10
+ networkPolicy?: ContainerNetworkPolicy | undefined;
6
11
  type: "container_auto";
7
12
  };
8
13
  /** @internal */
9
14
  export type ContainerAutoEnvironment$Outbound = {
15
+ network_policy?: ContainerNetworkPolicy$Outbound | undefined;
10
16
  type: "container_auto";
11
17
  };
12
18
  /** @internal */
@@ -3,9 +3,16 @@
3
3
  * @generated-id: 49526688017e
4
4
  */
5
5
  import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy.js";
6
8
  /** @internal */
7
9
  export const ContainerAutoEnvironment$outboundSchema = z.object({
10
+ networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
8
11
  type: z.literal("container_auto"),
12
+ }).transform((v) => {
13
+ return remap$(v, {
14
+ networkPolicy: "network_policy",
15
+ });
9
16
  });
10
17
  export function containerAutoEnvironmentToJSON(containerAutoEnvironment) {
11
18
  return JSON.stringify(ContainerAutoEnvironment$outboundSchema.parse(containerAutoEnvironment));
@@ -0,0 +1,42 @@
1
+ import * as z from "zod/v4";
2
+ export type ContainerNetworkPolicyAllowlist = {
3
+ /**
4
+ * Hostnames the container may reach over ports 80/443 (max 50). Entries are lowercase hostnames or glob patterns where * matches any run of characters (e.g. *.example.com). An exact hostname does not cover its subdomains — use a glob or list each hostname. pip needs both pypi.org and files.pythonhosted.org (or *.pythonhosted.org).
5
+ */
6
+ allowedDomains: Array<string>;
7
+ /**
8
+ * Outbound access restricted to the listed domains.
9
+ */
10
+ type: "allowlist";
11
+ };
12
+ export type ContainerNetworkPolicyDisabled = {
13
+ /**
14
+ * No outbound internet access.
15
+ */
16
+ type: "disabled";
17
+ };
18
+ /**
19
+ * Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
20
+ */
21
+ export type ContainerNetworkPolicy = ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist;
22
+ /** @internal */
23
+ export type ContainerNetworkPolicyAllowlist$Outbound = {
24
+ allowed_domains: Array<string>;
25
+ type: "allowlist";
26
+ };
27
+ /** @internal */
28
+ export declare const ContainerNetworkPolicyAllowlist$outboundSchema: z.ZodType<ContainerNetworkPolicyAllowlist$Outbound, ContainerNetworkPolicyAllowlist>;
29
+ export declare function containerNetworkPolicyAllowlistToJSON(containerNetworkPolicyAllowlist: ContainerNetworkPolicyAllowlist): string;
30
+ /** @internal */
31
+ export type ContainerNetworkPolicyDisabled$Outbound = {
32
+ type: "disabled";
33
+ };
34
+ /** @internal */
35
+ export declare const ContainerNetworkPolicyDisabled$outboundSchema: z.ZodType<ContainerNetworkPolicyDisabled$Outbound, ContainerNetworkPolicyDisabled>;
36
+ export declare function containerNetworkPolicyDisabledToJSON(containerNetworkPolicyDisabled: ContainerNetworkPolicyDisabled): string;
37
+ /** @internal */
38
+ export type ContainerNetworkPolicy$Outbound = ContainerNetworkPolicyDisabled$Outbound | ContainerNetworkPolicyAllowlist$Outbound;
39
+ /** @internal */
40
+ export declare const ContainerNetworkPolicy$outboundSchema: z.ZodType<ContainerNetworkPolicy$Outbound, ContainerNetworkPolicy>;
41
+ export declare function containerNetworkPolicyToJSON(containerNetworkPolicy: ContainerNetworkPolicy): string;
42
+ //# sourceMappingURL=containernetworkpolicy.d.ts.map
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ee44c31a3adf
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const ContainerNetworkPolicyAllowlist$outboundSchema = z.object({
9
+ allowedDomains: z.array(z.string()),
10
+ type: z.literal("allowlist"),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ allowedDomains: "allowed_domains",
14
+ });
15
+ });
16
+ export function containerNetworkPolicyAllowlistToJSON(containerNetworkPolicyAllowlist) {
17
+ return JSON.stringify(ContainerNetworkPolicyAllowlist$outboundSchema.parse(containerNetworkPolicyAllowlist));
18
+ }
19
+ /** @internal */
20
+ export const ContainerNetworkPolicyDisabled$outboundSchema = z.object({
21
+ type: z.literal("disabled"),
22
+ });
23
+ export function containerNetworkPolicyDisabledToJSON(containerNetworkPolicyDisabled) {
24
+ return JSON.stringify(ContainerNetworkPolicyDisabled$outboundSchema.parse(containerNetworkPolicyDisabled));
25
+ }
26
+ /** @internal */
27
+ export const ContainerNetworkPolicy$outboundSchema = z.union([
28
+ z.lazy(() => ContainerNetworkPolicyDisabled$outboundSchema),
29
+ z.lazy(() => ContainerNetworkPolicyAllowlist$outboundSchema),
30
+ ]);
31
+ export function containerNetworkPolicyToJSON(containerNetworkPolicy) {
32
+ return JSON.stringify(ContainerNetworkPolicy$outboundSchema.parse(containerNetworkPolicy));
33
+ }
34
+ //# sourceMappingURL=containernetworkpolicy.js.map
@@ -1,4 +1,5 @@
1
1
  import * as z from "zod/v4";
2
+ import { ContainerNetworkPolicy, ContainerNetworkPolicy$Outbound } from "./containernetworkpolicy.js";
2
3
  /**
3
4
  * Reference to a container by its canonical id — a previously returned container_id or a fresh name to create a persistent container.
4
5
  */
@@ -7,11 +8,16 @@ export type ContainerReferenceEnvironment = {
7
8
  * Canonical container id to reuse (max 40 characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) and generation-derived ids (gen_...). Note that a session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id you sent. Using the same container_id from both the bash and shell tools shares the same files, with last-write-wins when both flush concurrently. A fresh name creates a new persistent container. Containers are always scoped to your account and workspace.
8
9
  */
9
10
  containerId: string;
11
+ /**
12
+ * Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
13
+ */
14
+ networkPolicy?: ContainerNetworkPolicy | undefined;
10
15
  type: "container_reference";
11
16
  };
12
17
  /** @internal */
13
18
  export type ContainerReferenceEnvironment$Outbound = {
14
19
  container_id: string;
20
+ network_policy?: ContainerNetworkPolicy$Outbound | undefined;
15
21
  type: "container_reference";
16
22
  };
17
23
  /** @internal */
@@ -4,13 +4,16 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
+ import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy.js";
7
8
  /** @internal */
8
9
  export const ContainerReferenceEnvironment$outboundSchema = z.object({
9
10
  containerId: z.string(),
11
+ networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
10
12
  type: z.literal("container_reference"),
11
13
  }).transform((v) => {
12
14
  return remap$(v, {
13
15
  containerId: "container_id",
16
+ networkPolicy: "network_policy",
14
17
  });
15
18
  });
16
19
  export function containerReferenceEnvironmentToJSON(containerReferenceEnvironment) {
@@ -150,6 +150,7 @@ export * from "./conflictresponseerrordata.js";
150
150
  export * from "./containerautoenvironment.js";
151
151
  export * from "./containerfile.js";
152
152
  export * from "./containerfilelistresponse.js";
153
+ export * from "./containernetworkpolicy.js";
153
154
  export * from "./containerreferenceenvironment.js";
154
155
  export * from "./contentfilteraction.js";
155
156
  export * from "./contentfilterbuiltinaction.js";
@@ -154,6 +154,7 @@ export * from "./conflictresponseerrordata.js";
154
154
  export * from "./containerautoenvironment.js";
155
155
  export * from "./containerfile.js";
156
156
  export * from "./containerfilelistresponse.js";
157
+ export * from "./containernetworkpolicy.js";
157
158
  export * from "./containerreferenceenvironment.js";
158
159
  export * from "./contentfilteraction.js";
159
160
  export * from "./contentfilterbuiltinaction.js";
@@ -26,7 +26,7 @@ export declare class APIKeys extends ClientSDK {
26
26
  * Delete an API key
27
27
  *
28
28
  * @remarks
29
- * Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
29
+ * Delete an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
30
30
  */
31
31
  delete(request: operations.DeleteKeysRequest, options?: RequestOptions): Promise<operations.DeleteKeysResponse>;
32
32
  /**
@@ -40,7 +40,7 @@ export declare class APIKeys extends ClientSDK {
40
40
  * Update an API key
41
41
  *
42
42
  * @remarks
43
- * Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
43
+ * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
44
44
  */
45
45
  update(request: operations.UpdateKeysRequest, options?: RequestOptions): Promise<operations.UpdateKeysResponse>;
46
46
  }
@@ -42,7 +42,7 @@ export class APIKeys extends ClientSDK {
42
42
  * Delete an API key
43
43
  *
44
44
  * @remarks
45
- * Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
45
+ * Delete an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
46
46
  */
47
47
  async delete(request, options) {
48
48
  return unwrapAsync(apiKeysDelete(this, request, options));
@@ -60,7 +60,7 @@ export class APIKeys extends ClientSDK {
60
60
  * Update an API key
61
61
  *
62
62
  * @remarks
63
- * Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
63
+ * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. A client secret reaches only the keys that same client created; any other key responds as if it does not exist.
64
64
  */
65
65
  async update(request, options) {
66
66
  return unwrapAsync(apiKeysUpdate(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.60",
5
+ "version": "1.2.62",
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.2.60",
3
+ "version": "1.2.62",
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
+ "test:watch": "vitest --watch --project unit",
76
77
  "typecheck:transit": "exit 0",
77
- "compile": "tsc",
78
+ "prepare": "npm run build",
78
79
  "test": "vitest --run --project unit",
79
- "test:e2e": "vitest --run --project e2e",
80
+ "test:transit": "exit 0",
80
81
  "typecheck": "tsc --noEmit",
82
+ "compile": "tsc",
81
83
  "postinstall": "node scripts/check-types.js || true",
82
- "prepare": "npm run build",
83
- "test:transit": "exit 0",
84
- "test:watch": "vitest --watch --project unit"
84
+ "test:e2e": "vitest --run --project e2e"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {