@openrouter/sdk 1.2.84 → 1.2.86
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/costdetails.d.ts +4 -0
- package/esm/models/costdetails.js +2 -0
- package/esm/models/openresponsesresult.d.ts +4 -0
- package/esm/models/openresponsesresult.js +2 -0
- package/esm/models/outputcustomtoolcallitem.d.ts +13 -1
- package/esm/models/outputcustomtoolcallitem.js +12 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
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.2.
|
|
53
|
+
readonly sdkVersion: "1.2.86";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.86 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.
|
|
32
|
+
sdkVersion: "1.2.86",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.86 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -5,6 +5,10 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
* Breakdown of upstream inference costs
|
|
6
6
|
*/
|
|
7
7
|
export type CostDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.
|
|
10
|
+
*/
|
|
11
|
+
serverToolCost?: number | null | undefined;
|
|
8
12
|
upstreamInferenceCompletionsCost: number;
|
|
9
13
|
upstreamInferenceCost?: number | null | undefined;
|
|
10
14
|
upstreamInferencePromptCost: number;
|
|
@@ -8,11 +8,13 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const CostDetails$inboundSchema = z
|
|
10
10
|
.object({
|
|
11
|
+
server_tool_cost: z.nullable(z.number()).optional(),
|
|
11
12
|
upstream_inference_completions_cost: z.number(),
|
|
12
13
|
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
13
14
|
upstream_inference_prompt_cost: z.number(),
|
|
14
15
|
}).transform((v) => {
|
|
15
16
|
return remap$(v, {
|
|
17
|
+
"server_tool_cost": "serverToolCost",
|
|
16
18
|
"upstream_inference_completions_cost": "upstreamInferenceCompletionsCost",
|
|
17
19
|
"upstream_inference_cost": "upstreamInferenceCost",
|
|
18
20
|
"upstream_inference_prompt_cost": "upstreamInferencePromptCost",
|
|
@@ -88,6 +88,10 @@ export type OutputTokensDetails = {
|
|
|
88
88
|
reasoningTokens: number;
|
|
89
89
|
};
|
|
90
90
|
export type UsageCostDetails = {
|
|
91
|
+
/**
|
|
92
|
+
* Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.
|
|
93
|
+
*/
|
|
94
|
+
serverToolCost?: number | null | undefined;
|
|
91
95
|
upstreamInferenceCost?: number | null | undefined;
|
|
92
96
|
upstreamInferenceInputCost: number;
|
|
93
97
|
upstreamInferenceOutputCost: number;
|
|
@@ -102,11 +102,13 @@ export function outputTokensDetailsFromJSON(jsonString) {
|
|
|
102
102
|
}
|
|
103
103
|
/** @internal */
|
|
104
104
|
export const UsageCostDetails$inboundSchema = z.object({
|
|
105
|
+
server_tool_cost: z.nullable(z.number()).optional(),
|
|
105
106
|
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
106
107
|
upstream_inference_input_cost: z.number(),
|
|
107
108
|
upstream_inference_output_cost: z.number(),
|
|
108
109
|
}).transform((v) => {
|
|
109
110
|
return remap$(v, {
|
|
111
|
+
"server_tool_cost": "serverToolCost",
|
|
110
112
|
"upstream_inference_cost": "upstreamInferenceCost",
|
|
111
113
|
"upstream_inference_input_cost": "upstreamInferenceInputCost",
|
|
112
114
|
"upstream_inference_output_cost": "upstreamInferenceOutputCost",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OutputCustomToolCallItemStatus: {
|
|
6
|
+
readonly InProgress: "in_progress";
|
|
7
|
+
readonly Completed: "completed";
|
|
8
|
+
readonly Incomplete: "incomplete";
|
|
9
|
+
};
|
|
10
|
+
export type OutputCustomToolCallItemStatus = OpenEnum<typeof OutputCustomToolCallItemStatus>;
|
|
5
11
|
export declare const OutputCustomToolCallItemType: {
|
|
6
12
|
readonly CustomToolCall: "custom_tool_call";
|
|
7
13
|
};
|
|
@@ -18,9 +24,14 @@ export type OutputCustomToolCallItem = {
|
|
|
18
24
|
* Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
|
|
19
25
|
*/
|
|
20
26
|
namespace?: string | undefined;
|
|
27
|
+
status?: OutputCustomToolCallItemStatus | undefined;
|
|
21
28
|
type: OutputCustomToolCallItemType;
|
|
22
29
|
};
|
|
23
30
|
/** @internal */
|
|
31
|
+
export declare const OutputCustomToolCallItemStatus$inboundSchema: z.ZodType<OutputCustomToolCallItemStatus, unknown>;
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const OutputCustomToolCallItemStatus$outboundSchema: z.ZodType<string, OutputCustomToolCallItemStatus>;
|
|
34
|
+
/** @internal */
|
|
24
35
|
export declare const OutputCustomToolCallItemType$inboundSchema: z.ZodEnum<typeof OutputCustomToolCallItemType>;
|
|
25
36
|
/** @internal */
|
|
26
37
|
export declare const OutputCustomToolCallItemType$outboundSchema: z.ZodEnum<typeof OutputCustomToolCallItemType>;
|
|
@@ -33,6 +44,7 @@ export type OutputCustomToolCallItem$Outbound = {
|
|
|
33
44
|
input: string;
|
|
34
45
|
name: string;
|
|
35
46
|
namespace?: string | undefined;
|
|
47
|
+
status?: string | undefined;
|
|
36
48
|
type: string;
|
|
37
49
|
};
|
|
38
50
|
/** @internal */
|
|
@@ -5,10 +5,20 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
export const OutputCustomToolCallItemStatus = {
|
|
10
|
+
InProgress: "in_progress",
|
|
11
|
+
Completed: "completed",
|
|
12
|
+
Incomplete: "incomplete",
|
|
13
|
+
};
|
|
8
14
|
export const OutputCustomToolCallItemType = {
|
|
9
15
|
CustomToolCall: "custom_tool_call",
|
|
10
16
|
};
|
|
11
17
|
/** @internal */
|
|
18
|
+
export const OutputCustomToolCallItemStatus$inboundSchema = openEnums.inboundSchema(OutputCustomToolCallItemStatus);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const OutputCustomToolCallItemStatus$outboundSchema = openEnums.outboundSchema(OutputCustomToolCallItemStatus);
|
|
21
|
+
/** @internal */
|
|
12
22
|
export const OutputCustomToolCallItemType$inboundSchema = z.enum(OutputCustomToolCallItemType);
|
|
13
23
|
/** @internal */
|
|
14
24
|
export const OutputCustomToolCallItemType$outboundSchema = OutputCustomToolCallItemType$inboundSchema;
|
|
@@ -19,6 +29,7 @@ export const OutputCustomToolCallItem$inboundSchema = z.object({
|
|
|
19
29
|
input: z.string(),
|
|
20
30
|
name: z.string(),
|
|
21
31
|
namespace: z.string().optional(),
|
|
32
|
+
status: OutputCustomToolCallItemStatus$inboundSchema.optional(),
|
|
22
33
|
type: OutputCustomToolCallItemType$inboundSchema,
|
|
23
34
|
}).transform((v) => {
|
|
24
35
|
return remap$(v, {
|
|
@@ -32,6 +43,7 @@ export const OutputCustomToolCallItem$outboundSchema = z.object({
|
|
|
32
43
|
input: z.string(),
|
|
33
44
|
name: z.string(),
|
|
34
45
|
namespace: z.string().optional(),
|
|
46
|
+
status: OutputCustomToolCallItemStatus$outboundSchema.optional(),
|
|
35
47
|
type: OutputCustomToolCallItemType$outboundSchema,
|
|
36
48
|
}).transform((v) => {
|
|
37
49
|
return remap$(v, {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.86",
|
|
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
|
-
"
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
76
|
+
"test": "vitest --run --project unit",
|
|
78
77
|
"test:e2e": "vitest --run --project e2e",
|
|
78
|
+
"test:watch": "vitest --watch --project unit",
|
|
79
79
|
"typecheck": "tsc --noEmit",
|
|
80
|
+
"typecheck:transit": "exit 0",
|
|
80
81
|
"compile": "tsc",
|
|
81
|
-
"prepare": "npm run build",
|
|
82
|
-
"test": "vitest --run --project unit",
|
|
83
82
|
"test:transit": "exit 0",
|
|
84
|
-
"
|
|
83
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|