@openrouter/sdk 1.0.2 → 1.0.3

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.
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
14
14
  * @remarks
15
15
  * List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
- export declare function apiKeysList(client: OpenRouterCore, request?: operations.ListRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListResponse, errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
17
+ export declare function apiKeysList(client: OpenRouterCore, request?: operations.ListRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=apiKeysList.d.ts.map
@@ -93,7 +93,7 @@ async function $do(client, request, options) {
93
93
  const responseFields = {
94
94
  HttpMeta: { Response: response, Request: req },
95
95
  };
96
- const [result] = await M.match(M.json(200, operations.ListResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
96
+ const [result] = await M.match(M.json(200, operations.ListResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
97
97
  if (!result.ok) {
98
98
  return [result, { status: "complete", request: req, response }];
99
99
  }
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
15
15
  * @remarks
16
16
  * List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
- export declare function byokList(client: OpenRouterCore, request?: operations.ListBYOKKeysRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListBYOKKeysResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
18
+ export declare function byokList(client: OpenRouterCore, request?: operations.ListBYOKKeysRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListBYOKKeysResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
20
20
  }>>;
21
21
  //# sourceMappingURL=byokList.d.ts.map
@@ -97,7 +97,7 @@ async function $do(client, request, options) {
97
97
  };
98
98
  const [result, raw] = await M.match(M.json(200, operations.ListBYOKKeysResponse$inboundSchema, {
99
99
  key: "Result",
100
- }), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
100
+ }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
101
101
  if (!result.ok) {
102
102
  return [haltIterator(result), {
103
103
  status: "complete",
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
15
15
  * @remarks
16
16
  * List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
- export declare function guardrailsList(client: OpenRouterCore, request?: operations.ListGuardrailsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListGuardrailsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
18
+ export declare function guardrailsList(client: OpenRouterCore, request?: operations.ListGuardrailsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListGuardrailsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
20
20
  }>>;
21
21
  //# sourceMappingURL=guardrailsList.d.ts.map
@@ -96,7 +96,7 @@ async function $do(client, request, options) {
96
96
  };
97
97
  const [result, raw] = await M.match(M.json(200, operations.ListGuardrailsResponse$inboundSchema, {
98
98
  key: "Result",
99
- }), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
99
+ }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
100
100
  if (!result.ok) {
101
101
  return [haltIterator(result), {
102
102
  status: "complete",
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
15
15
  * @remarks
16
16
  * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
- export declare function observabilityList(client: OpenRouterCore, request?: operations.ListObservabilityDestinationsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListObservabilityDestinationsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
18
+ export declare function observabilityList(client: OpenRouterCore, request?: operations.ListObservabilityDestinationsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListObservabilityDestinationsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
20
20
  }>>;
21
21
  //# sourceMappingURL=observabilityList.d.ts.map
@@ -95,7 +95,7 @@ async function $do(client, request, options) {
95
95
  const responseFields = {
96
96
  HttpMeta: { Response: response, Request: req },
97
97
  };
98
- const [result, raw] = await M.match(M.json(200, operations.ListObservabilityDestinationsResponse$inboundSchema, { key: "Result" }), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
98
+ const [result, raw] = await M.match(M.json(200, operations.ListObservabilityDestinationsResponse$inboundSchema, { key: "Result" }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
99
99
  if (!result.ok) {
100
100
  return [haltIterator(result), {
101
101
  status: "complete",
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
49
49
  export declare const SDK_METADATA: {
50
50
  readonly language: "typescript";
51
51
  readonly openapiDocVersion: "1.0.0";
52
- readonly sdkVersion: "1.0.2";
52
+ readonly sdkVersion: "1.0.3";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.0.2 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.0.3 2.914.0 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "1.0.2",
29
+ sdkVersion: "1.0.3",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.0.2 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.0.3 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.0.2",
5
+ "version": "1.0.3",
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.0.2",
3
+ "version": "1.0.3",
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,14 +73,14 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "postinstall": "node scripts/check-types.js || true",
76
+ "compile": "tsc",
77
+ "test": "vitest --run --project unit",
77
78
  "test:e2e": "vitest --run --project e2e",
78
79
  "test:transit": "exit 0",
79
80
  "test:watch": "vitest --watch --project unit",
80
- "compile": "tsc",
81
- "prepare": "npm run build",
82
- "test": "vitest --run --project unit",
83
81
  "typecheck": "tsc --noEmit",
82
+ "postinstall": "node scripts/check-types.js || true",
83
+ "prepare": "npm run build",
84
84
  "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},