@openrouter/sdk 1.5.32 → 1.5.33

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
  * Update a private provider
13
13
  *
14
14
  * @remarks
15
- * Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
+ * Update a private provider’s display name or base URL. The name and slug cannot change, and the data policy is fixed by OpenRouter, so a body with no editable field is rejected (400). [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
17
  export declare function privateProvidersUpdate(client: OpenRouterCore, request: operations.UpdatePrivateProviderRequest, options?: RequestOptions): APIPromise<Result<operations.UpdatePrivateProviderResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.ConflictResponseError | errors.UnprocessableEntityResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=privateProvidersUpdate.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Update a private provider
17
17
  *
18
18
  * @remarks
19
- * Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Update a private provider’s display name or base URL. The name and slug cannot change, and the data policy is fixed by OpenRouter, so a body with no editable field is rejected (400). [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  export function privateProvidersUpdate(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.5.32";
53
+ readonly sdkVersion: "1.5.33";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.32 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.33 2.950.13 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.5.32",
32
+ sdkVersion: "1.5.33",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.32 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.33 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,14 +1,12 @@
1
1
  import * as z from "zod/v4";
2
- import { PrivateProviderDataPolicy, PrivateProviderDataPolicy$Outbound } from "./privateproviderdatapolicy.js";
2
+ /**
3
+ * A private provider serves only your organization, so its endpoints are recorded as retaining no prompts, training on none and publishing none, and pass every data-policy filter your account or guardrails apply.
4
+ */
3
5
  export type CreatePrivateProviderRequest = {
4
6
  /**
5
7
  * HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.
6
8
  */
7
9
  baseUrl?: string | undefined;
8
- /**
9
- * Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.
10
- */
11
- dataPolicy?: PrivateProviderDataPolicy | undefined;
12
10
  /**
13
11
  * Defaults to `name`.
14
12
  */
@@ -25,7 +23,6 @@ export type CreatePrivateProviderRequest = {
25
23
  /** @internal */
26
24
  export type CreatePrivateProviderRequest$Outbound = {
27
25
  base_url?: string | undefined;
28
- data_policy?: PrivateProviderDataPolicy$Outbound | undefined;
29
26
  display_name?: string | undefined;
30
27
  name: string;
31
28
  slug?: string | undefined;
@@ -4,18 +4,15 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
- import { PrivateProviderDataPolicy$outboundSchema, } from "./privateproviderdatapolicy.js";
8
7
  /** @internal */
9
8
  export const CreatePrivateProviderRequest$outboundSchema = z.object({
10
9
  baseUrl: z.string().optional(),
11
- dataPolicy: PrivateProviderDataPolicy$outboundSchema.optional(),
12
10
  displayName: z.string().optional(),
13
11
  name: z.string(),
14
12
  slug: z.string().optional(),
15
13
  }).transform((v) => {
16
14
  return remap$(v, {
17
15
  baseUrl: "base_url",
18
- dataPolicy: "data_policy",
19
16
  displayName: "display_name",
20
17
  });
21
18
  });
@@ -665,7 +665,6 @@ export * from "./privateendpointvalidation.js";
665
665
  export * from "./privateendpointvalidationnullable.js";
666
666
  export * from "./privateendpointvalidationresponse.js";
667
667
  export * from "./privateprovider.js";
668
- export * from "./privateproviderdatapolicy.js";
669
668
  export * from "./promptcachebreakpoint.js";
670
669
  export * from "./promptcacheoptions.js";
671
670
  export * from "./promptinjectionscanscope.js";
@@ -669,7 +669,6 @@ export * from "./privateendpointvalidation.js";
669
669
  export * from "./privateendpointvalidationnullable.js";
670
670
  export * from "./privateendpointvalidationresponse.js";
671
671
  export * from "./privateprovider.js";
672
- export * from "./privateproviderdatapolicy.js";
673
672
  export * from "./promptcachebreakpoint.js";
674
673
  export * from "./promptcacheoptions.js";
675
674
  export * from "./promptinjectionscanscope.js";
@@ -1,33 +1,12 @@
1
1
  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
- /**
5
- * Your declared data policy, or `null` when none was declared.
6
- */
7
- export type PrivateProviderDataPolicy1 = {
8
- /**
9
- * Days prompts are retained. Must be `null` unless `retains_prompts` is true.
10
- */
11
- promptRetentionDays: number | null;
12
- /**
13
- * Whether the provider retains prompts or completions.
14
- */
15
- retainsPrompts: boolean;
16
- /**
17
- * Whether the provider trains on prompts.
18
- */
19
- training: boolean;
20
- };
21
4
  export type PrivateProvider = {
22
5
  /**
23
6
  * HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.
24
7
  */
25
8
  baseUrl: string | null;
26
9
  createdAt: string;
27
- /**
28
- * Your declared data policy, or `null` when none was declared.
29
- */
30
- dataPolicy: PrivateProviderDataPolicy1 | null;
31
10
  /**
32
11
  * Human-readable provider name shown in the UI.
33
12
  */
@@ -42,9 +21,6 @@ export type PrivateProvider = {
42
21
  slug: string;
43
22
  };
44
23
  /** @internal */
45
- export declare const PrivateProviderDataPolicy1$inboundSchema: z.ZodType<PrivateProviderDataPolicy1, unknown>;
46
- export declare function privateProviderDataPolicy1FromJSON(jsonString: string): SafeParseResult<PrivateProviderDataPolicy1, SDKValidationError>;
47
- /** @internal */
48
24
  export declare const PrivateProvider$inboundSchema: z.ZodType<PrivateProvider, unknown>;
49
25
  export declare function privateProviderFromJSON(jsonString: string): SafeParseResult<PrivateProvider, SDKValidationError>;
50
26
  //# sourceMappingURL=privateprovider.d.ts.map
@@ -6,24 +6,9 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  /** @internal */
9
- export const PrivateProviderDataPolicy1$inboundSchema = z.object({
10
- prompt_retention_days: z.nullable(z.int()),
11
- retains_prompts: z.boolean(),
12
- training: z.boolean(),
13
- }).transform((v) => {
14
- return remap$(v, {
15
- "prompt_retention_days": "promptRetentionDays",
16
- "retains_prompts": "retainsPrompts",
17
- });
18
- });
19
- export function privateProviderDataPolicy1FromJSON(jsonString) {
20
- return safeParse(jsonString, (x) => PrivateProviderDataPolicy1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PrivateProviderDataPolicy1' from JSON`);
21
- }
22
- /** @internal */
23
9
  export const PrivateProvider$inboundSchema = z.object({
24
10
  base_url: z.nullable(z.string()),
25
11
  created_at: z.string(),
26
- data_policy: z.nullable(z.lazy(() => PrivateProviderDataPolicy1$inboundSchema)),
27
12
  display_name: z.string(),
28
13
  name: z.string(),
29
14
  slug: z.string(),
@@ -31,7 +16,6 @@ export const PrivateProvider$inboundSchema = z.object({
31
16
  return remap$(v, {
32
17
  "base_url": "baseUrl",
33
18
  "created_at": "createdAt",
34
- "data_policy": "dataPolicy",
35
19
  "display_name": "displayName",
36
20
  });
37
21
  });
@@ -1,39 +1,14 @@
1
1
  import * as z from "zod/v4";
2
- export type UpdatePrivateProviderRequestDataPolicy = {
3
- /**
4
- * Days prompts are retained. Must be `null` unless `retains_prompts` is true.
5
- */
6
- promptRetentionDays?: number | null | undefined;
7
- /**
8
- * Whether the provider retains prompts or completions.
9
- */
10
- retainsPrompts?: boolean | undefined;
11
- /**
12
- * Whether the provider trains on prompts.
13
- */
14
- training?: boolean | undefined;
15
- };
16
2
  export type UpdatePrivateProviderRequest = {
17
3
  /**
18
4
  * HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.
19
5
  */
20
6
  baseUrl?: string | undefined;
21
- dataPolicy?: UpdatePrivateProviderRequestDataPolicy | undefined;
22
7
  displayName?: string | undefined;
23
8
  };
24
9
  /** @internal */
25
- export type UpdatePrivateProviderRequestDataPolicy$Outbound = {
26
- prompt_retention_days?: number | null | undefined;
27
- retains_prompts?: boolean | undefined;
28
- training?: boolean | undefined;
29
- };
30
- /** @internal */
31
- export declare const UpdatePrivateProviderRequestDataPolicy$outboundSchema: z.ZodType<UpdatePrivateProviderRequestDataPolicy$Outbound, UpdatePrivateProviderRequestDataPolicy>;
32
- export declare function updatePrivateProviderRequestDataPolicyToJSON(updatePrivateProviderRequestDataPolicy: UpdatePrivateProviderRequestDataPolicy): string;
33
- /** @internal */
34
10
  export type UpdatePrivateProviderRequest$Outbound = {
35
11
  base_url?: string | undefined;
36
- data_policy?: UpdatePrivateProviderRequestDataPolicy$Outbound | undefined;
37
12
  display_name?: string | undefined;
38
13
  };
39
14
  /** @internal */
@@ -5,28 +5,12 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  /** @internal */
8
- export const UpdatePrivateProviderRequestDataPolicy$outboundSchema = z.object({
9
- promptRetentionDays: z.nullable(z.int()).optional(),
10
- retainsPrompts: z.boolean().optional(),
11
- training: z.boolean().optional(),
12
- }).transform((v) => {
13
- return remap$(v, {
14
- promptRetentionDays: "prompt_retention_days",
15
- retainsPrompts: "retains_prompts",
16
- });
17
- });
18
- export function updatePrivateProviderRequestDataPolicyToJSON(updatePrivateProviderRequestDataPolicy) {
19
- return JSON.stringify(UpdatePrivateProviderRequestDataPolicy$outboundSchema.parse(updatePrivateProviderRequestDataPolicy));
20
- }
21
- /** @internal */
22
8
  export const UpdatePrivateProviderRequest$outboundSchema = z.object({
23
9
  baseUrl: z.string().optional(),
24
- dataPolicy: z.lazy(() => UpdatePrivateProviderRequestDataPolicy$outboundSchema).optional(),
25
10
  displayName: z.string().optional(),
26
11
  }).transform((v) => {
27
12
  return remap$(v, {
28
13
  baseUrl: "base_url",
29
- dataPolicy: "data_policy",
30
14
  displayName: "display_name",
31
15
  });
32
16
  });
@@ -33,7 +33,7 @@ export declare class PrivateProviders extends ClientSDK {
33
33
  * Update a private provider
34
34
  *
35
35
  * @remarks
36
- * Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36
+ * Update a private provider’s display name or base URL. The name and slug cannot change, and the data policy is fixed by OpenRouter, so a body with no editable field is rejected (400). [Management key](/docs/guides/overview/auth/management-api-keys) required.
37
37
  */
38
38
  update(request: operations.UpdatePrivateProviderRequest, options?: RequestOptions): Promise<operations.UpdatePrivateProviderResponse>;
39
39
  }
@@ -50,7 +50,7 @@ export class PrivateProviders extends ClientSDK {
50
50
  * Update a private provider
51
51
  *
52
52
  * @remarks
53
- * Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required.
53
+ * Update a private provider’s display name or base URL. The name and slug cannot change, and the data policy is fixed by OpenRouter, so a body with no editable field is rejected (400). [Management key](/docs/guides/overview/auth/management-api-keys) required.
54
54
  */
55
55
  async update(request, options) {
56
56
  return unwrapAsync(privateProvidersUpdate(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.32",
5
+ "version": "1.5.33",
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.5.32",
3
+ "version": "1.5.33",
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "test:transit": "exit 0",
77
- "test:watch": "vitest --watch --project unit",
76
+ "compile": "tsc && node scripts/unbarrel-imports.js",
78
77
  "postinstall": "node scripts/check-types.js || true",
78
+ "test:watch": "vitest --watch --project unit",
79
79
  "prepare": "npm run build",
80
80
  "test": "vitest --run --project unit",
81
81
  "test:e2e": "vitest --run --project e2e",
82
+ "test:transit": "exit 0",
82
83
  "typecheck": "tsc --noEmit",
83
- "typecheck:transit": "exit 0",
84
- "compile": "tsc && node scripts/unbarrel-imports.js"
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {
87
87
 
@@ -1,28 +0,0 @@
1
- import * as z from "zod/v4";
2
- /**
3
- * Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.
4
- */
5
- export type PrivateProviderDataPolicy = {
6
- /**
7
- * Days prompts are retained. Must be `null` unless `retains_prompts` is true.
8
- */
9
- promptRetentionDays: number | null;
10
- /**
11
- * Whether the provider retains prompts or completions.
12
- */
13
- retainsPrompts: boolean;
14
- /**
15
- * Whether the provider trains on prompts.
16
- */
17
- training: boolean;
18
- };
19
- /** @internal */
20
- export type PrivateProviderDataPolicy$Outbound = {
21
- prompt_retention_days: number | null;
22
- retains_prompts: boolean;
23
- training: boolean;
24
- };
25
- /** @internal */
26
- export declare const PrivateProviderDataPolicy$outboundSchema: z.ZodType<PrivateProviderDataPolicy$Outbound, PrivateProviderDataPolicy>;
27
- export declare function privateProviderDataPolicyToJSON(privateProviderDataPolicy: PrivateProviderDataPolicy): string;
28
- //# sourceMappingURL=privateproviderdatapolicy.d.ts.map
@@ -1,21 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 7a9731f38867
4
- */
5
- import * as z from "zod/v4";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
- /** @internal */
8
- export const PrivateProviderDataPolicy$outboundSchema = z.object({
9
- promptRetentionDays: z.nullable(z.int()),
10
- retainsPrompts: z.boolean(),
11
- training: z.boolean(),
12
- }).transform((v) => {
13
- return remap$(v, {
14
- promptRetentionDays: "prompt_retention_days",
15
- retainsPrompts: "retains_prompts",
16
- });
17
- });
18
- export function privateProviderDataPolicyToJSON(privateProviderDataPolicy) {
19
- return JSON.stringify(PrivateProviderDataPolicy$outboundSchema.parse(privateProviderDataPolicy));
20
- }
21
- //# sourceMappingURL=privateproviderdatapolicy.js.map