@openrouter/sdk 1.5.18 → 1.5.19

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 { PageIterator } from "../types/operations.js";
12
12
  /**
13
13
  * List all models and their properties
14
14
  */
15
- export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.GetModelsResponse, errors.BadRequestResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
15
+ export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.GetModelsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.ConflictResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
16
16
  offset: number;
17
17
  }>>;
18
18
  //# sourceMappingURL=modelsList.d.ts.map
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
10
10
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
12
- import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js";
12
+ import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { ConflictResponseError$inboundSchema as errors_ConflictResponseError$inboundSchema } from "../models/errors/conflictresponseerror.js"; import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { RequestTimeoutResponseError$inboundSchema as errors_RequestTimeoutResponseError$inboundSchema } from "../models/errors/requesttimeoutresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js"; import { TooManyRequestsResponseError$inboundSchema as errors_TooManyRequestsResponseError$inboundSchema } from "../models/errors/toomanyrequestsresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
13
13
  import { GetModelsRequest$outboundSchema as operations_GetModelsRequest$outboundSchema, GetModelsResponse$inboundSchema as operations_GetModelsResponse$inboundSchema } from "../models/operations/getmodels.js";
14
14
  import { APIPromise } from "../types/async.js";
15
15
  import { createPageIterator, haltIterator, } from "../types/operations.js";
