@openrouter/sdk 1.2.82 → 1.2.84

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 { PageIterator } from "../types/operations.js";
13
13
  * List models filtered by user provider preferences, privacy settings, and guardrails
14
14
  *
15
15
  * @remarks
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). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
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` (e.g. `image,audio,embeddings` 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
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 | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
@@ -17,7 +17,7 @@ import { createPageIterator, haltIterator, } from "../types/operations.js";
17
17
  * List models filtered by user provider preferences, privacy settings, and guardrails
18
18
  *
19
19
  * @remarks
20
- * 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). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
20
+ * 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` (e.g. `image,audio,embeddings` 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.
21
21
  */
22
22
  export function modelsListForUser(client, security, request, options) {
23
23
  return new APIPromise($do(client, security, request, options));
@@ -33,6 +33,7 @@ async function $do(client, security, request, options) {
33
33
  const query = encodeFormQuery({
34
34
  "limit": payload?.limit,
35
35
  "offset": payload?.offset,
36
+ "output_modalities": payload?.output_modalities,
36
37
  });
37
38
  const headers = new Headers(compactMap({
38
39
  Accept: "application/json",
@@ -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.82";
53
+ readonly sdkVersion: "1.2.84";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.82 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.84 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.82",
32
+ sdkVersion: "1.2.84",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.82 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.84 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -60,7 +60,7 @@ export type CreateAuthKeysCodeRequestBody = {
60
60
  */
61
61
  codeChallengeMethod?: CreateAuthKeysCodeCodeChallengeMethod | undefined;
62
62
  /**
63
- * Optional expiration time for the API key to be created
63
+ * Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
64
64
  */
65
65
  expiresAt?: Date | null | undefined;
66
66
  /**
@@ -41,7 +41,7 @@ export type CreateKeysRequestBody = {
41
41
  */
42
42
  creatorUserId?: string | null | undefined;
43
43
  /**
44
- * Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected
44
+ * Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
45
45
  */
46
46
  expiresAt?: Date | null | undefined;
47
47
  /**
@@ -54,6 +54,10 @@ export type ListModelsUserRequest = {
54
54
  * Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned
55
55
  */
56
56
  limit?: number | undefined;
57
+ /**
58
+ * Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
59
+ */
60
+ outputModalities?: string | undefined;
57
61
  };
58
62
  export type ListModelsUserResponse = {
59
63
  result: models.ModelsListResponse;
@@ -72,6 +76,7 @@ export type ListModelsUserRequest$Outbound = {
72
76
  appCategories?: string | undefined;
73
77
  offset: number | null;
74
78
  limit: number;
79
+ output_modalities?: string | undefined;
75
80
  };
76
81
  /** @internal */
77
82
  export declare const ListModelsUserRequest$outboundSchema: z.ZodType<ListModelsUserRequest$Outbound, ListModelsUserRequest>;
@@ -20,9 +20,11 @@ export const ListModelsUserRequest$outboundSchema = z.object({
20
20
  appCategories: z.string().optional(),
21
21
  offset: z.nullable(z.int().default(0)),
22
22
  limit: z.int().default(500),
23
+ outputModalities: z.string().optional(),
23
24
  }).transform((v) => {
24
25
  return remap$(v, {
25
26
  httpReferer: "HTTP-Referer",
27
+ outputModalities: "output_modalities",
26
28
  });
27
29
  });
28
30
  export function listModelsUserRequestToJSON(listModelsUserRequest) {
@@ -102,7 +102,13 @@ export type OrderBy = {
102
102
  field: string;
103
103
  };
104
104
  export type TimeRange = {
105
+ /**
106
+ * ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
107
+ */
105
108
  end: Date;
109
+ /**
110
+ * ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
111
+ */
106
112
  start: Date;
107
113
  };
108
114
  export type QueryAnalyticsRequestBody = {
@@ -24,7 +24,7 @@ export declare class Models extends ClientSDK {
24
24
  * List models filtered by user provider preferences, privacy settings, and guardrails
25
25
  *
26
26
  * @remarks
27
- * 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). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
27
+ * 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` (e.g. `image,audio,embeddings` 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.
28
28
  */
29
29
  listForUser(security: operations.ListModelsUserSecurity, request?: operations.ListModelsUserRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListModelsUserResponse, {
30
30
  offset: number;
package/esm/sdk/models.js CHANGED
@@ -35,7 +35,7 @@ export class Models extends ClientSDK {
35
35
  * List models filtered by user provider preferences, privacy settings, and guardrails
36
36
  *
37
37
  * @remarks
38
- * 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). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
38
+ * 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` (e.g. `image,audio,embeddings` 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.
39
39
  */
40
40
  async listForUser(security, request, options) {
41
41
  return unwrapResultIterator(modelsListForUser(this, security, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.82",
5
+ "version": "1.2.84",
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.82",
3
+ "version": "1.2.84",
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
+ "typecheck:transit": "exit 0",
76
77
  "postinstall": "node scripts/check-types.js || true",
78
+ "test:e2e": "vitest --run --project e2e",
77
79
  "typecheck": "tsc --noEmit",
78
- "typecheck:transit": "exit 0",
80
+ "compile": "tsc",
79
81
  "prepare": "npm run build",
80
82
  "test": "vitest --run --project unit",
81
- "test:e2e": "vitest --run --project e2e",
82
83
  "test:transit": "exit 0",
83
- "test:watch": "vitest --watch --project unit",
84
- "compile": "tsc"
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {