@openrouter/sdk 1.5.36 → 1.5.38
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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/decisionsresponse.d.ts +5 -0
- package/esm/models/decisionsresponse.js +4 -0
- package/esm/models/decisionsusageinputtokensdetails.d.ts +13 -0
- package/esm/models/decisionsusageinputtokensdetails.js +19 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/responseincludesenum.d.ts +1 -0
- package/esm/models/responseincludesenum.js +1 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
53
|
+
readonly sdkVersion: "1.5.38";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.38 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.
|
|
32
|
+
sdkVersion: "1.5.38",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.38 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -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
|
package/esm/models/index.d.ts
CHANGED
|
@@ -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";
|
package/esm/models/index.js
CHANGED
|
@@ -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";
|
|
@@ -5,6 +5,7 @@ export declare const ResponseIncludesEnum: {
|
|
|
5
5
|
readonly MessageInputImageImageUrl: "message.input_image.image_url";
|
|
6
6
|
readonly ComputerCallOutputOutputImageUrl: "computer_call_output.output.image_url";
|
|
7
7
|
readonly ReasoningEncryptedContent: "reasoning.encrypted_content";
|
|
8
|
+
readonly OutputEncryptedContent: "output.encrypted_content";
|
|
8
9
|
readonly CodeInterpreterCallOutputs: "code_interpreter_call.outputs";
|
|
9
10
|
};
|
|
10
11
|
export type ResponseIncludesEnum = OpenEnum<typeof ResponseIncludesEnum>;
|
|
@@ -8,6 +8,7 @@ export const ResponseIncludesEnum = {
|
|
|
8
8
|
MessageInputImageImageUrl: "message.input_image.image_url",
|
|
9
9
|
ComputerCallOutputOutputImageUrl: "computer_call_output.output.image_url",
|
|
10
10
|
ReasoningEncryptedContent: "reasoning.encrypted_content",
|
|
11
|
+
OutputEncryptedContent: "output.encrypted_content",
|
|
11
12
|
CodeInterpreterCallOutputs: "code_interpreter_call.outputs",
|
|
12
13
|
};
|
|
13
14
|
/** @internal */
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.38",
|
|
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 && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"prepare": "npm run build",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
|
-
"test:e2e": "vitest --run --project e2e",
|
|
79
|
-
"test:transit": "exit 0",
|
|
80
76
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"test:watch": "vitest --watch --project unit",
|
|
82
77
|
"typecheck:transit": "exit 0",
|
|
83
78
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
84
|
-
"
|
|
79
|
+
"test:watch": "vitest --watch --project unit",
|
|
80
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test": "vitest --run --project unit",
|
|
83
|
+
"test:e2e": "vitest --run --project e2e",
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|