@openrouter/sdk 1.2.50 → 1.2.52

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.
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Create a BYOK provider credential
14
14
  *
15
15
  * @remarks
16
- * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function byokCreate(client: OpenRouterCore, request: operations.CreateBYOKKeyRequest, options?: RequestOptions): APIPromise<Result<models.CreateBYOKKeyResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=byokCreate.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Create a BYOK provider credential
18
18
  *
19
19
  * @remarks
20
- * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function byokCreate(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Update a BYOK provider credential
14
14
  *
15
15
  * @remarks
16
- * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function byokUpdate(client: OpenRouterCore, request: operations.UpdateBYOKKeyRequest, options?: RequestOptions): APIPromise<Result<models.UpdateBYOKKeyResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=byokUpdate.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Update a BYOK provider credential
18
18
  *
19
19
  * @remarks
20
- * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function byokUpdate(client, request, options) {
23
23
  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.50";
53
+ readonly sdkVersion: "1.2.52";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.50 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.52 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.50",
32
+ sdkVersion: "1.2.52",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.50 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.52 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -55,6 +55,7 @@ export declare const BYOKProviderSlug: {
55
55
  readonly Ionstream: "ionstream";
56
56
  readonly Krea: "krea";
57
57
  readonly Liquid: "liquid";
58
+ readonly Makora: "makora";
58
59
  readonly Mancer: "mancer";
59
60
  readonly Mara: "mara";
60
61
  readonly Meta: "meta";
@@ -58,6 +58,7 @@ export const BYOKProviderSlug = {
58
58
  Ionstream: "ionstream",
59
59
  Krea: "krea",
60
60
  Liquid: "liquid",
61
+ Makora: "makora",
61
62
  Mancer: "mancer",
62
63
  Mara: "mara",
63
64
  Meta: "meta",
@@ -1,6 +1,10 @@
1
1
  import * as z from "zod/v4";
2
2
  import { BYOKProviderSlug } from "./byokproviderslug.js";
3
3
  export type CreateBYOKKeyRequest = {
4
+ /**
5
+ * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400.
6
+ */
7
+ allowedApiKeyHashes?: Array<string> | null | undefined;
4
8
  /**
5
9
  * Optional allowlist of model slugs this credential may be used for. `null` means no restriction.
6
10
  */
@@ -36,6 +40,7 @@ export type CreateBYOKKeyRequest = {
36
40
  };
37
41
  /** @internal */
38
42
  export type CreateBYOKKeyRequest$Outbound = {
43
+ allowed_api_key_hashes?: Array<string> | null | undefined;
39
44
  allowed_models?: Array<string> | null | undefined;
40
45
  allowed_user_ids?: Array<string> | null | undefined;
41
46
  disabled?: boolean | undefined;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { BYOKProviderSlug$outboundSchema, } from "./byokproviderslug.js";
8
8
  /** @internal */
9
9
  export const CreateBYOKKeyRequest$outboundSchema = z.object({
10
+ allowedApiKeyHashes: z.nullable(z.array(z.string())).optional(),
10
11
  allowedModels: z.nullable(z.array(z.string())).optional(),
11
12
  allowedUserIds: z.nullable(z.array(z.string())).optional(),
12
13
  disabled: z.boolean().optional(),
@@ -17,6 +18,7 @@ export const CreateBYOKKeyRequest$outboundSchema = z.object({
17
18
  workspaceId: z.string().optional(),
18
19
  }).transform((v) => {
19
20
  return remap$(v, {
21
+ allowedApiKeyHashes: "allowed_api_key_hashes",
20
22
  allowedModels: "allowed_models",
21
23
  allowedUserIds: "allowed_user_ids",
22
24
  isFallback: "is_fallback",
@@ -224,6 +224,9 @@ export type ImageGenerationProviderPreferencesOptions = {
224
224
  lynnPrivate?: {
225
225
  [k: string]: any;
226
226
  } | undefined;
227
+ makora?: {
228
+ [k: string]: any;
229
+ } | undefined;
227
230
  mancer?: {
228
231
  [k: string]: any;
229
232
  } | undefined;
@@ -677,6 +680,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
677
680
  "lynn-private"?: {
678
681
  [k: string]: any;
679
682
  } | undefined;
683
+ makora?: {
684
+ [k: string]: any;
685
+ } | undefined;
680
686
  mancer?: {
681
687
  [k: string]: any;
682
688
  } | undefined;
@@ -91,6 +91,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
91
91
  liquid: z.record(z.string(), z.any()).optional(),
92
92
  lynn: z.record(z.string(), z.any()).optional(),
93
93
  lynnPrivate: z.record(z.string(), z.any()).optional(),
94
+ makora: z.record(z.string(), z.any()).optional(),
94
95
  mancer: z.record(z.string(), z.any()).optional(),
95
96
  mancerOld: z.record(z.string(), z.any()).optional(),
96
97
  mara: z.record(z.string(), z.any()).optional(),
@@ -79,6 +79,7 @@ export declare const Provider: {
79
79
  readonly Ionstream: "ionstream";
80
80
  readonly Krea: "krea";
81
81
  readonly Liquid: "liquid";
82
+ readonly Makora: "makora";
82
83
  readonly Mancer: "mancer";
83
84
  readonly Mara: "mara";
84
85
  readonly Meta: "meta";
@@ -62,6 +62,7 @@ export const Provider = {
62
62
  Ionstream: "ionstream",
63
63
  Krea: "krea",
64
64
  Liquid: "liquid",
65
+ Makora: "makora",
65
66
  Mancer: "mancer",
66
67
  Mara: "mara",
67
68
  Meta: "meta",
@@ -54,6 +54,7 @@ export declare const ProviderName: {
54
54
  readonly InferactVLLM: "Inferact vLLM";
55
55
  readonly Inflection: "Inflection";
56
56
  readonly Liquid: "Liquid";
57
+ readonly Makora: "Makora";
57
58
  readonly Mara: "Mara";
58
59
  readonly Mancer2: "Mancer 2";
59
60
  readonly Meta: "Meta";
@@ -57,6 +57,7 @@ export const ProviderName = {
57
57
  InferactVLLM: "Inferact vLLM",
58
58
  Inflection: "Inflection",
59
59
  Liquid: "Liquid",
60
+ Makora: "Makora",
60
61
  Mara: "Mara",
61
62
  Mancer2: "Mancer 2",
62
63
  Meta: "Meta",
@@ -219,6 +219,9 @@ export type ProviderOptions = {
219
219
  lynnPrivate?: {
220
220
  [k: string]: any;
221
221
  } | undefined;
222
+ makora?: {
223
+ [k: string]: any;
224
+ } | undefined;
222
225
  mancer?: {
223
226
  [k: string]: any;
224
227
  } | undefined;
@@ -627,6 +630,9 @@ export type ProviderOptions$Outbound = {
627
630
  "lynn-private"?: {
628
631
  [k: string]: any;
629
632
  } | undefined;
633
+ makora?: {
634
+ [k: string]: any;
635
+ } | undefined;
630
636
  mancer?: {
631
637
  [k: string]: any;
632
638
  } | undefined;
@@ -78,6 +78,7 @@ export const ProviderOptions$outboundSchema = z.object({
78
78
  liquid: z.record(z.string(), z.any()).optional(),
79
79
  lynn: z.record(z.string(), z.any()).optional(),
80
80
  lynnPrivate: z.record(z.string(), z.any()).optional(),
81
+ makora: z.record(z.string(), z.any()).optional(),
81
82
  mancer: z.record(z.string(), z.any()).optional(),
82
83
  mancerOld: z.record(z.string(), z.any()).optional(),
83
84
  mara: z.record(z.string(), z.any()).optional(),
@@ -86,6 +86,7 @@ export declare const ProviderResponseProviderName: {
86
86
  readonly InferactVLLM: "Inferact vLLM";
87
87
  readonly Inflection: "Inflection";
88
88
  readonly Liquid: "Liquid";
89
+ readonly Makora: "Makora";
89
90
  readonly Mara: "Mara";
90
91
  readonly Mancer2: "Mancer 2";
91
92
  readonly Meta: "Meta";
@@ -90,6 +90,7 @@ export const ProviderResponseProviderName = {
90
90
  InferactVLLM: "Inferact vLLM",
91
91
  Inflection: "Inflection",
92
92
  Liquid: "Liquid",
93
+ Makora: "Makora",
93
94
  Mara: "Mara",
94
95
  Mancer2: "Mancer 2",
95
96
  Meta: "Meta",
@@ -1,5 +1,9 @@
1
1
  import * as z from "zod/v4";
2
2
  export type UpdateBYOKKeyRequest = {
3
+ /**
4
+ * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400.
5
+ */
6
+ allowedApiKeyHashes?: Array<string> | null | undefined;
3
7
  /**
4
8
  * Optional allowlist of model slugs this credential may be used for. `null` means no restriction.
5
9
  */
@@ -27,6 +31,7 @@ export type UpdateBYOKKeyRequest = {
27
31
  };
28
32
  /** @internal */
29
33
  export type UpdateBYOKKeyRequest$Outbound = {
34
+ allowed_api_key_hashes?: Array<string> | null | undefined;
30
35
  allowed_models?: Array<string> | null | undefined;
31
36
  allowed_user_ids?: Array<string> | null | undefined;
32
37
  disabled?: boolean | undefined;
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  /** @internal */
8
8
  export const UpdateBYOKKeyRequest$outboundSchema = z.object({
9
+ allowedApiKeyHashes: z.nullable(z.array(z.string())).optional(),
9
10
  allowedModels: z.nullable(z.array(z.string())).optional(),
10
11
  allowedUserIds: z.nullable(z.array(z.string())).optional(),
11
12
  disabled: z.boolean().optional(),
@@ -14,6 +15,7 @@ export const UpdateBYOKKeyRequest$outboundSchema = z.object({
14
15
  name: z.nullable(z.string()).optional(),
15
16
  }).transform((v) => {
16
17
  return remap$(v, {
18
+ allowedApiKeyHashes: "allowed_api_key_hashes",
17
19
  allowedModels: "allowed_models",
18
20
  allowedUserIds: "allowed_user_ids",
19
21
  isFallback: "is_fallback",
@@ -240,6 +240,9 @@ export type VideoGenerationRequestOptions = {
240
240
  lynnPrivate?: {
241
241
  [k: string]: any;
242
242
  } | undefined;
243
+ makora?: {
244
+ [k: string]: any;
245
+ } | undefined;
243
246
  mancer?: {
244
247
  [k: string]: any;
245
248
  } | undefined;
@@ -727,6 +730,9 @@ export type VideoGenerationRequestOptions$Outbound = {
727
730
  "lynn-private"?: {
728
731
  [k: string]: any;
729
732
  } | undefined;
733
+ makora?: {
734
+ [k: string]: any;
735
+ } | undefined;
730
736
  mancer?: {
731
737
  [k: string]: any;
732
738
  } | undefined;
@@ -109,6 +109,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
109
109
  liquid: z.record(z.string(), z.any()).optional(),
110
110
  lynn: z.record(z.string(), z.any()).optional(),
111
111
  lynnPrivate: z.record(z.string(), z.any()).optional(),
112
+ makora: z.record(z.string(), z.any()).optional(),
112
113
  mancer: z.record(z.string(), z.any()).optional(),
113
114
  mancerOld: z.record(z.string(), z.any()).optional(),
114
115
  mara: z.record(z.string(), z.any()).optional(),
package/esm/sdk/byok.d.ts CHANGED
@@ -16,7 +16,7 @@ export declare class BYOK extends ClientSDK {
16
16
  * Create a BYOK provider credential
17
17
  *
18
18
  * @remarks
19
- * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  create(request: operations.CreateBYOKKeyRequest, options?: RequestOptions): Promise<models.CreateBYOKKeyResponse>;
22
22
  /**
@@ -37,7 +37,7 @@ export declare class BYOK extends ClientSDK {
37
37
  * Update a BYOK provider credential
38
38
  *
39
39
  * @remarks
40
- * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required.
40
+ * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.
41
41
  */
42
42
  update(request: operations.UpdateBYOKKeyRequest, options?: RequestOptions): Promise<models.UpdateBYOKKeyResponse>;
43
43
  }
package/esm/sdk/byok.js CHANGED
@@ -24,7 +24,7 @@ export class BYOK extends ClientSDK {
24
24
  * Create a BYOK provider credential
25
25
  *
26
26
  * @remarks
27
- * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
27
+ * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.
28
28
  */
29
29
  async create(request, options) {
30
30
  return unwrapAsync(byokCreate(this, request, options));
@@ -51,7 +51,7 @@ export class BYOK extends ClientSDK {
51
51
  * Update a BYOK provider credential
52
52
  *
53
53
  * @remarks
54
- * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required.
54
+ * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.
55
55
  */
56
56
  async update(request, options) {
57
57
  return unwrapAsync(byokUpdate(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.50",
5
+ "version": "1.2.52",
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.50",
3
+ "version": "1.2.52",
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",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc",
77
76
  "prepare": "npm run build",
78
- "test": "vitest --run --project unit",
79
77
  "test:e2e": "vitest --run --project e2e",
80
78
  "test:watch": "vitest --watch --project unit",
79
+ "typecheck": "tsc --noEmit",
80
+ "typecheck:transit": "exit 0",
81
81
  "postinstall": "node scripts/check-types.js || true",
82
+ "test": "vitest --run --project unit",
82
83
  "test:transit": "exit 0",
83
- "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
84
+ "compile": "tsc"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {