@openrouter/sdk 1.5.30 → 1.5.32

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.
Files changed (44) hide show
  1. package/esm/funcs/apiKeysDelete.d.ts +1 -1
  2. package/esm/funcs/apiKeysDelete.js +2 -2
  3. package/esm/funcs/apiKeysGet.d.ts +1 -1
  4. package/esm/funcs/apiKeysGet.js +2 -2
  5. package/esm/funcs/apiKeysList.d.ts +1 -1
  6. package/esm/funcs/apiKeysList.js +2 -2
  7. package/esm/lib/config.d.ts +2 -2
  8. package/esm/lib/config.js +2 -2
  9. package/esm/models/decisions.d.ts +16 -0
  10. package/esm/models/decisions.js +22 -0
  11. package/esm/models/embeddings.d.ts +16 -0
  12. package/esm/models/embeddings.js +23 -0
  13. package/esm/models/imagegeneration.d.ts +16 -0
  14. package/esm/models/imagegeneration.js +22 -0
  15. package/esm/models/index.d.ts +13 -0
  16. package/esm/models/index.js +13 -0
  17. package/esm/models/nativetools.d.ts +13 -0
  18. package/esm/models/nativetools.js +15 -0
  19. package/esm/models/operations/createkeys.d.ts +1 -1
  20. package/esm/models/operations/list.d.ts +1 -1
  21. package/esm/models/operations/listendpointszdr.d.ts +1 -1
  22. package/esm/models/operations/listendpointszdr.js +2 -2
  23. package/esm/models/perflast30mbyworkload.d.ts +30 -0
  24. package/esm/models/perflast30mbyworkload.js +38 -0
  25. package/esm/models/pricing.d.ts +74 -0
  26. package/esm/models/pricing.js +43 -0
  27. package/esm/models/publicendpoint.d.ts +3 -195
  28. package/esm/models/publicendpoint.js +6 -186
  29. package/esm/models/publiczdrendpoint.d.ts +93 -0
  30. package/esm/models/publiczdrendpoint.js +76 -0
  31. package/esm/models/rerank.d.ts +16 -0
  32. package/esm/models/rerank.js +22 -0
  33. package/esm/models/stt.d.ts +16 -0
  34. package/esm/models/stt.js +22 -0
  35. package/esm/models/textgeneration.d.ts +16 -0
  36. package/esm/models/textgeneration.js +22 -0
  37. package/esm/models/tts.d.ts +16 -0
  38. package/esm/models/tts.js +22 -0
  39. package/esm/models/unknown.d.ts +16 -0
  40. package/esm/models/unknown.js +22 -0
  41. package/esm/models/videogeneration.d.ts +16 -0
  42. package/esm/models/videogeneration.js +22 -0
  43. package/jsr.json +1 -1
  44. package/package.json +4 -4
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 965276f8cd2f
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { EndpointStatus$inboundSchema, } from "./endpointstatus.js";
9
+ import { NativeTools$inboundSchema } from "./nativetools.js";
10
+ import { Parameter$inboundSchema } from "./parameter.js";
11
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
12
+ import { PerfLast30mByWorkload$inboundSchema, } from "./perflast30mbyworkload.js";
13
+ import { Pricing$inboundSchema } from "./pricing.js";
14
+ import { ProviderName$inboundSchema } from "./providername.js";
15
+ import { PublicServiceTier$inboundSchema, } from "./publicservicetier.js";
16
+ import { Quantization$inboundSchema } from "./quantization.js";
17
+ import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
18
+ /** @internal */
19
+ export const PublicZdrEndpoint$inboundSchema = z.object({
20
+ context_length: z.int(),
21
+ latency_last_30m: z.nullable(PercentileStats$inboundSchema),
22
+ max_completion_tokens: z.nullable(z.int()),
23
+ max_prompt_tokens: z.nullable(z.int()),
24
+ model_id: z.string(),
25
+ model_name: z.string(),
26
+ name: z.string(),
27
+ native_tools: z.record(z.string(), NativeTools$inboundSchema),
28
+ perf_last_30m_by_workload: PerfLast30mByWorkload$inboundSchema.optional(),
29
+ pricing: Pricing$inboundSchema,
30
+ provider_name: ProviderName$inboundSchema,
31
+ quantization: z.nullable(Quantization$inboundSchema),
32
+ service_tier: z.nullable(PublicServiceTier$inboundSchema),
33
+ status: EndpointStatus$inboundSchema.optional(),
34
+ supported_parameters: z.array(Parameter$inboundSchema),
35
+ supports_diarization: z.boolean(),
36
+ supports_image_reference: z.boolean().default(false),
37
+ supports_implicit_caching: z.boolean(),
38
+ supports_multiple_audio_references: z.boolean().default(false),
39
+ supports_tool_choice: ToolChoiceSupport$inboundSchema,
40
+ supports_voice_cloning: z.boolean().default(false),
41
+ tag: z.string(),
42
+ throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
43
+ uptime_last_1d: z.nullable(z.number()),
44
+ uptime_last_30m: z.nullable(z.number()),
45
+ uptime_last_5m: z.nullable(z.number()),
46
+ safety_retention: z.boolean(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ "context_length": "contextLength",
50
+ "latency_last_30m": "latencyLast30m",
51
+ "max_completion_tokens": "maxCompletionTokens",
52
+ "max_prompt_tokens": "maxPromptTokens",
53
+ "model_id": "modelId",
54
+ "model_name": "modelName",
55
+ "native_tools": "nativeTools",
56
+ "perf_last_30m_by_workload": "perfLast30mByWorkload",
57
+ "provider_name": "providerName",
58
+ "service_tier": "serviceTier",
59
+ "supported_parameters": "supportedParameters",
60
+ "supports_diarization": "supportsDiarization",
61
+ "supports_image_reference": "supportsImageReference",
62
+ "supports_implicit_caching": "supportsImplicitCaching",
63
+ "supports_multiple_audio_references": "supportsMultipleAudioReferences",
64
+ "supports_tool_choice": "supportsToolChoice",
65
+ "supports_voice_cloning": "supportsVoiceCloning",
66
+ "throughput_last_30m": "throughputLast30m",
67
+ "uptime_last_1d": "uptimeLast1d",
68
+ "uptime_last_30m": "uptimeLast30m",
69
+ "uptime_last_5m": "uptimeLast5m",
70
+ "safety_retention": "safetyRetention",
71
+ });
72
+ });
73
+ export function publicZdrEndpointFromJSON(jsonString) {
74
+ return safeParse(jsonString, (x) => PublicZdrEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicZdrEndpoint' from JSON`);
75
+ }
76
+ //# sourceMappingURL=publiczdrendpoint.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type Rerank = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const Rerank$inboundSchema: z.ZodType<Rerank, unknown>;
15
+ export declare function rerankFromJSON(jsonString: string): SafeParseResult<Rerank, SDKValidationError>;
16
+ //# sourceMappingURL=rerank.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2b9cb6c3de15
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const Rerank$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function rerankFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => Rerank$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rerank' from JSON`);
21
+ }
22
+ //# sourceMappingURL=rerank.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type STT = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const STT$inboundSchema: z.ZodType<STT, unknown>;
15
+ export declare function sttFromJSON(jsonString: string): SafeParseResult<STT, SDKValidationError>;
16
+ //# sourceMappingURL=stt.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: cce853695df0
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const STT$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function sttFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => STT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'STT' from JSON`);
21
+ }
22
+ //# sourceMappingURL=stt.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type TextGeneration = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const TextGeneration$inboundSchema: z.ZodType<TextGeneration, unknown>;
15
+ export declare function textGenerationFromJSON(jsonString: string): SafeParseResult<TextGeneration, SDKValidationError>;
16
+ //# sourceMappingURL=textgeneration.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 077e723dcb01
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const TextGeneration$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function textGenerationFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => TextGeneration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextGeneration' from JSON`);
21
+ }
22
+ //# sourceMappingURL=textgeneration.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type TTS = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const TTS$inboundSchema: z.ZodType<TTS, unknown>;
15
+ export declare function ttsFromJSON(jsonString: string): SafeParseResult<TTS, SDKValidationError>;
16
+ //# sourceMappingURL=tts.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 076814f3333a
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const TTS$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function ttsFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => TTS$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TTS' from JSON`);
21
+ }
22
+ //# sourceMappingURL=tts.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type Unknown = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const Unknown$inboundSchema: z.ZodType<Unknown, unknown>;
15
+ export declare function unknownFromJSON(jsonString: string): SafeParseResult<Unknown, SDKValidationError>;
16
+ //# sourceMappingURL=unknown.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 57f38983ea28
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const Unknown$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function unknownFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => Unknown$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Unknown' from JSON`);
21
+ }
22
+ //# sourceMappingURL=unknown.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { PercentileStats } from "./percentilestats.js";
5
+ export type VideoGeneration = {
6
+ latency: PercentileStats | null;
7
+ /**
8
+ * Total requests admitted for this workload in the window.
9
+ */
10
+ requestCount: number | null;
11
+ throughput: PercentileStats | null;
12
+ };
13
+ /** @internal */
14
+ export declare const VideoGeneration$inboundSchema: z.ZodType<VideoGeneration, unknown>;
15
+ export declare function videoGenerationFromJSON(jsonString: string): SafeParseResult<VideoGeneration, SDKValidationError>;
16
+ //# sourceMappingURL=videogeneration.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: acac14163f87
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
9
+ /** @internal */
10
+ export const VideoGeneration$inboundSchema = z.object({
11
+ latency: z.nullable(PercentileStats$inboundSchema),
12
+ request_count: z.nullable(z.int()),
13
+ throughput: z.nullable(PercentileStats$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "request_count": "requestCount",
17
+ });
18
+ });
19
+ export function videoGenerationFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => VideoGeneration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoGeneration' from JSON`);
21
+ }
22
+ //# sourceMappingURL=videogeneration.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.30",
5
+ "version": "1.5.32",
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.30",
3
+ "version": "1.5.32",
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,12 +73,12 @@
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
- "postinstall": "node scripts/check-types.js || true",
77
- "test:e2e": "vitest --run --project e2e",
78
76
  "test:transit": "exit 0",
77
+ "test:watch": "vitest --watch --project unit",
78
+ "postinstall": "node scripts/check-types.js || true",
79
79
  "prepare": "npm run build",
80
80
  "test": "vitest --run --project unit",
81
- "test:watch": "vitest --watch --project unit",
81
+ "test:e2e": "vitest --run --project e2e",
82
82
  "typecheck": "tsc --noEmit",
83
83
  "typecheck:transit": "exit 0",
84
84
  "compile": "tsc && node scripts/unbarrel-imports.js"