@openrouter/sdk 0.2.9 → 0.2.11

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.
@@ -101,11 +101,11 @@ export function ignoreToJSON(ignore) {
101
101
  /** @internal */
102
102
  export const MaxPrice$outboundSchema = z
103
103
  .object({
104
- prompt: z.any().optional(),
105
- completion: z.any().optional(),
106
- image: z.any().optional(),
107
- audio: z.any().optional(),
108
- request: z.any().optional(),
104
+ prompt: z.string().optional(),
105
+ completion: z.string().optional(),
106
+ image: z.string().optional(),
107
+ audio: z.string().optional(),
108
+ request: z.string().optional(),
109
109
  });
110
110
  export function maxPriceToJSON(maxPrice) {
111
111
  return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice));
@@ -124,6 +124,8 @@ export const CreateEmbeddingsProvider$outboundSchema = z.object({
124
124
  .optional(),
125
125
  sort: z.nullable(models.ProviderSort$outboundSchema).optional(),
126
126
  maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(),
127
+ minThroughput: z.nullable(z.number()).optional(),
128
+ maxLatency: z.nullable(z.number()).optional(),
127
129
  }).transform((v) => {
128
130
  return remap$(v, {
129
131
  allowFallbacks: "allow_fallbacks",
@@ -131,6 +133,8 @@ export const CreateEmbeddingsProvider$outboundSchema = z.object({
131
133
  dataCollection: "data_collection",
132
134
  enforceDistillableText: "enforce_distillable_text",
133
135
  maxPrice: "max_price",
136
+ minThroughput: "min_throughput",
137
+ maxLatency: "max_latency",
134
138
  });
135
139
  });
136
140
  export function createEmbeddingsProviderToJSON(createEmbeddingsProvider) {
@@ -196,13 +200,21 @@ export function usageFromJSON(jsonString) {
196
200
  return safeParse(jsonString, (x) => Usage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Usage' from JSON`);
197
201
  }
198
202
  /** @internal */
199
- export const CreateEmbeddingsResponse$inboundSchema = z.object({
203
+ export const CreateEmbeddingsResponseBody$inboundSchema = z.object({
200
204
  id: z.string().optional(),
201
205
  object: ObjectT$inboundSchema,
202
206
  data: z.array(z.lazy(() => CreateEmbeddingsData$inboundSchema)),
203
207
  model: z.string(),
204
208
  usage: z.lazy(() => Usage$inboundSchema).optional(),
205
209
  });
210
+ export function createEmbeddingsResponseBodyFromJSON(jsonString) {
211
+ return safeParse(jsonString, (x) => CreateEmbeddingsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsResponseBody' from JSON`);
212
+ }
213
+ /** @internal */
214
+ export const CreateEmbeddingsResponse$inboundSchema = z.union([
215
+ z.lazy(() => CreateEmbeddingsResponseBody$inboundSchema),
216
+ z.string(),
217
+ ]);
206
218
  export function createEmbeddingsResponseFromJSON(jsonString) {
207
219
  return safeParse(jsonString, (x) => CreateEmbeddingsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsResponse' from JSON`);
208
220
  }
@@ -42,6 +42,7 @@ export declare const GetParametersProvider: {
42
42
  readonly Infermatic: "Infermatic";
43
43
  readonly Inflection: "Inflection";
44
44
  readonly Liquid: "Liquid";
45
+ readonly Mara: "Mara";
45
46
  readonly Mancer2: "Mancer 2";
46
47
  readonly Minimax: "Minimax";
47
48
  readonly ModelRun: "ModelRun";
@@ -62,6 +63,7 @@ export declare const GetParametersProvider: {
62
63
  readonly Relace: "Relace";
63
64
  readonly SambaNova: "SambaNova";
64
65
  readonly SiliconFlow: "SiliconFlow";
66
+ readonly Sourceful: "Sourceful";
65
67
  readonly Stealth: "Stealth";
66
68
  readonly StreamLake: "StreamLake";
67
69
  readonly Switchpoint: "Switchpoint";
@@ -69,6 +71,7 @@ export declare const GetParametersProvider: {
69
71
  readonly Together: "Together";
70
72
  readonly Venice: "Venice";
71
73
  readonly WandB: "WandB";
74
+ readonly Xiaomi: "Xiaomi";
72
75
  readonly XAI: "xAI";
73
76
  readonly ZAi: "Z.AI";
74
77
  readonly FakeProvider: "FakeProvider";
@@ -42,6 +42,7 @@ export const GetParametersProvider = {
42
42
  Infermatic: "Infermatic",
43
43
  Inflection: "Inflection",
44
44
  Liquid: "Liquid",
45
+ Mara: "Mara",
45
46
  Mancer2: "Mancer 2",
46
47
  Minimax: "Minimax",
47
48
  ModelRun: "ModelRun",
@@ -62,6 +63,7 @@ export const GetParametersProvider = {
62
63
  Relace: "Relace",
63
64
  SambaNova: "SambaNova",
64
65
  SiliconFlow: "SiliconFlow",
66
+ Sourceful: "Sourceful",
65
67
  Stealth: "Stealth",
66
68
  StreamLake: "StreamLake",
67
69
  Switchpoint: "Switchpoint",
@@ -69,6 +71,7 @@ export const GetParametersProvider = {
69
71
  Together: "Together",
70
72
  Venice: "Venice",
71
73
  WandB: "WandB",
74
+ Xiaomi: "Xiaomi",
72
75
  XAI: "xAI",
73
76
  ZAi: "Z.AI",
74
77
  FakeProvider: "FakeProvider",
@@ -37,6 +37,7 @@ export declare const ProviderName: {
37
37
  readonly Infermatic: "Infermatic";
38
38
  readonly Inflection: "Inflection";
39
39
  readonly Liquid: "Liquid";
40
+ readonly Mara: "Mara";
40
41
  readonly Mancer2: "Mancer 2";
41
42
  readonly Minimax: "Minimax";
42
43
  readonly ModelRun: "ModelRun";
@@ -57,6 +58,7 @@ export declare const ProviderName: {
57
58
  readonly Relace: "Relace";
58
59
  readonly SambaNova: "SambaNova";
59
60
  readonly SiliconFlow: "SiliconFlow";
61
+ readonly Sourceful: "Sourceful";
60
62
  readonly Stealth: "Stealth";
61
63
  readonly StreamLake: "StreamLake";
62
64
  readonly Switchpoint: "Switchpoint";
@@ -64,6 +66,7 @@ export declare const ProviderName: {
64
66
  readonly Together: "Together";
65
67
  readonly Venice: "Venice";
66
68
  readonly WandB: "WandB";
69
+ readonly Xiaomi: "Xiaomi";
67
70
  readonly XAI: "xAI";
68
71
  readonly ZAi: "Z.AI";
69
72
  readonly FakeProvider: "FakeProvider";
@@ -39,6 +39,7 @@ export const ProviderName = {
39
39
  Infermatic: "Infermatic",
40
40
  Inflection: "Inflection",
41
41
  Liquid: "Liquid",
42
+ Mara: "Mara",
42
43
  Mancer2: "Mancer 2",
43
44
  Minimax: "Minimax",
44
45
  ModelRun: "ModelRun",
@@ -59,6 +60,7 @@ export const ProviderName = {
59
60
  Relace: "Relace",
60
61
  SambaNova: "SambaNova",
61
62
  SiliconFlow: "SiliconFlow",
63
+ Sourceful: "Sourceful",
62
64
  Stealth: "Stealth",
63
65
  StreamLake: "StreamLake",
64
66
  Switchpoint: "Switchpoint",
@@ -66,6 +68,7 @@ export const ProviderName = {
66
68
  Together: "Together",
67
69
  Venice: "Venice",
68
70
  WandB: "WandB",
71
+ Xiaomi: "Xiaomi",
69
72
  XAI: "xAI",
70
73
  ZAi: "Z.AI",
71
74
  FakeProvider: "FakeProvider",
@@ -7,53 +7,53 @@ import { Parameter } from "./parameter.js";
7
7
  import { ProviderName } from "./providername.js";
8
8
  export type Pricing = {
9
9
  /**
10
- * A value in string or number format that is a large number
10
+ * A value in string format that is a large number
11
11
  */
12
- prompt?: any | undefined;
12
+ prompt: string;
13
13
  /**
14
- * A value in string or number format that is a large number
14
+ * A value in string format that is a large number
15
15
  */
16
- completion?: any | undefined;
16
+ completion: string;
17
17
  /**
18
- * A value in string or number format that is a large number
18
+ * A value in string format that is a large number
19
19
  */
20
- request?: any | undefined;
20
+ request?: string | undefined;
21
21
  /**
22
- * A value in string or number format that is a large number
22
+ * A value in string format that is a large number
23
23
  */
24
- image?: any | undefined;
24
+ image?: string | undefined;
25
25
  /**
26
- * A value in string or number format that is a large number
26
+ * A value in string format that is a large number
27
27
  */
28
- imageToken?: any | undefined;
28
+ imageToken?: string | undefined;
29
29
  /**
30
- * A value in string or number format that is a large number
30
+ * A value in string format that is a large number
31
31
  */
32
- imageOutput?: any | undefined;
32
+ imageOutput?: string | undefined;
33
33
  /**
34
- * A value in string or number format that is a large number
34
+ * A value in string format that is a large number
35
35
  */
36
- audio?: any | undefined;
36
+ audio?: string | undefined;
37
37
  /**
38
- * A value in string or number format that is a large number
38
+ * A value in string format that is a large number
39
39
  */
40
- inputAudioCache?: any | undefined;
40
+ inputAudioCache?: string | undefined;
41
41
  /**
42
- * A value in string or number format that is a large number
42
+ * A value in string format that is a large number
43
43
  */
44
- webSearch?: any | undefined;
44
+ webSearch?: string | undefined;
45
45
  /**
46
- * A value in string or number format that is a large number
46
+ * A value in string format that is a large number
47
47
  */
48
- internalReasoning?: any | undefined;
48
+ internalReasoning?: string | undefined;
49
49
  /**
50
- * A value in string or number format that is a large number
50
+ * A value in string format that is a large number
51
51
  */
52
- inputCacheRead?: any | undefined;
52
+ inputCacheRead?: string | undefined;
53
53
  /**
54
- * A value in string or number format that is a large number
54
+ * A value in string format that is a large number
55
55
  */
56
- inputCacheWrite?: any | undefined;
56
+ inputCacheWrite?: string | undefined;
57
57
  discount?: number | undefined;
58
58
  };
59
59
  export declare const PublicEndpointQuantization: {
@@ -21,18 +21,18 @@ export const PublicEndpointQuantization = {
21
21
  };
22
22
  /** @internal */
23
23
  export const Pricing$inboundSchema = z.object({
24
- prompt: z.any().optional(),
25
- completion: z.any().optional(),
26
- request: z.any().optional(),
27
- image: z.any().optional(),
28
- image_token: z.any().optional(),
29
- image_output: z.any().optional(),
30
- audio: z.any().optional(),
31
- input_audio_cache: z.any().optional(),
32
- web_search: z.any().optional(),
33
- internal_reasoning: z.any().optional(),
34
- input_cache_read: z.any().optional(),
35
- input_cache_write: z.any().optional(),
24
+ prompt: z.string(),
25
+ completion: z.string(),
26
+ request: z.string().optional(),
27
+ image: z.string().optional(),
28
+ image_token: z.string().optional(),
29
+ image_output: z.string().optional(),
30
+ audio: z.string().optional(),
31
+ input_audio_cache: z.string().optional(),
32
+ web_search: z.string().optional(),
33
+ internal_reasoning: z.string().optional(),
34
+ input_cache_read: z.string().optional(),
35
+ input_cache_write: z.string().optional(),
36
36
  discount: z.number().optional(),
37
37
  }).transform((v) => {
38
38
  return remap$(v, {
@@ -6,53 +6,53 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
6
6
  */
7
7
  export type PublicPricing = {
8
8
  /**
9
- * A value in string or number format that is a large number
9
+ * A value in string format that is a large number
10
10
  */
11
- prompt?: any | undefined;
11
+ prompt: string;
12
12
  /**
13
- * A value in string or number format that is a large number
13
+ * A value in string format that is a large number
14
14
  */
15
- completion?: any | undefined;
15
+ completion: string;
16
16
  /**
17
- * A value in string or number format that is a large number
17
+ * A value in string format that is a large number
18
18
  */
19
- request?: any | undefined;
19
+ request?: string | undefined;
20
20
  /**
21
- * A value in string or number format that is a large number
21
+ * A value in string format that is a large number
22
22
  */
23
- image?: any | undefined;
23
+ image?: string | undefined;
24
24
  /**
25
- * A value in string or number format that is a large number
25
+ * A value in string format that is a large number
26
26
  */
27
- imageToken?: any | undefined;
27
+ imageToken?: string | undefined;
28
28
  /**
29
- * A value in string or number format that is a large number
29
+ * A value in string format that is a large number
30
30
  */
31
- imageOutput?: any | undefined;
31
+ imageOutput?: string | undefined;
32
32
  /**
33
- * A value in string or number format that is a large number
33
+ * A value in string format that is a large number
34
34
  */
35
- audio?: any | undefined;
35
+ audio?: string | undefined;
36
36
  /**
37
- * A value in string or number format that is a large number
37
+ * A value in string format that is a large number
38
38
  */
39
- inputAudioCache?: any | undefined;
39
+ inputAudioCache?: string | undefined;
40
40
  /**
41
- * A value in string or number format that is a large number
41
+ * A value in string format that is a large number
42
42
  */
43
- webSearch?: any | undefined;
43
+ webSearch?: string | undefined;
44
44
  /**
45
- * A value in string or number format that is a large number
45
+ * A value in string format that is a large number
46
46
  */
47
- internalReasoning?: any | undefined;
47
+ internalReasoning?: string | undefined;
48
48
  /**
49
- * A value in string or number format that is a large number
49
+ * A value in string format that is a large number
50
50
  */
51
- inputCacheRead?: any | undefined;
51
+ inputCacheRead?: string | undefined;
52
52
  /**
53
- * A value in string or number format that is a large number
53
+ * A value in string format that is a large number
54
54
  */
55
- inputCacheWrite?: any | undefined;
55
+ inputCacheWrite?: string | undefined;
56
56
  discount?: number | undefined;
57
57
  };
58
58
  /** @internal */
@@ -7,18 +7,18 @@ import { safeParse } from "../lib/schemas.js";
7
7
  /** @internal */
8
8
  export const PublicPricing$inboundSchema = z
9
9
  .object({
10
- prompt: z.any().optional(),
11
- completion: z.any().optional(),
12
- request: z.any().optional(),
13
- image: z.any().optional(),
14
- image_token: z.any().optional(),
15
- image_output: z.any().optional(),
16
- audio: z.any().optional(),
17
- input_audio_cache: z.any().optional(),
18
- web_search: z.any().optional(),
19
- internal_reasoning: z.any().optional(),
20
- input_cache_read: z.any().optional(),
21
- input_cache_write: z.any().optional(),
10
+ prompt: z.string(),
11
+ completion: z.string(),
12
+ request: z.string().optional(),
13
+ image: z.string().optional(),
14
+ image_token: z.string().optional(),
15
+ image_output: z.string().optional(),
16
+ audio: z.string().optional(),
17
+ input_audio_cache: z.string().optional(),
18
+ web_search: z.string().optional(),
19
+ internal_reasoning: z.string().optional(),
20
+ input_cache_read: z.string().optional(),
21
+ input_cache_write: z.string().optional(),
22
22
  discount: z.number().optional(),
23
23
  }).transform((v) => {
24
24
  return remap$(v, {
@@ -0,0 +1,83 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const Schema0Enum: {
4
+ readonly Ai21: "AI21";
5
+ readonly AionLabs: "AionLabs";
6
+ readonly Alibaba: "Alibaba";
7
+ readonly AmazonBedrock: "Amazon Bedrock";
8
+ readonly AmazonNova: "Amazon Nova";
9
+ readonly Anthropic: "Anthropic";
10
+ readonly ArceeAI: "Arcee AI";
11
+ readonly AtlasCloud: "AtlasCloud";
12
+ readonly Avian: "Avian";
13
+ readonly Azure: "Azure";
14
+ readonly BaseTen: "BaseTen";
15
+ readonly BytePlus: "BytePlus";
16
+ readonly BlackForestLabs: "Black Forest Labs";
17
+ readonly Cerebras: "Cerebras";
18
+ readonly Chutes: "Chutes";
19
+ readonly Cirrascale: "Cirrascale";
20
+ readonly Clarifai: "Clarifai";
21
+ readonly Cloudflare: "Cloudflare";
22
+ readonly Cohere: "Cohere";
23
+ readonly Crusoe: "Crusoe";
24
+ readonly DeepInfra: "DeepInfra";
25
+ readonly DeepSeek: "DeepSeek";
26
+ readonly Featherless: "Featherless";
27
+ readonly Fireworks: "Fireworks";
28
+ readonly Friendli: "Friendli";
29
+ readonly GMICloud: "GMICloud";
30
+ readonly GoPomelo: "GoPomelo";
31
+ readonly Google: "Google";
32
+ readonly GoogleAIStudio: "Google AI Studio";
33
+ readonly Groq: "Groq";
34
+ readonly Hyperbolic: "Hyperbolic";
35
+ readonly Inception: "Inception";
36
+ readonly InferenceNet: "InferenceNet";
37
+ readonly Infermatic: "Infermatic";
38
+ readonly Inflection: "Inflection";
39
+ readonly Liquid: "Liquid";
40
+ readonly Mara: "Mara";
41
+ readonly Mancer2: "Mancer 2";
42
+ readonly Minimax: "Minimax";
43
+ readonly ModelRun: "ModelRun";
44
+ readonly Mistral: "Mistral";
45
+ readonly Modular: "Modular";
46
+ readonly MoonshotAI: "Moonshot AI";
47
+ readonly Morph: "Morph";
48
+ readonly NCompass: "NCompass";
49
+ readonly Nebius: "Nebius";
50
+ readonly NextBit: "NextBit";
51
+ readonly Novita: "Novita";
52
+ readonly Nvidia: "Nvidia";
53
+ readonly OpenAI: "OpenAI";
54
+ readonly OpenInference: "OpenInference";
55
+ readonly Parasail: "Parasail";
56
+ readonly Perplexity: "Perplexity";
57
+ readonly Phala: "Phala";
58
+ readonly Relace: "Relace";
59
+ readonly SambaNova: "SambaNova";
60
+ readonly SiliconFlow: "SiliconFlow";
61
+ readonly Sourceful: "Sourceful";
62
+ readonly Stealth: "Stealth";
63
+ readonly StreamLake: "StreamLake";
64
+ readonly Switchpoint: "Switchpoint";
65
+ readonly Targon: "Targon";
66
+ readonly Together: "Together";
67
+ readonly Venice: "Venice";
68
+ readonly WandB: "WandB";
69
+ readonly Xiaomi: "Xiaomi";
70
+ readonly XAI: "xAI";
71
+ readonly ZAi: "Z.AI";
72
+ readonly FakeProvider: "FakeProvider";
73
+ };
74
+ export type Schema0Enum = OpenEnum<typeof Schema0Enum>;
75
+ export type Schema0 = Schema0Enum | string;
76
+ /** @internal */
77
+ export declare const Schema0Enum$outboundSchema: z.ZodType<string, Schema0Enum>;
78
+ /** @internal */
79
+ export type Schema0$Outbound = string | string;
80
+ /** @internal */
81
+ export declare const Schema0$outboundSchema: z.ZodType<Schema0$Outbound, Schema0>;
82
+ export declare function schema0ToJSON(schema0: Schema0): string;
83
+ //# sourceMappingURL=schema0.d.ts.map
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import * as openEnums from "../types/enums.js";
6
+ export const Schema0Enum = {
7
+ Ai21: "AI21",
8
+ AionLabs: "AionLabs",
9
+ Alibaba: "Alibaba",
10
+ AmazonBedrock: "Amazon Bedrock",
11
+ AmazonNova: "Amazon Nova",
12
+ Anthropic: "Anthropic",
13
+ ArceeAI: "Arcee AI",
14
+ AtlasCloud: "AtlasCloud",
15
+ Avian: "Avian",
16
+ Azure: "Azure",
17
+ BaseTen: "BaseTen",
18
+ BytePlus: "BytePlus",
19
+ BlackForestLabs: "Black Forest Labs",
20
+ Cerebras: "Cerebras",
21
+ Chutes: "Chutes",
22
+ Cirrascale: "Cirrascale",
23
+ Clarifai: "Clarifai",
24
+ Cloudflare: "Cloudflare",
25
+ Cohere: "Cohere",
26
+ Crusoe: "Crusoe",
27
+ DeepInfra: "DeepInfra",
28
+ DeepSeek: "DeepSeek",
29
+ Featherless: "Featherless",
30
+ Fireworks: "Fireworks",
31
+ Friendli: "Friendli",
32
+ GMICloud: "GMICloud",
33
+ GoPomelo: "GoPomelo",
34
+ Google: "Google",
35
+ GoogleAIStudio: "Google AI Studio",
36
+ Groq: "Groq",
37
+ Hyperbolic: "Hyperbolic",
38
+ Inception: "Inception",
39
+ InferenceNet: "InferenceNet",
40
+ Infermatic: "Infermatic",
41
+ Inflection: "Inflection",
42
+ Liquid: "Liquid",
43
+ Mara: "Mara",
44
+ Mancer2: "Mancer 2",
45
+ Minimax: "Minimax",
46
+ ModelRun: "ModelRun",
47
+ Mistral: "Mistral",
48
+ Modular: "Modular",
49
+ MoonshotAI: "Moonshot AI",
50
+ Morph: "Morph",
51
+ NCompass: "NCompass",
52
+ Nebius: "Nebius",
53
+ NextBit: "NextBit",
54
+ Novita: "Novita",
55
+ Nvidia: "Nvidia",
56
+ OpenAI: "OpenAI",
57
+ OpenInference: "OpenInference",
58
+ Parasail: "Parasail",
59
+ Perplexity: "Perplexity",
60
+ Phala: "Phala",
61
+ Relace: "Relace",
62
+ SambaNova: "SambaNova",
63
+ SiliconFlow: "SiliconFlow",
64
+ Sourceful: "Sourceful",
65
+ Stealth: "Stealth",
66
+ StreamLake: "StreamLake",
67
+ Switchpoint: "Switchpoint",
68
+ Targon: "Targon",
69
+ Together: "Together",
70
+ Venice: "Venice",
71
+ WandB: "WandB",
72
+ Xiaomi: "Xiaomi",
73
+ XAI: "xAI",
74
+ ZAi: "Z.AI",
75
+ FakeProvider: "FakeProvider",
76
+ };
77
+ /** @internal */
78
+ export const Schema0Enum$outboundSchema = openEnums.outboundSchema(Schema0Enum);
79
+ /** @internal */
80
+ export const Schema0$outboundSchema = z
81
+ .union([Schema0Enum$outboundSchema, z.string()]);
82
+ export function schema0ToJSON(schema0) {
83
+ return JSON.stringify(Schema0$outboundSchema.parse(schema0));
84
+ }
85
+ //# sourceMappingURL=schema0.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.2.9",
5
+ "version": "0.2.11",
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": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [