@openrouter/sdk 1.2.81 → 1.2.83

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.81";
53
+ readonly sdkVersion: "1.2.83";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.81 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.83 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.81",
32
+ sdkVersion: "1.2.83",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.81 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.83 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -27,6 +27,7 @@ export declare const BYOKProviderSlug: {
27
27
  readonly Cloudflare: "cloudflare";
28
28
  readonly Cohere: "cohere";
29
29
  readonly Coreweave: "coreweave";
30
+ readonly Cosine: "cosine";
30
31
  readonly Crusoe: "crusoe";
31
32
  readonly Darkbloom: "darkbloom";
32
33
  readonly Databricks: "databricks";
@@ -30,6 +30,7 @@ export const BYOKProviderSlug = {
30
30
  Cloudflare: "cloudflare",
31
31
  Cohere: "cohere",
32
32
  Coreweave: "coreweave",
33
+ Cosine: "cosine",
33
34
  Crusoe: "crusoe",
34
35
  Darkbloom: "darkbloom",
35
36
  Databricks: "databricks",
@@ -98,6 +98,9 @@ export type ImageGenerationProviderPreferencesOptions = {
98
98
  coreweave?: {
99
99
  [k: string]: any;
100
100
  } | undefined;
101
+ cosine?: {
102
+ [k: string]: any;
103
+ } | undefined;
101
104
  crofai?: {
102
105
  [k: string]: any;
103
106
  } | undefined;
@@ -557,6 +560,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
557
560
  coreweave?: {
558
561
  [k: string]: any;
559
562
  } | undefined;
563
+ cosine?: {
564
+ [k: string]: any;
565
+ } | undefined;
560
566
  crofai?: {
561
567
  [k: string]: any;
562
568
  } | undefined;
@@ -49,6 +49,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
49
49
  cloudflare: z.record(z.string(), z.any()).optional(),
50
50
  cohere: z.record(z.string(), z.any()).optional(),
51
51
  coreweave: z.record(z.string(), z.any()).optional(),
52
+ cosine: z.record(z.string(), z.any()).optional(),
52
53
  crofai: z.record(z.string(), z.any()).optional(),
53
54
  crucible: z.record(z.string(), z.any()).optional(),
54
55
  crusoe: z.record(z.string(), z.any()).optional(),
@@ -51,6 +51,7 @@ export declare const Provider: {
51
51
  readonly Cloudflare: "cloudflare";
52
52
  readonly Cohere: "cohere";
53
53
  readonly Coreweave: "coreweave";
54
+ readonly Cosine: "cosine";
54
55
  readonly Crusoe: "crusoe";
55
56
  readonly Darkbloom: "darkbloom";
56
57
  readonly Databricks: "databricks";
@@ -34,6 +34,7 @@ export const Provider = {
34
34
  Cloudflare: "cloudflare",
35
35
  Cohere: "cohere",
36
36
  Coreweave: "coreweave",
37
+ Cosine: "cosine",
37
38
  Crusoe: "crusoe",
38
39
  Darkbloom: "darkbloom",
39
40
  Databricks: "databricks",
@@ -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) {
@@ -26,6 +26,7 @@ export declare const ProviderName: {
26
26
  readonly Cloudflare: "Cloudflare";
27
27
  readonly Cohere: "Cohere";
28
28
  readonly CoreWeave: "CoreWeave";
29
+ readonly Cosine: "Cosine";
29
30
  readonly Crucible: "Crucible";
30
31
  readonly Crusoe: "Crusoe";
31
32
  readonly Darkbloom: "Darkbloom";
@@ -29,6 +29,7 @@ export const ProviderName = {
29
29
  Cloudflare: "Cloudflare",
30
30
  Cohere: "Cohere",
31
31
  CoreWeave: "CoreWeave",
32
+ Cosine: "Cosine",
32
33
  Crucible: "Crucible",
33
34
  Crusoe: "Crusoe",
34
35
  Darkbloom: "Darkbloom",
@@ -93,6 +93,9 @@ export type ProviderOptions = {
93
93
  coreweave?: {
94
94
  [k: string]: any;
95
95
  } | undefined;
96
+ cosine?: {
97
+ [k: string]: any;
98
+ } | undefined;
96
99
  crofai?: {
97
100
  [k: string]: any;
98
101
  } | undefined;
@@ -507,6 +510,9 @@ export type ProviderOptions$Outbound = {
507
510
  coreweave?: {
508
511
  [k: string]: any;
509
512
  } | undefined;
513
+ cosine?: {
514
+ [k: string]: any;
515
+ } | undefined;
510
516
  crofai?: {
511
517
  [k: string]: any;
512
518
  } | undefined;
@@ -36,6 +36,7 @@ export const ProviderOptions$outboundSchema = z.object({
36
36
  cloudflare: z.record(z.string(), z.any()).optional(),
37
37
  cohere: z.record(z.string(), z.any()).optional(),
38
38
  coreweave: z.record(z.string(), z.any()).optional(),
39
+ cosine: z.record(z.string(), z.any()).optional(),
39
40
  crofai: z.record(z.string(), z.any()).optional(),
40
41
  crucible: z.record(z.string(), z.any()).optional(),
41
42
  crusoe: z.record(z.string(), z.any()).optional(),
@@ -58,6 +58,7 @@ export declare const ProviderResponseProviderName: {
58
58
  readonly Cloudflare: "Cloudflare";
59
59
  readonly Cohere: "Cohere";
60
60
  readonly CoreWeave: "CoreWeave";
61
+ readonly Cosine: "Cosine";
61
62
  readonly Crucible: "Crucible";
62
63
  readonly Crusoe: "Crusoe";
63
64
  readonly Darkbloom: "Darkbloom";
@@ -62,6 +62,7 @@ export const ProviderResponseProviderName = {
62
62
  Cloudflare: "Cloudflare",
63
63
  Cohere: "Cohere",
64
64
  CoreWeave: "CoreWeave",
65
+ Cosine: "Cosine",
65
66
  Crucible: "Crucible",
66
67
  Crusoe: "Crusoe",
67
68
  Darkbloom: "Darkbloom",
@@ -114,6 +114,9 @@ export type VideoGenerationRequestOptions = {
114
114
  coreweave?: {
115
115
  [k: string]: any;
116
116
  } | undefined;
117
+ cosine?: {
118
+ [k: string]: any;
119
+ } | undefined;
117
120
  crofai?: {
118
121
  [k: string]: any;
119
122
  } | undefined;
@@ -607,6 +610,9 @@ export type VideoGenerationRequestOptions$Outbound = {
607
610
  coreweave?: {
608
611
  [k: string]: any;
609
612
  } | undefined;
613
+ cosine?: {
614
+ [k: string]: any;
615
+ } | undefined;
610
616
  crofai?: {
611
617
  [k: string]: any;
612
618
  } | undefined;
@@ -67,6 +67,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
67
67
  cloudflare: z.record(z.string(), z.any()).optional(),
68
68
  cohere: z.record(z.string(), z.any()).optional(),
69
69
  coreweave: z.record(z.string(), z.any()).optional(),
70
+ cosine: z.record(z.string(), z.any()).optional(),
70
71
  crofai: z.record(z.string(), z.any()).optional(),
71
72
  crucible: z.record(z.string(), z.any()).optional(),
72
73
  crusoe: z.record(z.string(), z.any()).optional(),
@@ -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.81",
5
+ "version": "1.2.83",
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.81",
3
+ "version": "1.2.83",
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
+ "compile": "tsc",
77
+ "prepare": "npm run build",
76
78
  "test:transit": "exit 0",
77
79
  "typecheck:transit": "exit 0",
78
- "prepare": "npm run build",
80
+ "postinstall": "node scripts/check-types.js || true",
79
81
  "test": "vitest --run --project unit",
80
82
  "test:e2e": "vitest --run --project e2e",
81
83
  "test:watch": "vitest --watch --project unit",
82
- "typecheck": "tsc --noEmit",
83
- "compile": "tsc",
84
- "postinstall": "node scripts/check-types.js || true"
84
+ "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {