@openrouter/sdk 1.5.37 → 1.5.39

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.
@@ -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.5.37";
53
+ readonly sdkVersion: "1.5.39";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.37 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.39 2.950.13 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.5.37",
32
+ sdkVersion: "1.5.39",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.37 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.39 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -85,6 +85,7 @@ export declare const BYOKProviderSlug: {
85
85
  readonly Parasail: "parasail";
86
86
  readonly ParetoAlpha: "pareto-alpha";
87
87
  readonly ParticleAi: "particle-ai";
88
+ readonly PearlResearch: "pearl-research";
88
89
  readonly Perceptron: "perceptron";
89
90
  readonly Perplexity: "perplexity";
90
91
  readonly Phala: "phala";
@@ -88,6 +88,7 @@ export const BYOKProviderSlug = {
88
88
  Parasail: "parasail",
89
89
  ParetoAlpha: "pareto-alpha",
90
90
  ParticleAi: "particle-ai",
91
+ PearlResearch: "pearl-research",
91
92
  Perceptron: "perceptron",
92
93
  Perplexity: "perplexity",
93
94
  Phala: "phala",
@@ -5,6 +5,7 @@ import { DecisionsBoxAnswer } from "./decisionsboxanswer.js";
5
5
  import { DecisionsChoiceAnswer } from "./decisionschoiceanswer.js";
6
6
  import { DecisionsNoulAnswer } from "./decisionsnoulanswer.js";
7
7
  import { DecisionsScoreAnswer } from "./decisionsscoreanswer.js";
8
+ import { DecisionsUsageInputTokensDetails } from "./decisionsusageinputtokensdetails.js";
8
9
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
10
  /**
10
11
  * A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.
@@ -13,6 +14,10 @@ export type DecisionsResponseAnswers = DecisionsBoxAnswer | DecisionsChoiceAnswe
13
14
  export type DecisionsResponseUsage = {
14
15
  cost?: number | undefined;
15
16
  inputTokens: number;
17
+ /**
18
+ * Of `input_tokens`, those the provider served from its prompt cache.
19
+ */
20
+ inputTokensDetails?: DecisionsUsageInputTokensDetails | undefined;
16
21
  outputTokens: number;
17
22
  };
18
23
  export type DecisionsResponse = {
@@ -10,6 +10,7 @@ import { DecisionsBoxAnswer$inboundSchema, } from "./decisionsboxanswer.js";
10
10
  import { DecisionsChoiceAnswer$inboundSchema, } from "./decisionschoiceanswer.js";
11
11
  import { DecisionsNoulAnswer$inboundSchema, } from "./decisionsnoulanswer.js";
12
12
  import { DecisionsScoreAnswer$inboundSchema, } from "./decisionsscoreanswer.js";
13
+ import { DecisionsUsageInputTokensDetails$inboundSchema, } from "./decisionsusageinputtokensdetails.js";
13
14
  /** @internal */
14
15
  export const DecisionsResponseAnswers$inboundSchema = discriminatedUnion("type", {
15
16
  box: DecisionsBoxAnswer$inboundSchema,
@@ -24,10 +25,13 @@ export function decisionsResponseAnswersFromJSON(jsonString) {
24
25
  export const DecisionsResponseUsage$inboundSchema = z.object({
25
26
  cost: z.number().optional(),
26
27
  input_tokens: z.int(),
28
+ input_tokens_details: DecisionsUsageInputTokensDetails$inboundSchema
29
+ .optional(),
27
30
  output_tokens: z.int(),
28
31
  }).transform((v) => {
29
32
  return remap$(v, {
30
33
  "input_tokens": "inputTokens",
34
+ "input_tokens_details": "inputTokensDetails",
31
35
  "output_tokens": "outputTokens",
32
36
  });
33
37
  });
@@ -0,0 +1,13 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Of `input_tokens`, those the provider served from its prompt cache.
6
+ */
7
+ export type DecisionsUsageInputTokensDetails = {
8
+ cachedTokens: number;
9
+ };
10
+ /** @internal */
11
+ export declare const DecisionsUsageInputTokensDetails$inboundSchema: z.ZodType<DecisionsUsageInputTokensDetails, unknown>;
12
+ export declare function decisionsUsageInputTokensDetailsFromJSON(jsonString: string): SafeParseResult<DecisionsUsageInputTokensDetails, SDKValidationError>;
13
+ //# sourceMappingURL=decisionsusageinputtokensdetails.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b181089cef6c
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
+ /** @internal */
9
+ export const DecisionsUsageInputTokensDetails$inboundSchema = z.object({
10
+ cached_tokens: z.int(),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ "cached_tokens": "cachedTokens",
14
+ });
15
+ });
16
+ export function decisionsUsageInputTokensDetailsFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => DecisionsUsageInputTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsUsageInputTokensDetails' from JSON`);
18
+ }
19
+ //# sourceMappingURL=decisionsusageinputtokensdetails.js.map
@@ -317,6 +317,9 @@ export type ImageGenerationProviderPreferencesOptions = {
317
317
  particleAi?: {
318
318
  [k: string]: any;
319
319
  } | undefined;
320
+ pearlResearch?: {
321
+ [k: string]: any;
322
+ } | undefined;
320
323
  perceptron?: {
321
324
  [k: string]: any;
322
325
  } | undefined;
@@ -818,6 +821,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
818
821
  "particle-ai"?: {
819
822
  [k: string]: any;
820
823
  } | undefined;
824
+ "pearl-research"?: {
825
+ [k: string]: any;
826
+ } | undefined;
821
827
  perceptron?: {
822
828
  [k: string]: any;
823
829
  } | undefined;
@@ -122,6 +122,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
122
122
  parasail: z.record(z.string(), z.any()).optional(),
123
123
  paretoAlpha: z.record(z.string(), z.any()).optional(),
124
124
  particleAi: z.record(z.string(), z.any()).optional(),
125
+ pearlResearch: z.record(z.string(), z.any()).optional(),
125
126
  perceptron: z.record(z.string(), z.any()).optional(),
126
127
  perplexity: z.record(z.string(), z.any()).optional(),
127
128
  phala: z.record(z.string(), z.any()).optional(),
@@ -197,6 +198,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
197
198
  openInference: "open-inference",
198
199
  paretoAlpha: "pareto-alpha",
199
200
  particleAi: "particle-ai",
201
+ pearlResearch: "pearl-research",
200
202
  sailResearch: "sail-research",
201
203
  sakanaAi: "sakana-ai",
202
204
  sambanovaCloaked: "sambanova-cloaked",
@@ -310,6 +310,7 @@ export * from "./decisionsrequest.js";
310
310
  export * from "./decisionsresponse.js";
311
311
  export * from "./decisionsscoreanswer.js";
312
312
  export * from "./decisionsscorequestion.js";
313
+ export * from "./decisionsusageinputtokensdetails.js";
313
314
  export * from "./defaultparameters.js";
314
315
  export * from "./deferredbm25search.js";
315
316
  export * from "./deferredcustomsearch.js";
@@ -314,6 +314,7 @@ export * from "./decisionsrequest.js";
314
314
  export * from "./decisionsresponse.js";
315
315
  export * from "./decisionsscoreanswer.js";
316
316
  export * from "./decisionsscorequestion.js";
317
+ export * from "./decisionsusageinputtokensdetails.js";
317
318
  export * from "./defaultparameters.js";
318
319
  export * from "./deferredbm25search.js";
319
320
  export * from "./deferredcustomsearch.js";
@@ -109,6 +109,7 @@ export declare const Provider: {
109
109
  readonly Parasail: "parasail";
110
110
  readonly ParetoAlpha: "pareto-alpha";
111
111
  readonly ParticleAi: "particle-ai";
112
+ readonly PearlResearch: "pearl-research";
112
113
  readonly Perceptron: "perceptron";
113
114
  readonly Perplexity: "perplexity";
114
115
  readonly Phala: "phala";
@@ -92,6 +92,7 @@ export const Provider = {
92
92
  Parasail: "parasail",
93
93
  ParetoAlpha: "pareto-alpha",
94
94
  ParticleAi: "particle-ai",
95
+ PearlResearch: "pearl-research",
95
96
  Perceptron: "perceptron",
96
97
  Perplexity: "perplexity",
97
98
  Phala: "phala",
@@ -82,6 +82,7 @@ export declare const ProviderName: {
82
82
  readonly Parasail: "Parasail";
83
83
  readonly ParetoAlpha: "ParetoAlpha";
84
84
  readonly ParticleAI: "Particle AI";
85
+ readonly PearlResearch: "Pearl Research";
85
86
  readonly Poolside: "Poolside";
86
87
  readonly PrimaLabs: "PrimaLabs";
87
88
  readonly PrimeIntellect: "PrimeIntellect";
@@ -85,6 +85,7 @@ export const ProviderName = {
85
85
  Parasail: "Parasail",
86
86
  ParetoAlpha: "ParetoAlpha",
87
87
  ParticleAI: "Particle AI",
88
+ PearlResearch: "Pearl Research",
88
89
  Poolside: "Poolside",
89
90
  PrimaLabs: "PrimaLabs",
90
91
  PrimeIntellect: "PrimeIntellect",
@@ -312,6 +312,9 @@ export type ProviderOptions = {
312
312
  particleAi?: {
313
313
  [k: string]: any;
314
314
  } | undefined;
315
+ pearlResearch?: {
316
+ [k: string]: any;
317
+ } | undefined;
315
318
  perceptron?: {
316
319
  [k: string]: any;
317
320
  } | undefined;
@@ -768,6 +771,9 @@ export type ProviderOptions$Outbound = {
768
771
  "particle-ai"?: {
769
772
  [k: string]: any;
770
773
  } | undefined;
774
+ "pearl-research"?: {
775
+ [k: string]: any;
776
+ } | undefined;
771
777
  perceptron?: {
772
778
  [k: string]: any;
773
779
  } | undefined;
@@ -109,6 +109,7 @@ export const ProviderOptions$outboundSchema = z.object({
109
109
  parasail: z.record(z.string(), z.any()).optional(),
110
110
  paretoAlpha: z.record(z.string(), z.any()).optional(),
111
111
  particleAi: z.record(z.string(), z.any()).optional(),
112
+ pearlResearch: z.record(z.string(), z.any()).optional(),
112
113
  perceptron: z.record(z.string(), z.any()).optional(),
113
114
  perplexity: z.record(z.string(), z.any()).optional(),
114
115
  phala: z.record(z.string(), z.any()).optional(),
@@ -184,6 +185,7 @@ export const ProviderOptions$outboundSchema = z.object({
184
185
  openInference: "open-inference",
185
186
  paretoAlpha: "pareto-alpha",
186
187
  particleAi: "particle-ai",
188
+ pearlResearch: "pearl-research",
187
189
  sailResearch: "sail-research",
188
190
  sakanaAi: "sakana-ai",
189
191
  sambanovaCloaked: "sambanova-cloaked",
@@ -115,6 +115,7 @@ export declare const ProviderResponseProviderName: {
115
115
  readonly Parasail: "Parasail";
116
116
  readonly ParetoAlpha: "ParetoAlpha";
117
117
  readonly ParticleAI: "Particle AI";
118
+ readonly PearlResearch: "Pearl Research";
118
119
  readonly Poolside: "Poolside";
119
120
  readonly PrimaLabs: "PrimaLabs";
120
121
  readonly PrimeIntellect: "PrimeIntellect";
@@ -119,6 +119,7 @@ export const ProviderResponseProviderName = {
119
119
  Parasail: "Parasail",
120
120
  ParetoAlpha: "ParetoAlpha",
121
121
  ParticleAI: "Particle AI",
122
+ PearlResearch: "Pearl Research",
122
123
  Poolside: "Poolside",
123
124
  PrimaLabs: "PrimaLabs",
124
125
  PrimeIntellect: "PrimeIntellect",
@@ -334,6 +334,9 @@ export type VideoGenerationRequestOptions = {
334
334
  particleAi?: {
335
335
  [k: string]: any;
336
336
  } | undefined;
337
+ pearlResearch?: {
338
+ [k: string]: any;
339
+ } | undefined;
337
340
  perceptron?: {
338
341
  [k: string]: any;
339
342
  } | undefined;
@@ -886,6 +889,9 @@ export type VideoGenerationRequestOptions$Outbound = {
886
889
  "particle-ai"?: {
887
890
  [k: string]: any;
888
891
  } | undefined;
892
+ "pearl-research"?: {
893
+ [k: string]: any;
894
+ } | undefined;
889
895
  perceptron?: {
890
896
  [k: string]: any;
891
897
  } | undefined;
@@ -142,6 +142,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
142
142
  parasail: z.record(z.string(), z.any()).optional(),
143
143
  paretoAlpha: z.record(z.string(), z.any()).optional(),
144
144
  particleAi: z.record(z.string(), z.any()).optional(),
145
+ pearlResearch: z.record(z.string(), z.any()).optional(),
145
146
  perceptron: z.record(z.string(), z.any()).optional(),
146
147
  perplexity: z.record(z.string(), z.any()).optional(),
147
148
  phala: z.record(z.string(), z.any()).optional(),
@@ -217,6 +218,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
217
218
  openInference: "open-inference",
218
219
  paretoAlpha: "pareto-alpha",
219
220
  particleAi: "particle-ai",
221
+ pearlResearch: "pearl-research",
220
222
  sailResearch: "sail-research",
221
223
  sakanaAi: "sakana-ai",
222
224
  sambanovaCloaked: "sambanova-cloaked",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.37",
5
+ "version": "1.5.39",
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.37",
3
+ "version": "1.5.39",
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": [
@@ -74,14 +74,14 @@
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
76
  "compile": "tsc && node scripts/unbarrel-imports.js",
77
- "prepare": "npm run build",
78
- "test": "vitest --run --project unit",
77
+ "postinstall": "node scripts/check-types.js || true",
79
78
  "test:e2e": "vitest --run --project e2e",
80
79
  "test:transit": "exit 0",
81
- "typecheck:transit": "exit 0",
82
- "postinstall": "node scripts/check-types.js || true",
83
80
  "test:watch": "vitest --watch --project unit",
84
- "typecheck": "tsc --noEmit"
81
+ "typecheck": "tsc --noEmit",
82
+ "prepare": "npm run build",
83
+ "test": "vitest --run --project unit",
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {
87
87