@openrouter/sdk 0.13.7 → 0.13.14
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 +4 -0
- package/esm/models/byokproviderslug.js +4 -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 +914 -0
- package/esm/models/imagegenerationrequest.js +267 -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 +4 -0
- package/esm/models/operations/listbyokkeys.js +4 -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 +4 -0
- package/esm/models/providername.js +4 -0
- package/esm/models/provideroptions.d.ts +25 -1
- package/esm/models/provideroptions.js +6 -0
- package/esm/models/providerresponse.d.ts +4 -0
- package/esm/models/providerresponse.js +4 -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 +39 -15
- package/esm/models/videogenerationrequest.js +17 -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 +7 -7
- 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
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ea1ffc0d2470
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { ContentPartImage$outboundSchema, } from "./contentpartimage.js";
|
|
9
|
+
/**
|
|
10
|
+
* Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
|
|
11
|
+
*/
|
|
12
|
+
export const ImageGenerationRequestAspectRatio = {
|
|
13
|
+
Eleven: "1:1",
|
|
14
|
+
Twelve: "1:2",
|
|
15
|
+
Fourteen: "1:4",
|
|
16
|
+
Eighteen: "1:8",
|
|
17
|
+
TwentyOne: "2:1",
|
|
18
|
+
TwentyThree: "2:3",
|
|
19
|
+
ThirtyTwo: "3:2",
|
|
20
|
+
ThirtyFour: "3:4",
|
|
21
|
+
FortyOne: "4:1",
|
|
22
|
+
FortyThree: "4:3",
|
|
23
|
+
FortyFive: "4:5",
|
|
24
|
+
FiftyFour: "5:4",
|
|
25
|
+
EightyOne: "8:1",
|
|
26
|
+
NineHundredAndSixteen: "9:16",
|
|
27
|
+
OneHundredAndSixtyNine: "16:9",
|
|
28
|
+
NineHundredAndNineteenDot5: "9:19.5",
|
|
29
|
+
NineteenDot59: "19.5:9",
|
|
30
|
+
NineHundredAndTwenty: "9:20",
|
|
31
|
+
TwoHundredAndNine: "20:9",
|
|
32
|
+
NineHundredAndTwentyOne: "9:21",
|
|
33
|
+
TwoHundredAndNineteen: "21:9",
|
|
34
|
+
Auto: "auto",
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
|
|
38
|
+
*/
|
|
39
|
+
export const ImageGenerationRequestBackground = {
|
|
40
|
+
Auto: "auto",
|
|
41
|
+
Transparent: "transparent",
|
|
42
|
+
Opaque: "opaque",
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Encoding of the returned image bytes.
|
|
46
|
+
*/
|
|
47
|
+
export const ImageGenerationRequestOutputFormat = {
|
|
48
|
+
Png: "png",
|
|
49
|
+
Jpeg: "jpeg",
|
|
50
|
+
Webp: "webp",
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Rendering quality. Providers without a quality knob ignore this.
|
|
54
|
+
*/
|
|
55
|
+
export const ImageGenerationRequestQuality = {
|
|
56
|
+
Auto: "auto",
|
|
57
|
+
Low: "low",
|
|
58
|
+
Medium: "medium",
|
|
59
|
+
High: "high",
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
|
|
63
|
+
*/
|
|
64
|
+
export const ImageGenerationRequestResolution = {
|
|
65
|
+
FiveHundredAndTwelve: "512",
|
|
66
|
+
OneK: "1K",
|
|
67
|
+
TwoK: "2K",
|
|
68
|
+
FourK: "4K",
|
|
69
|
+
};
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const ImageGenerationRequestAspectRatio$outboundSchema = openEnums.outboundSchema(ImageGenerationRequestAspectRatio);
|
|
72
|
+
/** @internal */
|
|
73
|
+
export const ImageGenerationRequestBackground$outboundSchema = openEnums.outboundSchema(ImageGenerationRequestBackground);
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const ImageGenerationRequestOutputFormat$outboundSchema = openEnums.outboundSchema(ImageGenerationRequestOutputFormat);
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const ImageGenerationRequestOptions$outboundSchema = z.object({
|
|
78
|
+
oneai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
79
|
+
ai21: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
80
|
+
aionLabs: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
81
|
+
akashml: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
82
|
+
alibaba: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
83
|
+
amazonBedrock: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
84
|
+
amazonNova: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
85
|
+
ambient: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
86
|
+
anthropic: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
87
|
+
anyscale: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
88
|
+
arceeAi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
89
|
+
atlasCloud: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
90
|
+
atoma: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
91
|
+
avian: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
92
|
+
azure: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
93
|
+
baidu: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
94
|
+
baseten: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
95
|
+
blackForestLabs: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
96
|
+
byteplus: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
97
|
+
centml: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
98
|
+
cerebras: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
99
|
+
chutes: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
100
|
+
cirrascale: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
101
|
+
clarifai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
102
|
+
cloudflare: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
103
|
+
cohere: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
104
|
+
crofai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
105
|
+
crucible: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
106
|
+
crusoe: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
107
|
+
darkbloom: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
108
|
+
decart: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
109
|
+
deepinfra: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
110
|
+
deepseek: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
111
|
+
dekallm: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
112
|
+
digitalocean: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
113
|
+
enfer: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
114
|
+
fakeProvider: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
115
|
+
featherless: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
116
|
+
fireworks: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
117
|
+
friendli: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
118
|
+
gmicloud: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
119
|
+
googleAiStudio: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
120
|
+
googleVertex: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
121
|
+
gopomelo: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
122
|
+
groq: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
123
|
+
heygen: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
124
|
+
huggingface: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
125
|
+
hyperbolic: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
126
|
+
hyperbolicQuantized: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
127
|
+
inception: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
128
|
+
inceptron: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
129
|
+
inferactVllm: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
130
|
+
inferenceNet: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
131
|
+
infermatic: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
132
|
+
inflection: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
133
|
+
inocloud: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
134
|
+
ioNet: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
135
|
+
ionstream: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
136
|
+
klusterai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
137
|
+
lambda: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
138
|
+
lepton: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
139
|
+
liquid: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
140
|
+
lynn: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
141
|
+
lynnPrivate: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
142
|
+
mancer: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
143
|
+
mancerOld: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
144
|
+
mara: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
145
|
+
meta: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
146
|
+
minimax: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
147
|
+
mistral: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
148
|
+
modal: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
149
|
+
modelrun: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
150
|
+
modular: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
151
|
+
moonshotai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
152
|
+
morph: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
153
|
+
ncompass: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
154
|
+
nebius: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
155
|
+
nexAgi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
156
|
+
nextbit: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
157
|
+
nineteen: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
158
|
+
novita: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
159
|
+
nvidia: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
160
|
+
octoai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
161
|
+
openInference: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
162
|
+
openai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
163
|
+
parasail: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
164
|
+
perceptron: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
165
|
+
perplexity: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
166
|
+
phala: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
167
|
+
poolside: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
168
|
+
recraft: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
169
|
+
recursal: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
170
|
+
reflection: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
171
|
+
reka: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
172
|
+
relace: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
173
|
+
replicate: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
174
|
+
sakanaAi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
175
|
+
sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
176
|
+
sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
177
|
+
seed: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
178
|
+
sfCompute: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
179
|
+
siliconflow: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
180
|
+
sourceful: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
181
|
+
stealth: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
182
|
+
stepfun: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
183
|
+
streamlake: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
184
|
+
switchpoint: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
185
|
+
targon: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
186
|
+
tenstorrent: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
187
|
+
together: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
188
|
+
togetherLite: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
189
|
+
ubicloud: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
190
|
+
upstage: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
191
|
+
venice: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
192
|
+
wafer: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
193
|
+
wandb: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
194
|
+
xai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
195
|
+
xiaomi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
196
|
+
zAi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
197
|
+
}).transform((v) => {
|
|
198
|
+
return remap$(v, {
|
|
199
|
+
oneai: "01ai",
|
|
200
|
+
aionLabs: "aion-labs",
|
|
201
|
+
amazonBedrock: "amazon-bedrock",
|
|
202
|
+
amazonNova: "amazon-nova",
|
|
203
|
+
arceeAi: "arcee-ai",
|
|
204
|
+
atlasCloud: "atlas-cloud",
|
|
205
|
+
blackForestLabs: "black-forest-labs",
|
|
206
|
+
fakeProvider: "fake-provider",
|
|
207
|
+
googleAiStudio: "google-ai-studio",
|
|
208
|
+
googleVertex: "google-vertex",
|
|
209
|
+
hyperbolicQuantized: "hyperbolic-quantized",
|
|
210
|
+
inferactVllm: "inferact-vllm",
|
|
211
|
+
inferenceNet: "inference-net",
|
|
212
|
+
ioNet: "io-net",
|
|
213
|
+
lynnPrivate: "lynn-private",
|
|
214
|
+
mancerOld: "mancer-old",
|
|
215
|
+
nexAgi: "nex-agi",
|
|
216
|
+
openInference: "open-inference",
|
|
217
|
+
sakanaAi: "sakana-ai",
|
|
218
|
+
sambanovaCloaked: "sambanova-cloaked",
|
|
219
|
+
sfCompute: "sf-compute",
|
|
220
|
+
togetherLite: "together-lite",
|
|
221
|
+
zAi: "z-ai",
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
export function imageGenerationRequestOptionsToJSON(imageGenerationRequestOptions) {
|
|
225
|
+
return JSON.stringify(ImageGenerationRequestOptions$outboundSchema.parse(imageGenerationRequestOptions));
|
|
226
|
+
}
|
|
227
|
+
/** @internal */
|
|
228
|
+
export const ImageGenerationRequestProvider$outboundSchema = z.object({
|
|
229
|
+
options: z.lazy(() => ImageGenerationRequestOptions$outboundSchema)
|
|
230
|
+
.optional(),
|
|
231
|
+
});
|
|
232
|
+
export function imageGenerationRequestProviderToJSON(imageGenerationRequestProvider) {
|
|
233
|
+
return JSON.stringify(ImageGenerationRequestProvider$outboundSchema.parse(imageGenerationRequestProvider));
|
|
234
|
+
}
|
|
235
|
+
/** @internal */
|
|
236
|
+
export const ImageGenerationRequestQuality$outboundSchema = openEnums.outboundSchema(ImageGenerationRequestQuality);
|
|
237
|
+
/** @internal */
|
|
238
|
+
export const ImageGenerationRequestResolution$outboundSchema = openEnums.outboundSchema(ImageGenerationRequestResolution);
|
|
239
|
+
/** @internal */
|
|
240
|
+
export const ImageGenerationRequest$outboundSchema = z.object({
|
|
241
|
+
aspectRatio: ImageGenerationRequestAspectRatio$outboundSchema.optional(),
|
|
242
|
+
background: ImageGenerationRequestBackground$outboundSchema.optional(),
|
|
243
|
+
inputReferences: z.array(ContentPartImage$outboundSchema).optional(),
|
|
244
|
+
model: z.string(),
|
|
245
|
+
n: z.int().optional(),
|
|
246
|
+
outputCompression: z.int().optional(),
|
|
247
|
+
outputFormat: ImageGenerationRequestOutputFormat$outboundSchema.optional(),
|
|
248
|
+
prompt: z.string(),
|
|
249
|
+
provider: z.lazy(() => ImageGenerationRequestProvider$outboundSchema)
|
|
250
|
+
.optional(),
|
|
251
|
+
quality: ImageGenerationRequestQuality$outboundSchema.optional(),
|
|
252
|
+
resolution: ImageGenerationRequestResolution$outboundSchema.optional(),
|
|
253
|
+
seed: z.int().optional(),
|
|
254
|
+
size: z.string().optional(),
|
|
255
|
+
stream: z.boolean().optional(),
|
|
256
|
+
}).transform((v) => {
|
|
257
|
+
return remap$(v, {
|
|
258
|
+
aspectRatio: "aspect_ratio",
|
|
259
|
+
inputReferences: "input_references",
|
|
260
|
+
outputCompression: "output_compression",
|
|
261
|
+
outputFormat: "output_format",
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
export function imageGenerationRequestToJSON(imageGenerationRequest) {
|
|
265
|
+
return JSON.stringify(ImageGenerationRequest$outboundSchema.parse(imageGenerationRequest));
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=imagegenerationrequest.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export type ImageGenerationResponseData = {
|
|
6
|
+
/**
|
|
7
|
+
* Base64-encoded image bytes
|
|
8
|
+
*/
|
|
9
|
+
b64Json: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Image generation response
|
|
13
|
+
*/
|
|
14
|
+
export type ImageGenerationResponse = {
|
|
15
|
+
/**
|
|
16
|
+
* Unix timestamp (seconds) when the image was generated
|
|
17
|
+
*/
|
|
18
|
+
created: number;
|
|
19
|
+
/**
|
|
20
|
+
* Generated images
|
|
21
|
+
*/
|
|
22
|
+
data: Array<ImageGenerationResponseData>;
|
|
23
|
+
/**
|
|
24
|
+
* Token and cost usage for the image generation request, when available
|
|
25
|
+
*/
|
|
26
|
+
usage?: ImageGenerationUsage | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const ImageGenerationResponseData$inboundSchema: z.ZodType<ImageGenerationResponseData, unknown>;
|
|
30
|
+
export declare function imageGenerationResponseDataFromJSON(jsonString: string): SafeParseResult<ImageGenerationResponseData, SDKValidationError>;
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const ImageGenerationResponse$inboundSchema: z.ZodType<ImageGenerationResponse, unknown>;
|
|
33
|
+
export declare function imageGenerationResponseFromJSON(jsonString: string): SafeParseResult<ImageGenerationResponse, SDKValidationError>;
|
|
34
|
+
//# sourceMappingURL=imagegenerationresponse.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 18aeba0f13cc
|
|
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 ImageGenerationResponseData$inboundSchema = z.object({
|
|
11
|
+
b64_json: z.string(),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
"b64_json": "b64Json",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function imageGenerationResponseDataFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => ImageGenerationResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationResponseData' from JSON`);
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const ImageGenerationResponse$inboundSchema = z.object({
|
|
22
|
+
created: z.int(),
|
|
23
|
+
data: z.array(z.lazy(() => ImageGenerationResponseData$inboundSchema)),
|
|
24
|
+
usage: ImageGenerationUsage$inboundSchema.optional(),
|
|
25
|
+
});
|
|
26
|
+
export function imageGenerationResponseFromJSON(jsonString) {
|
|
27
|
+
return safeParse(jsonString, (x) => ImageGenerationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationResponse' from JSON`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=imagegenerationresponse.js.map
|
|
@@ -2,12 +2,12 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { 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
|
|
5
|
+
export declare const ImageGenerationServerToolBackground: {
|
|
6
6
|
readonly Transparent: "transparent";
|
|
7
7
|
readonly Opaque: "opaque";
|
|
8
8
|
readonly Auto: "auto";
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type ImageGenerationServerToolBackground = OpenEnum<typeof ImageGenerationServerToolBackground>;
|
|
11
11
|
export declare const InputFidelity: {
|
|
12
12
|
readonly High: "high";
|
|
13
13
|
readonly Low: "low";
|
|
@@ -27,19 +27,19 @@ export declare const Moderation: {
|
|
|
27
27
|
readonly Low: "low";
|
|
28
28
|
};
|
|
29
29
|
export type Moderation = OpenEnum<typeof Moderation>;
|
|
30
|
-
export declare const
|
|
30
|
+
export declare const ImageGenerationServerToolOutputFormat: {
|
|
31
31
|
readonly Png: "png";
|
|
32
32
|
readonly Webp: "webp";
|
|
33
33
|
readonly Jpeg: "jpeg";
|
|
34
34
|
};
|
|
35
|
-
export type
|
|
36
|
-
export declare const
|
|
35
|
+
export type ImageGenerationServerToolOutputFormat = OpenEnum<typeof ImageGenerationServerToolOutputFormat>;
|
|
36
|
+
export declare const ImageGenerationServerToolQuality: {
|
|
37
37
|
readonly Low: "low";
|
|
38
38
|
readonly Medium: "medium";
|
|
39
39
|
readonly High: "high";
|
|
40
40
|
readonly Auto: "auto";
|
|
41
41
|
};
|
|
42
|
-
export type
|
|
42
|
+
export type ImageGenerationServerToolQuality = OpenEnum<typeof ImageGenerationServerToolQuality>;
|
|
43
43
|
export declare const Size: {
|
|
44
44
|
readonly OneThousandAndTwentyFourx1024: "1024x1024";
|
|
45
45
|
readonly OneThousandAndTwentyFourx1536: "1024x1536";
|
|
@@ -51,22 +51,22 @@ export type Size = OpenEnum<typeof Size>;
|
|
|
51
51
|
* Image generation tool configuration
|
|
52
52
|
*/
|
|
53
53
|
export type ImageGenerationServerTool = {
|
|
54
|
-
background?:
|
|
54
|
+
background?: ImageGenerationServerToolBackground | undefined;
|
|
55
55
|
inputFidelity?: InputFidelity | null | undefined;
|
|
56
56
|
inputImageMask?: InputImageMask | undefined;
|
|
57
57
|
model?: ModelEnum | undefined;
|
|
58
58
|
moderation?: Moderation | undefined;
|
|
59
59
|
outputCompression?: number | undefined;
|
|
60
|
-
outputFormat?:
|
|
60
|
+
outputFormat?: ImageGenerationServerToolOutputFormat | undefined;
|
|
61
61
|
partialImages?: number | undefined;
|
|
62
|
-
quality?:
|
|
62
|
+
quality?: ImageGenerationServerToolQuality | undefined;
|
|
63
63
|
size?: Size | undefined;
|
|
64
64
|
type: "image_generation";
|
|
65
65
|
};
|
|
66
66
|
/** @internal */
|
|
67
|
-
export declare const
|
|
67
|
+
export declare const ImageGenerationServerToolBackground$inboundSchema: z.ZodType<ImageGenerationServerToolBackground, unknown>;
|
|
68
68
|
/** @internal */
|
|
69
|
-
export declare const
|
|
69
|
+
export declare const ImageGenerationServerToolBackground$outboundSchema: z.ZodType<string, ImageGenerationServerToolBackground>;
|
|
70
70
|
/** @internal */
|
|
71
71
|
export declare const InputFidelity$inboundSchema: z.ZodType<InputFidelity, unknown>;
|
|
72
72
|
/** @internal */
|
|
@@ -91,13 +91,13 @@ export declare const Moderation$inboundSchema: z.ZodType<Moderation, unknown>;
|
|
|
91
91
|
/** @internal */
|
|
92
92
|
export declare const Moderation$outboundSchema: z.ZodType<string, Moderation>;
|
|
93
93
|
/** @internal */
|
|
94
|
-
export declare const
|
|
94
|
+
export declare const ImageGenerationServerToolOutputFormat$inboundSchema: z.ZodType<ImageGenerationServerToolOutputFormat, unknown>;
|
|
95
95
|
/** @internal */
|
|
96
|
-
export declare const
|
|
96
|
+
export declare const ImageGenerationServerToolOutputFormat$outboundSchema: z.ZodType<string, ImageGenerationServerToolOutputFormat>;
|
|
97
97
|
/** @internal */
|
|
98
|
-
export declare const
|
|
98
|
+
export declare const ImageGenerationServerToolQuality$inboundSchema: z.ZodType<ImageGenerationServerToolQuality, unknown>;
|
|
99
99
|
/** @internal */
|
|
100
|
-
export declare const
|
|
100
|
+
export declare const ImageGenerationServerToolQuality$outboundSchema: z.ZodType<string, ImageGenerationServerToolQuality>;
|
|
101
101
|
/** @internal */
|
|
102
102
|
export declare const Size$inboundSchema: z.ZodType<Size, unknown>;
|
|
103
103
|
/** @internal */
|
|
@@ -6,7 +6,7 @@ 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
8
|
import * as openEnums from "../types/enums.js";
|
|
9
|
-
export const
|
|
9
|
+
export const ImageGenerationServerToolBackground = {
|
|
10
10
|
Transparent: "transparent",
|
|
11
11
|
Opaque: "opaque",
|
|
12
12
|
Auto: "auto",
|
|
@@ -23,12 +23,12 @@ export const Moderation = {
|
|
|
23
23
|
Auto: "auto",
|
|
24
24
|
Low: "low",
|
|
25
25
|
};
|
|
26
|
-
export const
|
|
26
|
+
export const ImageGenerationServerToolOutputFormat = {
|
|
27
27
|
Png: "png",
|
|
28
28
|
Webp: "webp",
|
|
29
29
|
Jpeg: "jpeg",
|
|
30
30
|
};
|
|
31
|
-
export const
|
|
31
|
+
export const ImageGenerationServerToolQuality = {
|
|
32
32
|
Low: "low",
|
|
33
33
|
Medium: "medium",
|
|
34
34
|
High: "high",
|
|
@@ -41,9 +41,9 @@ export const Size = {
|
|
|
41
41
|
Auto: "auto",
|
|
42
42
|
};
|
|
43
43
|
/** @internal */
|
|
44
|
-
export const
|
|
44
|
+
export const ImageGenerationServerToolBackground$inboundSchema = openEnums.inboundSchema(ImageGenerationServerToolBackground);
|
|
45
45
|
/** @internal */
|
|
46
|
-
export const
|
|
46
|
+
export const ImageGenerationServerToolBackground$outboundSchema = openEnums.outboundSchema(ImageGenerationServerToolBackground);
|
|
47
47
|
/** @internal */
|
|
48
48
|
export const InputFidelity$inboundSchema = openEnums.inboundSchema(InputFidelity);
|
|
49
49
|
/** @internal */
|
|
@@ -85,15 +85,13 @@ export const Moderation$inboundSchema = openEnums.inboundSchema(Moderation);
|
|
|
85
85
|
/** @internal */
|
|
86
86
|
export const Moderation$outboundSchema = openEnums.outboundSchema(Moderation);
|
|
87
87
|
/** @internal */
|
|
88
|
-
export const
|
|
88
|
+
export const ImageGenerationServerToolOutputFormat$inboundSchema = openEnums.inboundSchema(ImageGenerationServerToolOutputFormat);
|
|
89
89
|
/** @internal */
|
|
90
|
-
export const
|
|
90
|
+
export const ImageGenerationServerToolOutputFormat$outboundSchema = openEnums.outboundSchema(ImageGenerationServerToolOutputFormat);
|
|
91
91
|
/** @internal */
|
|
92
|
-
export const
|
|
93
|
-
.inboundSchema(Quality);
|
|
92
|
+
export const ImageGenerationServerToolQuality$inboundSchema = openEnums.inboundSchema(ImageGenerationServerToolQuality);
|
|
94
93
|
/** @internal */
|
|
95
|
-
export const
|
|
96
|
-
.outboundSchema(Quality);
|
|
94
|
+
export const ImageGenerationServerToolQuality$outboundSchema = openEnums.outboundSchema(ImageGenerationServerToolQuality);
|
|
97
95
|
/** @internal */
|
|
98
96
|
export const Size$inboundSchema = openEnums
|
|
99
97
|
.inboundSchema(Size);
|
|
@@ -102,15 +100,15 @@ export const Size$outboundSchema = openEnums
|
|
|
102
100
|
.outboundSchema(Size);
|
|
103
101
|
/** @internal */
|
|
104
102
|
export const ImageGenerationServerTool$inboundSchema = z.object({
|
|
105
|
-
background:
|
|
103
|
+
background: ImageGenerationServerToolBackground$inboundSchema.optional(),
|
|
106
104
|
input_fidelity: z.nullable(InputFidelity$inboundSchema).optional(),
|
|
107
105
|
input_image_mask: z.lazy(() => InputImageMask$inboundSchema).optional(),
|
|
108
106
|
model: ModelEnum$inboundSchema.optional(),
|
|
109
107
|
moderation: Moderation$inboundSchema.optional(),
|
|
110
108
|
output_compression: z.int().optional(),
|
|
111
|
-
output_format:
|
|
109
|
+
output_format: ImageGenerationServerToolOutputFormat$inboundSchema.optional(),
|
|
112
110
|
partial_images: z.int().optional(),
|
|
113
|
-
quality:
|
|
111
|
+
quality: ImageGenerationServerToolQuality$inboundSchema.optional(),
|
|
114
112
|
size: Size$inboundSchema.optional(),
|
|
115
113
|
type: z.literal("image_generation"),
|
|
116
114
|
}).transform((v) => {
|
|
@@ -124,15 +122,15 @@ export const ImageGenerationServerTool$inboundSchema = z.object({
|
|
|
124
122
|
});
|
|
125
123
|
/** @internal */
|
|
126
124
|
export const ImageGenerationServerTool$outboundSchema = z.object({
|
|
127
|
-
background:
|
|
125
|
+
background: ImageGenerationServerToolBackground$outboundSchema.optional(),
|
|
128
126
|
inputFidelity: z.nullable(InputFidelity$outboundSchema).optional(),
|
|
129
127
|
inputImageMask: z.lazy(() => InputImageMask$outboundSchema).optional(),
|
|
130
128
|
model: ModelEnum$outboundSchema.optional(),
|
|
131
129
|
moderation: Moderation$outboundSchema.optional(),
|
|
132
130
|
outputCompression: z.int().optional(),
|
|
133
|
-
outputFormat:
|
|
131
|
+
outputFormat: ImageGenerationServerToolOutputFormat$outboundSchema.optional(),
|
|
134
132
|
partialImages: z.int().optional(),
|
|
135
|
-
quality:
|
|
133
|
+
quality: ImageGenerationServerToolQuality$outboundSchema.optional(),
|
|
136
134
|
size: Size$outboundSchema.optional(),
|
|
137
135
|
type: z.literal("image_generation"),
|
|
138
136
|
}).transform((v) => {
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { AnthropicSpeed } from "./anthropicspeed.js";
|
|
4
|
+
import { AnthropicUsageIteration } from "./anthropicusageiteration.js";
|
|
5
|
+
import { CostDetails } from "./costdetails.js";
|
|
6
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
7
|
+
export type ImageGenerationUsageCompletionTokensDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Tokens generated by the model for audio output.
|
|
10
|
+
*/
|
|
11
|
+
audioTokens?: number | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Tokens generated by the model for image output.
|
|
14
|
+
*/
|
|
15
|
+
imageTokens?: number | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Tokens generated by the model for reasoning.
|
|
18
|
+
*/
|
|
19
|
+
reasoningTokens?: number | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Breakdown of tokens used in the prompt.
|
|
23
|
+
*/
|
|
24
|
+
export type ImageGenerationUsagePromptTokensDetails = {
|
|
25
|
+
/**
|
|
26
|
+
* Tokens used for input audio.
|
|
27
|
+
*/
|
|
28
|
+
audioTokens?: number | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
|
|
31
|
+
*/
|
|
32
|
+
cacheWriteTokens?: number | null | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Tokens cached by the endpoint.
|
|
35
|
+
*/
|
|
36
|
+
cachedTokens?: number | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Tokens used for input files/documents.
|
|
39
|
+
*/
|
|
40
|
+
fileTokens?: number | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Tokens used for input video.
|
|
43
|
+
*/
|
|
44
|
+
videoTokens?: number | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
48
|
+
*/
|
|
49
|
+
export type ServerToolUse = {
|
|
50
|
+
/**
|
|
51
|
+
* Number of OpenRouter server tool calls that executed and produced a result.
|
|
52
|
+
*/
|
|
53
|
+
toolCallsExecuted?: number | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.
|
|
56
|
+
*/
|
|
57
|
+
toolCallsRequested?: number | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.
|
|
60
|
+
*/
|
|
61
|
+
webSearchRequests?: number | null | undefined;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Token and cost usage for the image generation request, when available
|
|
65
|
+
*/
|
|
66
|
+
export type ImageGenerationUsage = {
|
|
67
|
+
/**
|
|
68
|
+
* The tokens generated
|
|
69
|
+
*/
|
|
70
|
+
completionTokens: number;
|
|
71
|
+
completionTokensDetails?: ImageGenerationUsageCompletionTokensDetails | null | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Cost of the completion
|
|
74
|
+
*/
|
|
75
|
+
cost?: number | null | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Breakdown of upstream inference costs
|
|
78
|
+
*/
|
|
79
|
+
costDetails?: CostDetails | null | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Whether a request was made using a Bring Your Own Key configuration
|
|
82
|
+
*/
|
|
83
|
+
isByok?: boolean | undefined;
|
|
84
|
+
iterations?: Array<AnthropicUsageIteration> | null | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Including images, input audio, and tools if any
|
|
87
|
+
*/
|
|
88
|
+
promptTokens: number;
|
|
89
|
+
/**
|
|
90
|
+
* Breakdown of tokens used in the prompt.
|
|
91
|
+
*/
|
|
92
|
+
promptTokensDetails?: ImageGenerationUsagePromptTokensDetails | null | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
95
|
+
*/
|
|
96
|
+
serverToolUse?: ServerToolUse | null | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* The service tier used by the upstream provider for this request
|
|
99
|
+
*/
|
|
100
|
+
serviceTier?: string | null | undefined;
|
|
101
|
+
speed?: AnthropicSpeed | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Sum of the above two fields
|
|
104
|
+
*/
|
|
105
|
+
totalTokens: number;
|
|
106
|
+
};
|
|
107
|
+
/** @internal */
|
|
108
|
+
export declare const ImageGenerationUsageCompletionTokensDetails$inboundSchema: z.ZodType<ImageGenerationUsageCompletionTokensDetails, unknown>;
|
|
109
|
+
export declare function imageGenerationUsageCompletionTokensDetailsFromJSON(jsonString: string): SafeParseResult<ImageGenerationUsageCompletionTokensDetails, SDKValidationError>;
|
|
110
|
+
/** @internal */
|
|
111
|
+
export declare const ImageGenerationUsagePromptTokensDetails$inboundSchema: z.ZodType<ImageGenerationUsagePromptTokensDetails, unknown>;
|
|
112
|
+
export declare function imageGenerationUsagePromptTokensDetailsFromJSON(jsonString: string): SafeParseResult<ImageGenerationUsagePromptTokensDetails, SDKValidationError>;
|
|
113
|
+
/** @internal */
|
|
114
|
+
export declare const ServerToolUse$inboundSchema: z.ZodType<ServerToolUse, unknown>;
|
|
115
|
+
export declare function serverToolUseFromJSON(jsonString: string): SafeParseResult<ServerToolUse, SDKValidationError>;
|
|
116
|
+
/** @internal */
|
|
117
|
+
export declare const ImageGenerationUsage$inboundSchema: z.ZodType<ImageGenerationUsage, unknown>;
|
|
118
|
+
export declare function imageGenerationUsageFromJSON(jsonString: string): SafeParseResult<ImageGenerationUsage, SDKValidationError>;
|
|
119
|
+
//# sourceMappingURL=imagegenerationusage.d.ts.map
|