@@ -117,7 +117,7 @@ async function $do(client, request, options) {
117
117
  const responseFields = {
118
118
  HttpMeta: { Response: response, Request: req },
119
119
  };
120
- const [result, raw] = await M.match(M.json(200, operations_GetModelsResponse$inboundSchema, { key: "Result" }), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
120
+ const [result, raw] = await M.match(M.json(200, operations_GetModelsResponse$inboundSchema, { key: "Result" }), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(408, errors_RequestTimeoutResponseError$inboundSchema), M.jsonErr(409, errors_ConflictResponseError$inboundSchema), M.jsonErr(429, errors_TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
121
121
  if (!result.ok) {
122
122
  return [haltIterator(result), {
123
123
  status: "complete",
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
15
15
  * @remarks
16
16
  * List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (a comma-separated list of `text`, `image`, `embeddings`, `audio`, `video`, `rerank`, `speech`, `transcription`, or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
17
17
  */
18
- export declare function modelsListForUser(client: OpenRouterCore, security: operations.ListModelsUserSecurity, request?: operations.ListModelsUserRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListModelsUserResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
18
+ export declare function modelsListForUser(client: OpenRouterCore, security: operations.ListModelsUserSecurity, request?: operations.ListModelsUserRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListModelsUserResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.ConflictResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
20
20
  }>>;
21
21
  //# sourceMappingURL=modelsListForUser.d.ts.map
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
10
10
  import { resolveSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
12
- import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
12
+ import { ConflictResponseError$inboundSchema as errors_ConflictResponseError$inboundSchema } from "../models/errors/conflictresponseerror.js"; import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { RequestTimeoutResponseError$inboundSchema as errors_RequestTimeoutResponseError$inboundSchema } from "../models/errors/requesttimeoutresponseerror.js"; import { ServiceUnavailableResponseError$inboundSchema as errors_ServiceUnavailableResponseError$inboundSchema } from "../models/errors/serviceunavailableresponseerror.js"; import { TooManyRequestsResponseError$inboundSchema as errors_TooManyRequestsResponseError$inboundSchema } from "../models/errors/toomanyrequestsresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
13
13
  import { ListModelsUserRequest$outboundSchema as operations_ListModelsUserRequest$outboundSchema, ListModelsUserResponse$inboundSchema as operations_ListModelsUserResponse$inboundSchema } from "../models/operations/listmodelsuser.js";
14
14
  import { APIPromise } from "../types/async.js";
15
15
  import { createPageIterator, haltIterator, } from "../types/operations.js";
@@ -101,7 +101,7 @@ async function $do(client, security, request, options) {
101
101
  };
102
102
  const [result, raw] = await M.match(M.json(200, operations_ListModelsUserResponse$inboundSchema, {
103
103
  key: "Result",
104
- }), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
104
+ }), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(408, errors_RequestTimeoutResponseError$inboundSchema), M.jsonErr(409, errors_ConflictResponseError$inboundSchema), M.jsonErr(429, errors_TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(503, errors_ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
105
105
  if (!result.ok) {
106
106
  return [haltIterator(result), {
107
107
  status: "complete",
@@ -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.18";
53
+ readonly sdkVersion: "1.5.19";
54
54
  readonly genVersion: "2.948.4";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.18 2.948.4 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.19 2.948.4 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.18",
32
+ sdkVersion: "1.5.19",
33
33
  genVersion: "2.948.4",
34
- userAgent: "speakeasy-sdk/typescript 1.5.18 2.948.4 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.19 2.948.4 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -48,6 +48,10 @@ export type CreateGuardrailRequest = {
48
48
  * Whether this guardrail allows paid endpoints that train on request data.
49
49
  */
50
50
  enablePaidModelTraining?: boolean | null | undefined;
51
+ /**
52
+ * Whether coding harnesses list only their vendor's own models: Codex lists OpenAI models and Claude Code and Claude Desktop list Anthropic models. Affects only the model list those harnesses request from GET /models; a model the client names directly is still routed. Any true across the workspace default, member, and API key guardrails applies.
53
+ */
54
+ enforceFirstPartyHarnessModels?: boolean | null | undefined;
51
55
  /**
52
56
  * Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
53
57
  *
@@ -116,6 +120,7 @@ export type CreateGuardrailRequest$Outbound = {
116
120
  enable_free_model_publication?: boolean | null | undefined;
117
121
  enable_free_model_training?: boolean | null | undefined;
118
122
  enable_paid_model_training?: boolean | null | undefined;
123
+ enforce_first_party_harness_models?: boolean | null | undefined;
119
124
  enforce_zdr?: boolean | null | undefined;
120
125
  enforce_zdr_anthropic?: boolean | null | undefined;
121
126
  enforce_zdr_google?: boolean | null | undefined;
@@ -23,6 +23,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
23
23
  enableFreeModelPublication: z.nullable(z.boolean()).optional(),
24
24
  enableFreeModelTraining: z.nullable(z.boolean()).optional(),
25
25
  enablePaidModelTraining: z.nullable(z.boolean()).optional(),
26
+ enforceFirstPartyHarnessModels: z.nullable(z.boolean()).optional(),
26
27
  enforceZdr: z.nullable(z.boolean()).optional(),
27
28
  enforceZdrAnthropic: z.nullable(z.boolean()).optional(),
28
29
  enforceZdrGoogle: z.nullable(z.boolean()).optional(),
@@ -48,6 +49,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
48
49
  enableFreeModelPublication: "enable_free_model_publication",
49
50
  enableFreeModelTraining: "enable_free_model_training",
50
51
  enablePaidModelTraining: "enable_paid_model_training",
52
+ enforceFirstPartyHarnessModels: "enforce_first_party_harness_models",
51
53
  enforceZdr: "enforce_zdr",
52
54
  enforceZdrAnthropic: "enforce_zdr_anthropic",
53
55
  enforceZdrGoogle: "enforce_zdr_google",
@@ -54,6 +54,10 @@ export type Guardrail = {
54
54
  * Whether this guardrail allows paid endpoints that train on request data.
55
55
  */
56
56
  enablePaidModelTraining?: boolean | null | undefined;
57
+ /**
58
+ * Whether coding harnesses list only their vendor's own models: Codex lists OpenAI models and Claude Code and Claude Desktop list Anthropic models. Affects only the model list those harnesses request from GET /models; a model the client names directly is still routed. Any true across the workspace default, member, and API key guardrails applies.
59
+ */
60
+ enforceFirstPartyHarnessModels?: boolean | null | undefined;
57
61
  /**
58
62
  * Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
59
63
  *
@@ -25,6 +25,7 @@ export const Guardrail$inboundSchema = z.object({
25
25
  enable_free_model_publication: z.nullable(z.boolean()).optional(),
26
26
  enable_free_model_training: z.nullable(z.boolean()).optional(),
27
27
  enable_paid_model_training: z.nullable(z.boolean()).optional(),
28
+ enforce_first_party_harness_models: z.nullable(z.boolean()).optional(),
28
29
  enforce_zdr: z.nullable(z.boolean()).optional(),
29
30
  enforce_zdr_anthropic: z.nullable(z.boolean()).optional(),
30
31
  enforce_zdr_google: z.nullable(z.boolean()).optional(),
@@ -53,6 +54,7 @@ export const Guardrail$inboundSchema = z.object({
53
54
  "enable_free_model_publication": "enableFreeModelPublication",
54
55
  "enable_free_model_training": "enableFreeModelTraining",
55
56
  "enable_paid_model_training": "enablePaidModelTraining",
57
+ "enforce_first_party_harness_models": "enforceFirstPartyHarnessModels",
56
58
  "enforce_zdr": "enforceZdr",
57
59
  "enforce_zdr_anthropic": "enforceZdrAnthropic",
58
60
  "enforce_zdr_google": "enforceZdrGoogle",
@@ -7,7 +7,7 @@ export type OrganizationSettings = {
7
7
  */
8
8
  id: string;
9
9
  /**
10
- * When true, `GET /api/v1/models` called with one of the organization's API keys returns only the models that key can use (the `/api/v1/models/user` catalog), and the signed-in dashboard shows the same list. Anonymous requests always receive the public catalog.
10
+ * When true, the signed-in dashboard lists only the models the organization can use. `GET /api/v1/models` called with an API key always returns only the models that key can use, whatever this setting says; anonymous requests receive the public catalog.
11
11
  */
12
12
  isFilteredModelCatalogEnabled: boolean;
13
13
  };
@@ -48,6 +48,10 @@ export type UpdateGuardrailRequest = {
48
48
  * Whether this guardrail allows paid endpoints that train on request data.
49
49
  */
50
50
  enablePaidModelTraining?: boolean | null | undefined;
51
+ /**
52
+ * Whether coding harnesses list only their vendor's own models: Codex lists OpenAI models and Claude Code and Claude Desktop list Anthropic models. Affects only the model list those harnesses request from GET /models; a model the client names directly is still routed. Any true across the workspace default, member, and API key guardrails applies.
53
+ */
54
+ enforceFirstPartyHarnessModels?: boolean | null | undefined;
51
55
  /**
52
56
  * Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
53
57
  *
@@ -112,6 +116,7 @@ export type UpdateGuardrailRequest$Outbound = {
112
116
  enable_free_model_publication?: boolean | null | undefined;
113
117
  enable_free_model_training?: boolean | null | undefined;
114
118
  enable_paid_model_training?: boolean | null | undefined;
119
+ enforce_first_party_harness_models?: boolean | null | undefined;
115
120
  enforce_zdr?: boolean | null | undefined;
116
121
  enforce_zdr_anthropic?: boolean | null | undefined;
117
122
  enforce_zdr_google?: boolean | null | undefined;
@@ -23,6 +23,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
23
23
  enableFreeModelPublication: z.nullable(z.boolean()).optional(),
24
24
  enableFreeModelTraining: z.nullable(z.boolean()).optional(),
25
25
  enablePaidModelTraining: z.nullable(z.boolean()).optional(),
26
+ enforceFirstPartyHarnessModels: z.nullable(z.boolean()).optional(),
26
27
  enforceZdr: z.nullable(z.boolean()).optional(),
27
28
  enforceZdrAnthropic: z.nullable(z.boolean()).optional(),
28
29
  enforceZdrGoogle: z.nullable(z.boolean()).optional(),
@@ -47,6 +48,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
47
48
  enableFreeModelPublication: "enable_free_model_publication",
48
49
  enableFreeModelTraining: "enable_free_model_training",
49
50
  enablePaidModelTraining: "enable_paid_model_training",
51
+ enforceFirstPartyHarnessModels: "enforce_first_party_harness_models",
50
52
  enforceZdr: "enforce_zdr",
51
53
  enforceZdrAnthropic: "enforce_zdr_anthropic",
52
54
  enforceZdrGoogle: "enforce_zdr_google",
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  export type UpdateOrganizationSettingsRequest = {
3
3
  /**
4
- * When true, `GET /api/v1/models` called with one of the organization's API keys returns only the models that key can use (the `/api/v1/models/user` catalog), and the signed-in dashboard shows the same list. Anonymous requests always receive the public catalog.
4
+ * When true, the signed-in dashboard lists only the models the organization can use. `GET /api/v1/models` called with an API key always returns only the models that key can use, whatever this setting says; anonymous requests receive the public catalog.
5
5
  */
6
6
  isFilteredModelCatalogEnabled: boolean;
7
7
  };
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.18",
5
+ "version": "1.5.19",
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.18",
3
+ "version": "1.5.19",
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
- "provenance": true,
25
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
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
- "test:e2e": "vitest --run --project e2e",
76
+ "prepare": "npm run build",
77
+ "test": "vitest --run --project unit",
78
+ "test:transit": "exit 0",
77
79
  "test:watch": "vitest --watch --project unit",
78
80
  "typecheck": "tsc --noEmit",
79
81
  "typecheck:transit": "exit 0",
80
82
  "compile": "tsc && node scripts/unbarrel-imports.js",
81
83
  "postinstall": "node scripts/check-types.js || true",
82
- "prepare": "npm run build",
83
- "test": "vitest --run --project unit",
84
- "test:transit": "exit 0"
84
+ "test:e2e": "vitest --run --project e2e"
85
85
  },
86
86
  "peerDependencies": {
87
87