@openrouter/sdk 0.13.7 → 0.13.13
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/README.md +3 -9
- package/esm/funcs/benchmarksGetBenchmarks.d.ts +19 -0
- package/esm/funcs/{datasetsGetBenchmarksDesignArena.js → benchmarksGetBenchmarks.js} +11 -10
- package/esm/funcs/classificationsGetTaskClassifications.d.ts +37 -0
- package/esm/funcs/classificationsGetTaskClassifications.js +119 -0
- package/esm/funcs/imagesGenerate.d.ts +30 -0
- package/esm/funcs/imagesGenerate.js +95 -0
- package/esm/funcs/imagesListModelEndpoints.d.ts +19 -0
- package/esm/funcs/imagesListModelEndpoints.js +107 -0
- package/esm/funcs/{datasetsGetBenchmarksDesignArena.d.ts → imagesListModels.d.ts} +4 -4
- package/esm/funcs/{datasetsGetBenchmarksArtificialAnalysis.js → imagesListModels.js} +10 -15
- package/esm/funcs/workspacesDeleteBudget.d.ts +19 -0
- package/esm/funcs/workspacesDeleteBudget.js +107 -0
- package/esm/funcs/workspacesListBudgets.d.ts +19 -0
- package/esm/funcs/workspacesListBudgets.js +103 -0
- package/esm/funcs/workspacesSetBudget.d.ts +19 -0
- package/esm/funcs/workspacesSetBudget.js +110 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/advisorreasoning.d.ts +1 -0
- package/esm/models/advisorreasoning.js +1 -0
- package/esm/models/anthropicadvisormessageusageiteration.d.ts +24 -0
- package/esm/models/anthropicadvisormessageusageiteration.js +36 -0
- package/esm/models/anthropiccompactionusageiteration.d.ts +23 -0
- package/esm/models/anthropiccompactionusageiteration.js +35 -0
- package/esm/models/anthropicdocumentblockparam.d.ts +5 -4
- package/esm/models/anthropicdocumentblockparam.js +3 -0
- package/esm/models/anthropicfiledocumentsource.d.ts +14 -0
- package/esm/models/anthropicfiledocumentsource.js +19 -0
- package/esm/models/anthropiciterationcachecreation.d.ts +11 -0
- package/esm/models/anthropiciterationcachecreation.js +21 -0
- package/esm/models/anthropicmessageusageiteration.d.ts +24 -0
- package/esm/models/anthropicmessageusageiteration.js +36 -0
- package/esm/models/anthropicspeed.d.ts +10 -0
- package/esm/models/anthropicspeed.js +12 -0
- package/esm/models/anthropicunknownusageiteration.d.ts +16 -0
- package/esm/models/anthropicunknownusageiteration.js +30 -0
- package/esm/models/anthropicusageiteration.d.ts +12 -0
- package/esm/models/anthropicusageiteration.js +21 -0
- package/esm/models/apierrortype.d.ts +41 -0
- package/esm/models/apierrortype.js +40 -0
- package/esm/models/booleancapability.d.ts +13 -0
- package/esm/models/booleancapability.js +14 -0
- package/esm/models/byokproviderslug.d.ts +3 -0
- package/esm/models/byokproviderslug.js +3 -0
- package/esm/models/capabilitydescriptor.d.ts +15 -0
- package/esm/models/capabilitydescriptor.js +19 -0
- package/esm/models/chatrequest.d.ts +2 -0
- package/esm/models/chatrequest.js +2 -0
- package/esm/models/chatstreamchunk.d.ts +25 -4
- package/esm/models/chatstreamchunk.js +19 -4
- package/esm/models/chatusage.d.ts +32 -8
- package/esm/models/chatusage.js +25 -8
- package/esm/models/chatwebsearchshorthand.d.ts +1 -1
- package/esm/models/contentpartimage.d.ts +9 -2
- package/esm/models/contentpartimage.js +6 -1
- package/esm/models/debugevent.d.ts +42 -0
- package/esm/models/debugevent.js +58 -0
- package/esm/models/deleteworkspacebudgetresponse.d.ts +13 -0
- package/esm/models/deleteworkspacebudgetresponse.js +14 -0
- package/esm/models/enumcapability.d.ts +14 -0
- package/esm/models/enumcapability.js +15 -0
- package/esm/models/fusionplugin.d.ts +1 -0
- package/esm/models/fusionplugin.js +1 -0
- package/esm/models/fusionservertoolconfig.d.ts +8 -1
- package/esm/models/fusionservertoolconfig.js +4 -0
- package/esm/models/imageendpoint.d.ts +41 -0
- package/esm/models/imageendpoint.js +33 -0
- package/esm/models/imagegencompletedevent.d.ts +29 -0
- package/esm/models/imagegencompletedevent.js +23 -0
- package/esm/models/imagegenerationrequest.d.ts +908 -0
- package/esm/models/imagegenerationrequest.js +266 -0
- package/esm/models/imagegenerationresponse.d.ts +34 -0
- package/esm/models/imagegenerationresponse.js +29 -0
- package/esm/models/imagegenerationservertool.d.ts +15 -15
- package/esm/models/imagegenerationservertool.js +15 -17
- package/esm/models/imagegenerationusage.d.ts +119 -0
- package/esm/models/imagegenerationusage.js +93 -0
- package/esm/models/imagegenpartialimageevent.d.ts +24 -0
- package/esm/models/imagegenpartialimageevent.js +22 -0
- package/esm/models/imagegenstreamerrorevent.d.ts +44 -0
- package/esm/models/imagegenstreamerrorevent.js +25 -0
- package/esm/models/imagemodelarchitecture.d.ts +19 -0
- package/esm/models/imagemodelarchitecture.js +23 -0
- package/esm/models/imagemodelendpointsresponse.d.ts +18 -0
- package/esm/models/imagemodelendpointsresponse.js +16 -0
- package/esm/models/imagemodellistitem.d.ts +42 -0
- package/esm/models/imagemodellistitem.js +29 -0
- package/esm/models/imagemodelslistresponse.d.ts +14 -0
- package/esm/models/imagemodelslistresponse.js +15 -0
- package/esm/models/imageoutputmodality.d.ts +16 -0
- package/esm/models/imageoutputmodality.js +18 -0
- package/esm/models/imagepricingentry.d.ts +35 -0
- package/esm/models/imagepricingentry.js +41 -0
- package/esm/models/imagestreamingresponse.d.ts +18 -0
- package/esm/models/imagestreamingresponse.js +43 -0
- package/esm/models/index.d.ts +44 -7
- package/esm/models/index.js +44 -7
- package/esm/models/inputreference.d.ts +6 -2
- package/esm/models/inputreference.js +1 -1
- package/esm/models/legacywebsearchservertool.d.ts +1 -1
- package/esm/models/listworkspacebudgetsresponse.d.ts +14 -0
- package/esm/models/listworkspacebudgetsresponse.js +15 -0
- package/esm/models/messagesrequest.d.ts +6 -6
- package/esm/models/messagesrequest.js +4 -5
- package/esm/models/model.d.ts +5 -0
- package/esm/models/model.js +2 -0
- package/esm/models/modelreasoning.d.ts +49 -0
- package/esm/models/modelreasoning.js +42 -0
- package/esm/models/observabilityarizedestination.d.ts +3 -0
- package/esm/models/openresponsesresult.d.ts +5 -0
- package/esm/models/openresponsesresult.js +3 -0
- package/esm/models/operations/createembeddings.d.ts +19 -0
- package/esm/models/operations/createembeddings.js +20 -0
- package/esm/models/operations/createimages.d.ts +63 -0
- package/esm/models/operations/createimages.js +44 -0
- package/esm/models/operations/{getbenchmarksartificialanalysis.d.ts → deleteworkspacebudget.d.ts} +15 -9
- package/esm/models/operations/deleteworkspacebudget.js +23 -0
- package/esm/models/operations/getbenchmarks.d.ts +120 -0
- package/esm/models/operations/getbenchmarks.js +60 -0
- package/esm/models/operations/getmodels.d.ts +5 -3
- package/esm/models/operations/getmodels.js +3 -1
- package/esm/models/operations/{getbenchmarksdesignarena.d.ts → gettaskclassifications.d.ts} +16 -28
- package/esm/models/operations/gettaskclassifications.js +29 -0
- package/esm/models/operations/index.d.ts +8 -2
- package/esm/models/operations/index.js +8 -2
- package/esm/models/operations/listbyokkeys.d.ts +3 -0
- package/esm/models/operations/listbyokkeys.js +3 -0
- package/esm/models/operations/listimagemodelendpoints.d.ts +63 -0
- package/esm/models/operations/listimagemodelendpoints.js +22 -0
- package/esm/models/operations/listimagemodels.d.ts +53 -0
- package/esm/models/operations/listimagemodels.js +20 -0
- package/esm/models/operations/listworkspacebudgets.d.ts +58 -0
- package/esm/models/operations/listworkspacebudgets.js +21 -0
- package/esm/models/operations/queryanalytics.d.ts +7 -3
- package/esm/models/operations/queryanalytics.js +1 -0
- package/esm/models/operations/upsertworkspacebudget.d.ts +66 -0
- package/esm/models/operations/upsertworkspacebudget.js +25 -0
- package/esm/models/preview20250311websearchservertool.d.ts +1 -1
- package/esm/models/previewwebsearchservertool.d.ts +1 -1
- package/esm/models/providername.d.ts +3 -0
- package/esm/models/providername.js +3 -0
- package/esm/models/provideroptions.d.ts +19 -1
- package/esm/models/provideroptions.js +5 -0
- package/esm/models/providerresponse.d.ts +3 -0
- package/esm/models/providerresponse.js +3 -0
- package/esm/models/rangecapability.d.ts +15 -0
- package/esm/models/rangecapability.js +16 -0
- package/esm/models/reasoningeffort.d.ts +1 -0
- package/esm/models/reasoningeffort.js +1 -0
- package/esm/models/responsesrequest.d.ts +6 -0
- package/esm/models/responsesrequest.js +2 -0
- package/esm/models/speechrequest.d.ts +1 -1
- package/esm/models/streamevents.d.ts +2 -1
- package/esm/models/streamevents.js +2 -0
- package/esm/models/sttrequest.d.ts +1 -1
- package/esm/models/subagentreasoning.d.ts +1 -0
- package/esm/models/subagentreasoning.js +1 -0
- package/esm/models/taskclassificationitem.d.ts +42 -0
- package/esm/models/taskclassificationitem.js +32 -0
- package/esm/models/taskclassificationmacrocategory.d.ts +25 -0
- package/esm/models/taskclassificationmacrocategory.js +23 -0
- package/esm/models/taskclassificationmodel.d.ts +21 -0
- package/esm/models/taskclassificationmodel.js +22 -0
- package/esm/models/taskclassificationresponse.d.ts +33 -0
- package/esm/models/taskclassificationresponse.js +33 -0
- package/esm/models/{benchmarkpricing.d.ts → unifiedbenchmarkpricing.d.ts} +4 -4
- package/esm/models/unifiedbenchmarkpricing.js +15 -0
- package/esm/models/{benchmarksaaitem.d.ts → unifiedbenchmarksaaitem.d.ts} +14 -10
- package/esm/models/unifiedbenchmarksaaitem.js +30 -0
- package/esm/models/{benchmarksdaitem.d.ts → unifiedbenchmarksdaitem.d.ts} +11 -7
- package/esm/models/{benchmarksdaitem.js → unifiedbenchmarksdaitem.js} +8 -7
- package/esm/models/unifiedbenchmarksmeta.d.ts +63 -0
- package/esm/models/unifiedbenchmarksmeta.js +46 -0
- package/esm/models/unifiedbenchmarksresponse.d.ts +19 -0
- package/esm/models/unifiedbenchmarksresponse.js +30 -0
- package/esm/models/upsertworkspacebudgetrequest.d.ts +15 -0
- package/esm/models/upsertworkspacebudgetrequest.js +18 -0
- package/esm/models/upsertworkspacebudgetresponse.d.ts +11 -0
- package/esm/models/upsertworkspacebudgetresponse.js +15 -0
- package/esm/models/videogenerationrequest.d.ts +33 -15
- package/esm/models/videogenerationrequest.js +16 -11
- package/esm/models/websearchconfig.d.ts +1 -1
- package/esm/models/websearchservertool.d.ts +1 -1
- package/esm/models/websearchservertoolconfig.d.ts +1 -1
- package/esm/models/workspacebudget.d.ts +48 -0
- package/esm/models/workspacebudget.js +39 -0
- package/esm/models/workspacebudgetinterval.d.ts +18 -0
- package/esm/models/workspacebudgetinterval.js +17 -0
- package/esm/sdk/benchmarks.d.ts +13 -0
- package/esm/sdk/benchmarks.js +19 -0
- package/esm/sdk/classifications.d.ts +31 -0
- package/esm/sdk/classifications.js +37 -0
- package/esm/sdk/datasets.d.ts +0 -14
- package/esm/sdk/datasets.js +0 -20
- package/esm/sdk/images.d.ts +38 -0
- package/esm/sdk/images.js +33 -0
- package/esm/sdk/sdk.d.ts +9 -0
- package/esm/sdk/sdk.js +12 -0
- package/esm/sdk/workspaces.d.ts +21 -0
- package/esm/sdk/workspaces.js +30 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
- package/esm/funcs/datasetsGetBenchmarksArtificialAnalysis.d.ts +0 -19
- package/esm/models/benchmarkpricing.js +0 -15
- package/esm/models/benchmarksaaitem.js +0 -29
- package/esm/models/benchmarksaameta.d.ts +0 -70
- package/esm/models/benchmarksaameta.js +0 -50
- package/esm/models/benchmarksaaresponse.d.ts +0 -13
- package/esm/models/benchmarksaaresponse.js +0 -17
- package/esm/models/benchmarksdameta.d.ts +0 -98
- package/esm/models/benchmarksdameta.js +0 -62
- package/esm/models/benchmarksdaresponse.d.ts +0 -13
- package/esm/models/benchmarksdaresponse.js +0 -17
- package/esm/models/operations/getbenchmarksartificialanalysis.js +0 -22
- package/esm/models/operations/getbenchmarksdesignarena.js +0 -36
package/esm/models/chatusage.js
CHANGED
|
@@ -7,7 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { CostDetails$inboundSchema } from "./costdetails.js";
|
|
9
9
|
/** @internal */
|
|
10
|
-
export const
|
|
10
|
+
export const ChatUsageCompletionTokensDetails$inboundSchema = z.object({
|
|
11
11
|
accepted_prediction_tokens: z.nullable(z.int()).optional(),
|
|
12
12
|
audio_tokens: z.nullable(z.int()).optional(),
|
|
13
13
|
reasoning_tokens: z.nullable(z.int()).optional(),
|
|
@@ -20,11 +20,11 @@ export const CompletionTokensDetails$inboundSchema = z.object({
|
|
|
20
20
|
"rejected_prediction_tokens": "rejectedPredictionTokens",
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
|
-
export function
|
|
24
|
-
return safeParse(jsonString, (x) =>
|
|
23
|
+
export function chatUsageCompletionTokensDetailsFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => ChatUsageCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatUsageCompletionTokensDetails' from JSON`);
|
|
25
25
|
}
|
|
26
26
|
/** @internal */
|
|
27
|
-
export const
|
|
27
|
+
export const ChatUsagePromptTokensDetails$inboundSchema = z.object({
|
|
28
28
|
audio_tokens: z.int().optional(),
|
|
29
29
|
cache_write_tokens: z.int().optional(),
|
|
30
30
|
cached_tokens: z.int().optional(),
|
|
@@ -37,18 +37,34 @@ export const PromptTokensDetails$inboundSchema = z.object({
|
|
|
37
37
|
"video_tokens": "videoTokens",
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
export function
|
|
41
|
-
return safeParse(jsonString, (x) =>
|
|
40
|
+
export function chatUsagePromptTokensDetailsFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => ChatUsagePromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatUsagePromptTokensDetails' from JSON`);
|
|
42
|
+
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const ServerToolUseDetails$inboundSchema = z.object({
|
|
45
|
+
tool_calls_executed: z.nullable(z.int()).optional(),
|
|
46
|
+
tool_calls_requested: z.nullable(z.int()).optional(),
|
|
47
|
+
web_search_requests: z.nullable(z.int()).optional(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"tool_calls_executed": "toolCallsExecuted",
|
|
51
|
+
"tool_calls_requested": "toolCallsRequested",
|
|
52
|
+
"web_search_requests": "webSearchRequests",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
export function serverToolUseDetailsFromJSON(jsonString) {
|
|
56
|
+
return safeParse(jsonString, (x) => ServerToolUseDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolUseDetails' from JSON`);
|
|
42
57
|
}
|
|
43
58
|
/** @internal */
|
|
44
59
|
export const ChatUsage$inboundSchema = z.object({
|
|
45
60
|
completion_tokens: z.int(),
|
|
46
|
-
completion_tokens_details: z.nullable(z.lazy(() =>
|
|
61
|
+
completion_tokens_details: z.nullable(z.lazy(() => ChatUsageCompletionTokensDetails$inboundSchema)).optional(),
|
|
47
62
|
cost: z.nullable(z.number()).optional(),
|
|
48
63
|
cost_details: z.nullable(CostDetails$inboundSchema).optional(),
|
|
49
64
|
is_byok: z.boolean().optional(),
|
|
50
65
|
prompt_tokens: z.int(),
|
|
51
|
-
prompt_tokens_details: z.nullable(z.lazy(() =>
|
|
66
|
+
prompt_tokens_details: z.nullable(z.lazy(() => ChatUsagePromptTokensDetails$inboundSchema)).optional(),
|
|
67
|
+
server_tool_use_details: z.nullable(z.lazy(() => ServerToolUseDetails$inboundSchema)).optional(),
|
|
52
68
|
total_tokens: z.int(),
|
|
53
69
|
}).transform((v) => {
|
|
54
70
|
return remap$(v, {
|
|
@@ -58,6 +74,7 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
58
74
|
"is_byok": "isByok",
|
|
59
75
|
"prompt_tokens": "promptTokens",
|
|
60
76
|
"prompt_tokens_details": "promptTokensDetails",
|
|
77
|
+
"server_tool_use_details": "serverToolUseDetails",
|
|
61
78
|
"total_tokens": "totalTokens",
|
|
62
79
|
});
|
|
63
80
|
});
|
|
@@ -32,7 +32,7 @@ export type ChatWebSearchShorthand = {
|
|
|
32
32
|
*/
|
|
33
33
|
maxCharacters?: number | undefined;
|
|
34
34
|
/**
|
|
35
|
-
* Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search.
|
|
35
|
+
* Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.
|
|
36
36
|
*/
|
|
37
37
|
maxResults?: number | undefined;
|
|
38
38
|
/**
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
export type ContentPartImageImageUrl = {
|
|
3
4
|
url: string;
|
|
4
5
|
};
|
|
6
|
+
export declare const ContentPartImageType: {
|
|
7
|
+
readonly ImageUrl: "image_url";
|
|
8
|
+
};
|
|
9
|
+
export type ContentPartImageType = ClosedEnum<typeof ContentPartImageType>;
|
|
5
10
|
export type ContentPartImage = {
|
|
6
11
|
imageUrl: ContentPartImageImageUrl;
|
|
7
|
-
type:
|
|
12
|
+
type: ContentPartImageType;
|
|
8
13
|
};
|
|
9
14
|
/** @internal */
|
|
10
15
|
export type ContentPartImageImageUrl$Outbound = {
|
|
@@ -14,9 +19,11 @@ export type ContentPartImageImageUrl$Outbound = {
|
|
|
14
19
|
export declare const ContentPartImageImageUrl$outboundSchema: z.ZodType<ContentPartImageImageUrl$Outbound, ContentPartImageImageUrl>;
|
|
15
20
|
export declare function contentPartImageImageUrlToJSON(contentPartImageImageUrl: ContentPartImageImageUrl): string;
|
|
16
21
|
/** @internal */
|
|
22
|
+
export declare const ContentPartImageType$outboundSchema: z.ZodEnum<typeof ContentPartImageType>;
|
|
23
|
+
/** @internal */
|
|
17
24
|
export type ContentPartImage$Outbound = {
|
|
18
25
|
image_url: ContentPartImageImageUrl$Outbound;
|
|
19
|
-
type:
|
|
26
|
+
type: string;
|
|
20
27
|
};
|
|
21
28
|
/** @internal */
|
|
22
29
|
export declare const ContentPartImage$outboundSchema: z.ZodType<ContentPartImage$Outbound, ContentPartImage>;
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
export const ContentPartImageType = {
|
|
8
|
+
ImageUrl: "image_url",
|
|
9
|
+
};
|
|
7
10
|
/** @internal */
|
|
8
11
|
export const ContentPartImageImageUrl$outboundSchema = z.object({
|
|
9
12
|
url: z.string(),
|
|
@@ -12,9 +15,11 @@ export function contentPartImageImageUrlToJSON(contentPartImageImageUrl) {
|
|
|
12
15
|
return JSON.stringify(ContentPartImageImageUrl$outboundSchema.parse(contentPartImageImageUrl));
|
|
13
16
|
}
|
|
14
17
|
/** @internal */
|
|
18
|
+
export const ContentPartImageType$outboundSchema = z.enum(ContentPartImageType);
|
|
19
|
+
/** @internal */
|
|
15
20
|
export const ContentPartImage$outboundSchema = z.object({
|
|
16
21
|
imageUrl: z.lazy(() => ContentPartImageImageUrl$outboundSchema),
|
|
17
|
-
type:
|
|
22
|
+
type: ContentPartImageType$outboundSchema,
|
|
18
23
|
}).transform((v) => {
|
|
19
24
|
return remap$(v, {
|
|
20
25
|
imageUrl: "image_url",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const Event: {
|
|
6
|
+
readonly AdapterRequest: "adapter_request";
|
|
7
|
+
readonly UpstreamHeadersReceived: "upstream_headers_received";
|
|
8
|
+
readonly FirstTokenReceived: "first_token_received";
|
|
9
|
+
readonly UpstreamBodyEnded: "upstream_body_ended";
|
|
10
|
+
};
|
|
11
|
+
export type Event = OpenEnum<typeof Event>;
|
|
12
|
+
export type Timings = {
|
|
13
|
+
epochMs: number;
|
|
14
|
+
event: Event;
|
|
15
|
+
startMs: number;
|
|
16
|
+
};
|
|
17
|
+
export type Debug = {
|
|
18
|
+
echoUpstreamBody?: {
|
|
19
|
+
[k: string]: any | null;
|
|
20
|
+
} | undefined;
|
|
21
|
+
timings?: Timings | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.
|
|
25
|
+
*/
|
|
26
|
+
export type DebugEvent = {
|
|
27
|
+
debug: Debug;
|
|
28
|
+
sequenceNumber: number;
|
|
29
|
+
type: "response.debug";
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const Event$inboundSchema: z.ZodType<Event, unknown>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const Timings$inboundSchema: z.ZodType<Timings, unknown>;
|
|
35
|
+
export declare function timingsFromJSON(jsonString: string): SafeParseResult<Timings, SDKValidationError>;
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const Debug$inboundSchema: z.ZodType<Debug, unknown>;
|
|
38
|
+
export declare function debugFromJSON(jsonString: string): SafeParseResult<Debug, SDKValidationError>;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const DebugEvent$inboundSchema: z.ZodType<DebugEvent, unknown>;
|
|
41
|
+
export declare function debugEventFromJSON(jsonString: string): SafeParseResult<DebugEvent, SDKValidationError>;
|
|
42
|
+
//# sourceMappingURL=debugevent.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8afa2111f54c
|
|
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 * as openEnums from "../types/enums.js";
|
|
9
|
+
export const Event = {
|
|
10
|
+
AdapterRequest: "adapter_request",
|
|
11
|
+
UpstreamHeadersReceived: "upstream_headers_received",
|
|
12
|
+
FirstTokenReceived: "first_token_received",
|
|
13
|
+
UpstreamBodyEnded: "upstream_body_ended",
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const Event$inboundSchema = openEnums
|
|
17
|
+
.inboundSchema(Event);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Timings$inboundSchema = z.object({
|
|
20
|
+
epoch_ms: z.int(),
|
|
21
|
+
event: Event$inboundSchema,
|
|
22
|
+
start_ms: z.int(),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
"epoch_ms": "epochMs",
|
|
26
|
+
"start_ms": "startMs",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
export function timingsFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => Timings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Timings' from JSON`);
|
|
31
|
+
}
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const Debug$inboundSchema = z.object({
|
|
34
|
+
echo_upstream_body: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
35
|
+
timings: z.lazy(() => Timings$inboundSchema).optional(),
|
|
36
|
+
}).transform((v) => {
|
|
37
|
+
return remap$(v, {
|
|
38
|
+
"echo_upstream_body": "echoUpstreamBody",
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export function debugFromJSON(jsonString) {
|
|
42
|
+
return safeParse(jsonString, (x) => Debug$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Debug' from JSON`);
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const DebugEvent$inboundSchema = z
|
|
46
|
+
.object({
|
|
47
|
+
debug: z.lazy(() => Debug$inboundSchema),
|
|
48
|
+
sequence_number: z.int(),
|
|
49
|
+
type: z.literal("response.debug"),
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
"sequence_number": "sequenceNumber",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
export function debugEventFromJSON(jsonString) {
|
|
56
|
+
return safeParse(jsonString, (x) => DebugEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DebugEvent' from JSON`);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=debugevent.js.map
|
|
@@ -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
|
+
export type DeleteWorkspaceBudgetResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* Confirmation that the budget was deleted (or did not exist)
|
|
7
|
+
*/
|
|
8
|
+
deleted: true;
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const DeleteWorkspaceBudgetResponse$inboundSchema: z.ZodType<DeleteWorkspaceBudgetResponse, unknown>;
|
|
12
|
+
export declare function deleteWorkspaceBudgetResponseFromJSON(jsonString: string): SafeParseResult<DeleteWorkspaceBudgetResponse, SDKValidationError>;
|
|
13
|
+
//# sourceMappingURL=deleteworkspacebudgetresponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: abfb4f8daac9
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DeleteWorkspaceBudgetResponse$inboundSchema = z.object({
|
|
9
|
+
deleted: z.literal(true),
|
|
10
|
+
});
|
|
11
|
+
export function deleteWorkspaceBudgetResponseFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => DeleteWorkspaceBudgetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteWorkspaceBudgetResponse' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=deleteworkspacebudgetresponse.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
* A parameter that accepts one of a discrete set of string values.
|
|
6
|
+
*/
|
|
7
|
+
export type EnumCapability = {
|
|
8
|
+
type: "enum";
|
|
9
|
+
values: Array<string>;
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const EnumCapability$inboundSchema: z.ZodType<EnumCapability, unknown>;
|
|
13
|
+
export declare function enumCapabilityFromJSON(jsonString: string): SafeParseResult<EnumCapability, SDKValidationError>;
|
|
14
|
+
//# sourceMappingURL=enumcapability.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5ad7989f6f99
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const EnumCapability$inboundSchema = z.object({
|
|
9
|
+
type: z.literal("enum"),
|
|
10
|
+
values: z.array(z.string()),
|
|
11
|
+
});
|
|
12
|
+
export function enumCapabilityFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => EnumCapability$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnumCapability' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=enumcapability.js.map
|
|
@@ -6,6 +6,7 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
6
6
|
export declare const PresetEnum: {
|
|
7
7
|
readonly GeneralHigh: "general-high";
|
|
8
8
|
readonly GeneralBudget: "general-budget";
|
|
9
|
+
readonly GeneralFast: "general-fast";
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.
|
|
@@ -11,6 +11,7 @@ import * as openEnums from "../types/enums.js";
|
|
|
11
11
|
export const PresetEnum = {
|
|
12
12
|
GeneralHigh: "general-high",
|
|
13
13
|
GeneralBudget: "general-budget",
|
|
14
|
+
GeneralFast: "general-fast",
|
|
14
15
|
};
|
|
15
16
|
/** @internal */
|
|
16
17
|
export const PresetEnum$outboundSchema = openEnums.outboundSchema(PresetEnum);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
3
4
|
/**
|
|
4
5
|
* Reasoning effort level for panelist and judge inner calls.
|
|
5
6
|
*/
|
|
6
7
|
export declare const FusionServerToolConfigEffort: {
|
|
8
|
+
readonly Max: "max";
|
|
7
9
|
readonly Xhigh: "xhigh";
|
|
8
10
|
readonly High: "high";
|
|
9
11
|
readonly Medium: "medium";
|
|
@@ -48,6 +50,10 @@ export type FusionServerToolConfig = {
|
|
|
48
50
|
* Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.
|
|
49
51
|
*/
|
|
50
52
|
analysisModels?: Array<string> | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
|
|
55
|
+
*/
|
|
56
|
+
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
51
57
|
/**
|
|
52
58
|
* Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies.
|
|
53
59
|
*/
|
|
@@ -65,7 +71,7 @@ export type FusionServerToolConfig = {
|
|
|
65
71
|
*/
|
|
66
72
|
reasoning?: FusionServerToolConfigReasoning | undefined;
|
|
67
73
|
/**
|
|
68
|
-
*
|
|
74
|
+
* Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.
|
|
69
75
|
*/
|
|
70
76
|
temperature?: number | undefined;
|
|
71
77
|
/**
|
|
@@ -96,6 +102,7 @@ export declare function fusionServerToolConfigToolToJSON(fusionServerToolConfigT
|
|
|
96
102
|
/** @internal */
|
|
97
103
|
export type FusionServerToolConfig$Outbound = {
|
|
98
104
|
analysis_models?: Array<string> | undefined;
|
|
105
|
+
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
99
106
|
max_completion_tokens?: number | undefined;
|
|
100
107
|
max_tool_calls?: number | undefined;
|
|
101
108
|
model?: string | undefined;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
8
9
|
/**
|
|
9
10
|
* Reasoning effort level for panelist and judge inner calls.
|
|
10
11
|
*/
|
|
11
12
|
export const FusionServerToolConfigEffort = {
|
|
13
|
+
Max: "max",
|
|
12
14
|
Xhigh: "xhigh",
|
|
13
15
|
High: "high",
|
|
14
16
|
Medium: "medium",
|
|
@@ -41,6 +43,7 @@ export function fusionServerToolConfigToolToJSON(fusionServerToolConfigTool) {
|
|
|
41
43
|
/** @internal */
|
|
42
44
|
export const FusionServerToolConfig$outboundSchema = z.object({
|
|
43
45
|
analysisModels: z.array(z.string()).optional(),
|
|
46
|
+
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
44
47
|
maxCompletionTokens: z.int().optional(),
|
|
45
48
|
maxToolCalls: z.int().optional(),
|
|
46
49
|
model: z.string().optional(),
|
|
@@ -52,6 +55,7 @@ export const FusionServerToolConfig$outboundSchema = z.object({
|
|
|
52
55
|
}).transform((v) => {
|
|
53
56
|
return remap$(v, {
|
|
54
57
|
analysisModels: "analysis_models",
|
|
58
|
+
cacheControl: "cache_control",
|
|
55
59
|
maxCompletionTokens: "max_completion_tokens",
|
|
56
60
|
maxToolCalls: "max_tool_calls",
|
|
57
61
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { CapabilityDescriptor } from "./capabilitydescriptor.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ImagePricingEntry } from "./imagepricingentry.js";
|
|
6
|
+
/**
|
|
7
|
+
* An endpoint that serves a given image model.
|
|
8
|
+
*/
|
|
9
|
+
export type ImageEndpoint = {
|
|
10
|
+
/**
|
|
11
|
+
* Provider-specific options accepted under provider.options[provider_slug].
|
|
12
|
+
*/
|
|
13
|
+
allowedPassthroughParameters: Array<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Billable pricing lines for this endpoint.
|
|
16
|
+
*/
|
|
17
|
+
pricing: Array<ImagePricingEntry>;
|
|
18
|
+
/**
|
|
19
|
+
* Provider display name
|
|
20
|
+
*/
|
|
21
|
+
providerName: string;
|
|
22
|
+
/**
|
|
23
|
+
* Provider slug
|
|
24
|
+
*/
|
|
25
|
+
providerSlug: string;
|
|
26
|
+
/**
|
|
27
|
+
* Provider tag for request-side selection
|
|
28
|
+
*/
|
|
29
|
+
providerTag: string | null;
|
|
30
|
+
supportedParameters: {
|
|
31
|
+
[k: string]: CapabilityDescriptor;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Whether this endpoint supports native SSE streaming (`stream: true` in the request).
|
|
35
|
+
*/
|
|
36
|
+
supportsStreaming: boolean;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const ImageEndpoint$inboundSchema: z.ZodType<ImageEndpoint, unknown>;
|
|
40
|
+
export declare function imageEndpointFromJSON(jsonString: string): SafeParseResult<ImageEndpoint, SDKValidationError>;
|
|
41
|
+
//# sourceMappingURL=imageendpoint.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e13b5353df71
|
|
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 { CapabilityDescriptor$inboundSchema, } from "./capabilitydescriptor.js";
|
|
9
|
+
import { ImagePricingEntry$inboundSchema, } from "./imagepricingentry.js";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ImageEndpoint$inboundSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
allowed_passthrough_parameters: z.array(z.string()),
|
|
14
|
+
pricing: z.array(ImagePricingEntry$inboundSchema),
|
|
15
|
+
provider_name: z.string(),
|
|
16
|
+
provider_slug: z.string(),
|
|
17
|
+
provider_tag: z.nullable(z.string()),
|
|
18
|
+
supported_parameters: z.record(z.string(), CapabilityDescriptor$inboundSchema),
|
|
19
|
+
supports_streaming: z.boolean(),
|
|
20
|
+
}).transform((v) => {
|
|
21
|
+
return remap$(v, {
|
|
22
|
+
"allowed_passthrough_parameters": "allowedPassthroughParameters",
|
|
23
|
+
"provider_name": "providerName",
|
|
24
|
+
"provider_slug": "providerSlug",
|
|
25
|
+
"provider_tag": "providerTag",
|
|
26
|
+
"supported_parameters": "supportedParameters",
|
|
27
|
+
"supports_streaming": "supportsStreaming",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export function imageEndpointFromJSON(jsonString) {
|
|
31
|
+
return safeParse(jsonString, (x) => ImageEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageEndpoint' from JSON`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=imageendpoint.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { ImageGenerationUsage } from "./imagegenerationusage.js";
|
|
5
|
+
/**
|
|
6
|
+
* Emitted when generation completes and the final image is available
|
|
7
|
+
*/
|
|
8
|
+
export type ImageGenCompletedEvent = {
|
|
9
|
+
/**
|
|
10
|
+
* Base64-encoded final image data
|
|
11
|
+
*/
|
|
12
|
+
b64Json: string;
|
|
13
|
+
/**
|
|
14
|
+
* Unix timestamp (seconds) when the image was generated
|
|
15
|
+
*/
|
|
16
|
+
created: number;
|
|
17
|
+
/**
|
|
18
|
+
* The event type
|
|
19
|
+
*/
|
|
20
|
+
type: "image_generation.completed";
|
|
21
|
+
/**
|
|
22
|
+
* Token and cost usage for the image generation request, when available
|
|
23
|
+
*/
|
|
24
|
+
usage?: ImageGenerationUsage | undefined;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const ImageGenCompletedEvent$inboundSchema: z.ZodType<ImageGenCompletedEvent, unknown>;
|
|
28
|
+
export declare function imageGenCompletedEventFromJSON(jsonString: string): SafeParseResult<ImageGenCompletedEvent, SDKValidationError>;
|
|
29
|
+
//# sourceMappingURL=imagegencompletedevent.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: df990f384b54
|
|
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 { ImageGenerationUsage$inboundSchema, } from "./imagegenerationusage.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const ImageGenCompletedEvent$inboundSchema = z.object({
|
|
11
|
+
b64_json: z.string(),
|
|
12
|
+
created: z.int(),
|
|
13
|
+
type: z.literal("image_generation.completed"),
|
|
14
|
+
usage: ImageGenerationUsage$inboundSchema.optional(),
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
"b64_json": "b64Json",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function imageGenCompletedEventFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => ImageGenCompletedEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenCompletedEvent' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=imagegencompletedevent.js.map
|