@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.
Files changed (216) hide show
  1. package/README.md +3 -9
  2. package/esm/funcs/benchmarksGetBenchmarks.d.ts +19 -0
  3. package/esm/funcs/{datasetsGetBenchmarksDesignArena.js → benchmarksGetBenchmarks.js} +11 -10
  4. package/esm/funcs/classificationsGetTaskClassifications.d.ts +37 -0
  5. package/esm/funcs/classificationsGetTaskClassifications.js +119 -0
  6. package/esm/funcs/imagesGenerate.d.ts +30 -0
  7. package/esm/funcs/imagesGenerate.js +95 -0
  8. package/esm/funcs/imagesListModelEndpoints.d.ts +19 -0
  9. package/esm/funcs/imagesListModelEndpoints.js +107 -0
  10. package/esm/funcs/{datasetsGetBenchmarksDesignArena.d.ts → imagesListModels.d.ts} +4 -4
  11. package/esm/funcs/{datasetsGetBenchmarksArtificialAnalysis.js → imagesListModels.js} +10 -15
  12. package/esm/funcs/workspacesDeleteBudget.d.ts +19 -0
  13. package/esm/funcs/workspacesDeleteBudget.js +107 -0
  14. package/esm/funcs/workspacesListBudgets.d.ts +19 -0
  15. package/esm/funcs/workspacesListBudgets.js +103 -0
  16. package/esm/funcs/workspacesSetBudget.d.ts +19 -0
  17. package/esm/funcs/workspacesSetBudget.js +110 -0
  18. package/esm/lib/config.d.ts +2 -2
  19. package/esm/lib/config.js +2 -2
  20. package/esm/models/advisorreasoning.d.ts +1 -0
  21. package/esm/models/advisorreasoning.js +1 -0
  22. package/esm/models/anthropicadvisormessageusageiteration.d.ts +24 -0
  23. package/esm/models/anthropicadvisormessageusageiteration.js +36 -0
  24. package/esm/models/anthropiccompactionusageiteration.d.ts +23 -0
  25. package/esm/models/anthropiccompactionusageiteration.js +35 -0
  26. package/esm/models/anthropicdocumentblockparam.d.ts +5 -4
  27. package/esm/models/anthropicdocumentblockparam.js +3 -0
  28. package/esm/models/anthropicfiledocumentsource.d.ts +14 -0
  29. package/esm/models/anthropicfiledocumentsource.js +19 -0
  30. package/esm/models/anthropiciterationcachecreation.d.ts +11 -0
  31. package/esm/models/anthropiciterationcachecreation.js +21 -0
  32. package/esm/models/anthropicmessageusageiteration.d.ts +24 -0
  33. package/esm/models/anthropicmessageusageiteration.js +36 -0
  34. package/esm/models/anthropicspeed.d.ts +10 -0
  35. package/esm/models/anthropicspeed.js +12 -0
  36. package/esm/models/anthropicunknownusageiteration.d.ts +16 -0
  37. package/esm/models/anthropicunknownusageiteration.js +30 -0
  38. package/esm/models/anthropicusageiteration.d.ts +12 -0
  39. package/esm/models/anthropicusageiteration.js +21 -0
  40. package/esm/models/apierrortype.d.ts +41 -0
  41. package/esm/models/apierrortype.js +40 -0
  42. package/esm/models/booleancapability.d.ts +13 -0
  43. package/esm/models/booleancapability.js +14 -0
  44. package/esm/models/byokproviderslug.d.ts +4 -0
  45. package/esm/models/byokproviderslug.js +4 -0
  46. package/esm/models/capabilitydescriptor.d.ts +15 -0
  47. package/esm/models/capabilitydescriptor.js +19 -0
  48. package/esm/models/chatrequest.d.ts +2 -0
  49. package/esm/models/chatrequest.js +2 -0
  50. package/esm/models/chatstreamchunk.d.ts +25 -4
  51. package/esm/models/chatstreamchunk.js +19 -4
  52. package/esm/models/chatusage.d.ts +32 -8
  53. package/esm/models/chatusage.js +25 -8
  54. package/esm/models/chatwebsearchshorthand.d.ts +1 -1
  55. package/esm/models/contentpartimage.d.ts +9 -2
  56. package/esm/models/contentpartimage.js +6 -1
  57. package/esm/models/debugevent.d.ts +42 -0
  58. package/esm/models/debugevent.js +58 -0
  59. package/esm/models/deleteworkspacebudgetresponse.d.ts +13 -0
  60. package/esm/models/deleteworkspacebudgetresponse.js +14 -0
  61. package/esm/models/enumcapability.d.ts +14 -0
  62. package/esm/models/enumcapability.js +15 -0
  63. package/esm/models/fusionplugin.d.ts +1 -0
  64. package/esm/models/fusionplugin.js +1 -0
  65. package/esm/models/fusionservertoolconfig.d.ts +8 -1
  66. package/esm/models/fusionservertoolconfig.js +4 -0
  67. package/esm/models/imageendpoint.d.ts +41 -0
  68. package/esm/models/imageendpoint.js +33 -0
  69. package/esm/models/imagegencompletedevent.d.ts +29 -0
  70. package/esm/models/imagegencompletedevent.js +23 -0
  71. package/esm/models/imagegenerationrequest.d.ts +914 -0
  72. package/esm/models/imagegenerationrequest.js +267 -0
  73. package/esm/models/imagegenerationresponse.d.ts +34 -0
  74. package/esm/models/imagegenerationresponse.js +29 -0
  75. package/esm/models/imagegenerationservertool.d.ts +15 -15
  76. package/esm/models/imagegenerationservertool.js +15 -17
  77. package/esm/models/imagegenerationusage.d.ts +119 -0
  78. package/esm/models/imagegenerationusage.js +93 -0
  79. package/esm/models/imagegenpartialimageevent.d.ts +24 -0
  80. package/esm/models/imagegenpartialimageevent.js +22 -0
  81. package/esm/models/imagegenstreamerrorevent.d.ts +44 -0
  82. package/esm/models/imagegenstreamerrorevent.js +25 -0
  83. package/esm/models/imagemodelarchitecture.d.ts +19 -0
  84. package/esm/models/imagemodelarchitecture.js +23 -0
  85. package/esm/models/imagemodelendpointsresponse.d.ts +18 -0
  86. package/esm/models/imagemodelendpointsresponse.js +16 -0
  87. package/esm/models/imagemodellistitem.d.ts +42 -0
  88. package/esm/models/imagemodellistitem.js +29 -0
  89. package/esm/models/imagemodelslistresponse.d.ts +14 -0
  90. package/esm/models/imagemodelslistresponse.js +15 -0
  91. package/esm/models/imageoutputmodality.d.ts +16 -0
  92. package/esm/models/imageoutputmodality.js +18 -0
  93. package/esm/models/imagepricingentry.d.ts +35 -0
  94. package/esm/models/imagepricingentry.js +41 -0
  95. package/esm/models/imagestreamingresponse.d.ts +18 -0
  96. package/esm/models/imagestreamingresponse.js +43 -0
  97. package/esm/models/index.d.ts +44 -7
  98. package/esm/models/index.js +44 -7
  99. package/esm/models/inputreference.d.ts +6 -2
  100. package/esm/models/inputreference.js +1 -1
  101. package/esm/models/legacywebsearchservertool.d.ts +1 -1
  102. package/esm/models/listworkspacebudgetsresponse.d.ts +14 -0
  103. package/esm/models/listworkspacebudgetsresponse.js +15 -0
  104. package/esm/models/messagesrequest.d.ts +6 -6
  105. package/esm/models/messagesrequest.js +4 -5
  106. package/esm/models/model.d.ts +5 -0
  107. package/esm/models/model.js +2 -0
  108. package/esm/models/modelreasoning.d.ts +49 -0
  109. package/esm/models/modelreasoning.js +42 -0
  110. package/esm/models/observabilityarizedestination.d.ts +3 -0
  111. package/esm/models/openresponsesresult.d.ts +5 -0
  112. package/esm/models/openresponsesresult.js +3 -0
  113. package/esm/models/operations/createembeddings.d.ts +19 -0
  114. package/esm/models/operations/createembeddings.js +20 -0
  115. package/esm/models/operations/createimages.d.ts +63 -0
  116. package/esm/models/operations/createimages.js +44 -0
  117. package/esm/models/operations/{getbenchmarksartificialanalysis.d.ts → deleteworkspacebudget.d.ts} +15 -9
  118. package/esm/models/operations/deleteworkspacebudget.js +23 -0
  119. package/esm/models/operations/getbenchmarks.d.ts +120 -0
  120. package/esm/models/operations/getbenchmarks.js +60 -0
  121. package/esm/models/operations/getmodels.d.ts +5 -3
  122. package/esm/models/operations/getmodels.js +3 -1
  123. package/esm/models/operations/{getbenchmarksdesignarena.d.ts → gettaskclassifications.d.ts} +16 -28
  124. package/esm/models/operations/gettaskclassifications.js +29 -0
  125. package/esm/models/operations/index.d.ts +8 -2
  126. package/esm/models/operations/index.js +8 -2
  127. package/esm/models/operations/listbyokkeys.d.ts +4 -0
  128. package/esm/models/operations/listbyokkeys.js +4 -0
  129. package/esm/models/operations/listimagemodelendpoints.d.ts +63 -0
  130. package/esm/models/operations/listimagemodelendpoints.js +22 -0
  131. package/esm/models/operations/listimagemodels.d.ts +53 -0
  132. package/esm/models/operations/listimagemodels.js +20 -0
  133. package/esm/models/operations/listworkspacebudgets.d.ts +58 -0
  134. package/esm/models/operations/listworkspacebudgets.js +21 -0
  135. package/esm/models/operations/queryanalytics.d.ts +7 -3
  136. package/esm/models/operations/queryanalytics.js +1 -0
  137. package/esm/models/operations/upsertworkspacebudget.d.ts +66 -0
  138. package/esm/models/operations/upsertworkspacebudget.js +25 -0
  139. package/esm/models/preview20250311websearchservertool.d.ts +1 -1
  140. package/esm/models/previewwebsearchservertool.d.ts +1 -1
  141. package/esm/models/providername.d.ts +4 -0
  142. package/esm/models/providername.js +4 -0
  143. package/esm/models/provideroptions.d.ts +25 -1
  144. package/esm/models/provideroptions.js +6 -0
  145. package/esm/models/providerresponse.d.ts +4 -0
  146. package/esm/models/providerresponse.js +4 -0
  147. package/esm/models/rangecapability.d.ts +15 -0
  148. package/esm/models/rangecapability.js +16 -0
  149. package/esm/models/reasoningeffort.d.ts +1 -0
  150. package/esm/models/reasoningeffort.js +1 -0
  151. package/esm/models/responsesrequest.d.ts +6 -0
  152. package/esm/models/responsesrequest.js +2 -0
  153. package/esm/models/speechrequest.d.ts +1 -1
  154. package/esm/models/streamevents.d.ts +2 -1
  155. package/esm/models/streamevents.js +2 -0
  156. package/esm/models/sttrequest.d.ts +1 -1
  157. package/esm/models/subagentreasoning.d.ts +1 -0
  158. package/esm/models/subagentreasoning.js +1 -0
  159. package/esm/models/taskclassificationitem.d.ts +42 -0
  160. package/esm/models/taskclassificationitem.js +32 -0
  161. package/esm/models/taskclassificationmacrocategory.d.ts +25 -0
  162. package/esm/models/taskclassificationmacrocategory.js +23 -0
  163. package/esm/models/taskclassificationmodel.d.ts +21 -0
  164. package/esm/models/taskclassificationmodel.js +22 -0
  165. package/esm/models/taskclassificationresponse.d.ts +33 -0
  166. package/esm/models/taskclassificationresponse.js +33 -0
  167. package/esm/models/{benchmarkpricing.d.ts → unifiedbenchmarkpricing.d.ts} +4 -4
  168. package/esm/models/unifiedbenchmarkpricing.js +15 -0
  169. package/esm/models/{benchmarksaaitem.d.ts → unifiedbenchmarksaaitem.d.ts} +14 -10
  170. package/esm/models/unifiedbenchmarksaaitem.js +30 -0
  171. package/esm/models/{benchmarksdaitem.d.ts → unifiedbenchmarksdaitem.d.ts} +11 -7
  172. package/esm/models/{benchmarksdaitem.js → unifiedbenchmarksdaitem.js} +8 -7
  173. package/esm/models/unifiedbenchmarksmeta.d.ts +63 -0
  174. package/esm/models/unifiedbenchmarksmeta.js +46 -0
  175. package/esm/models/unifiedbenchmarksresponse.d.ts +19 -0
  176. package/esm/models/unifiedbenchmarksresponse.js +30 -0
  177. package/esm/models/upsertworkspacebudgetrequest.d.ts +15 -0
  178. package/esm/models/upsertworkspacebudgetrequest.js +18 -0
  179. package/esm/models/upsertworkspacebudgetresponse.d.ts +11 -0
  180. package/esm/models/upsertworkspacebudgetresponse.js +15 -0
  181. package/esm/models/videogenerationrequest.d.ts +39 -15
  182. package/esm/models/videogenerationrequest.js +17 -11
  183. package/esm/models/websearchconfig.d.ts +1 -1
  184. package/esm/models/websearchservertool.d.ts +1 -1
  185. package/esm/models/websearchservertoolconfig.d.ts +1 -1
  186. package/esm/models/workspacebudget.d.ts +48 -0
  187. package/esm/models/workspacebudget.js +39 -0
  188. package/esm/models/workspacebudgetinterval.d.ts +18 -0
  189. package/esm/models/workspacebudgetinterval.js +17 -0
  190. package/esm/sdk/benchmarks.d.ts +13 -0
  191. package/esm/sdk/benchmarks.js +19 -0
  192. package/esm/sdk/classifications.d.ts +31 -0
  193. package/esm/sdk/classifications.js +37 -0
  194. package/esm/sdk/datasets.d.ts +0 -14
  195. package/esm/sdk/datasets.js +0 -20
  196. package/esm/sdk/images.d.ts +38 -0
  197. package/esm/sdk/images.js +33 -0
  198. package/esm/sdk/sdk.d.ts +9 -0
  199. package/esm/sdk/sdk.js +12 -0
  200. package/esm/sdk/workspaces.d.ts +21 -0
  201. package/esm/sdk/workspaces.js +30 -0
  202. package/jsr.json +1 -1
  203. package/package.json +7 -7
  204. package/esm/funcs/datasetsGetBenchmarksArtificialAnalysis.d.ts +0 -19
  205. package/esm/models/benchmarkpricing.js +0 -15
  206. package/esm/models/benchmarksaaitem.js +0 -29
  207. package/esm/models/benchmarksaameta.d.ts +0 -70
  208. package/esm/models/benchmarksaameta.js +0 -50
  209. package/esm/models/benchmarksaaresponse.d.ts +0 -13
  210. package/esm/models/benchmarksaaresponse.js +0 -17
  211. package/esm/models/benchmarksdameta.d.ts +0 -98
  212. package/esm/models/benchmarksdameta.js +0 -62
  213. package/esm/models/benchmarksdaresponse.d.ts +0 -13
  214. package/esm/models/benchmarksdaresponse.js +0 -17
  215. package/esm/models/operations/getbenchmarksartificialanalysis.js +0 -22
  216. package/esm/models/operations/getbenchmarksdesignarena.js +0 -36
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4f128ace6b39
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 { AnthropicSpeed$inboundSchema, } from "./anthropicspeed.js";
9
+ import { AnthropicUsageIteration$inboundSchema, } from "./anthropicusageiteration.js";
10
+ import { CostDetails$inboundSchema } from "./costdetails.js";
11
+ /** @internal */
12
+ export const ImageGenerationUsageCompletionTokensDetails$inboundSchema = z.object({
13
+ audio_tokens: z.nullable(z.int()).optional(),
14
+ image_tokens: z.nullable(z.int()).optional(),
15
+ reasoning_tokens: z.nullable(z.int()).optional(),
16
+ }).transform((v) => {
17
+ return remap$(v, {
18
+ "audio_tokens": "audioTokens",
19
+ "image_tokens": "imageTokens",
20
+ "reasoning_tokens": "reasoningTokens",
21
+ });
22
+ });
23
+ export function imageGenerationUsageCompletionTokensDetailsFromJSON(jsonString) {
24
+ return safeParse(jsonString, (x) => ImageGenerationUsageCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationUsageCompletionTokensDetails' from JSON`);
25
+ }
26
+ /** @internal */
27
+ export const ImageGenerationUsagePromptTokensDetails$inboundSchema = z.object({
28
+ audio_tokens: z.nullable(z.int()).optional(),
29
+ cache_write_tokens: z.nullable(z.int()).optional(),
30
+ cached_tokens: z.nullable(z.int()).optional(),
31
+ file_tokens: z.nullable(z.int()).optional(),
32
+ video_tokens: z.nullable(z.int()).optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "audio_tokens": "audioTokens",
36
+ "cache_write_tokens": "cacheWriteTokens",
37
+ "cached_tokens": "cachedTokens",
38
+ "file_tokens": "fileTokens",
39
+ "video_tokens": "videoTokens",
40
+ });
41
+ });
42
+ export function imageGenerationUsagePromptTokensDetailsFromJSON(jsonString) {
43
+ return safeParse(jsonString, (x) => ImageGenerationUsagePromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationUsagePromptTokensDetails' from JSON`);
44
+ }
45
+ /** @internal */
46
+ export const ServerToolUse$inboundSchema = z
47
+ .object({
48
+ tool_calls_executed: z.nullable(z.int()).optional(),
49
+ tool_calls_requested: z.nullable(z.int()).optional(),
50
+ web_search_requests: z.nullable(z.int()).optional(),
51
+ }).transform((v) => {
52
+ return remap$(v, {
53
+ "tool_calls_executed": "toolCallsExecuted",
54
+ "tool_calls_requested": "toolCallsRequested",
55
+ "web_search_requests": "webSearchRequests",
56
+ });
57
+ });
58
+ export function serverToolUseFromJSON(jsonString) {
59
+ return safeParse(jsonString, (x) => ServerToolUse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolUse' from JSON`);
60
+ }
61
+ /** @internal */
62
+ export const ImageGenerationUsage$inboundSchema = z.object({
63
+ completion_tokens: z.int(),
64
+ completion_tokens_details: z.nullable(z.lazy(() => ImageGenerationUsageCompletionTokensDetails$inboundSchema)).optional(),
65
+ cost: z.nullable(z.number()).optional(),
66
+ cost_details: z.nullable(CostDetails$inboundSchema).optional(),
67
+ is_byok: z.boolean().optional(),
68
+ iterations: z.nullable(z.array(AnthropicUsageIteration$inboundSchema))
69
+ .optional(),
70
+ prompt_tokens: z.int(),
71
+ prompt_tokens_details: z.nullable(z.lazy(() => ImageGenerationUsagePromptTokensDetails$inboundSchema)).optional(),
72
+ server_tool_use: z.nullable(z.lazy(() => ServerToolUse$inboundSchema))
73
+ .optional(),
74
+ service_tier: z.nullable(z.string()).optional(),
75
+ speed: z.nullable(AnthropicSpeed$inboundSchema).optional(),
76
+ total_tokens: z.int(),
77
+ }).transform((v) => {
78
+ return remap$(v, {
79
+ "completion_tokens": "completionTokens",
80
+ "completion_tokens_details": "completionTokensDetails",
81
+ "cost_details": "costDetails",
82
+ "is_byok": "isByok",
83
+ "prompt_tokens": "promptTokens",
84
+ "prompt_tokens_details": "promptTokensDetails",
85
+ "server_tool_use": "serverToolUse",
86
+ "service_tier": "serviceTier",
87
+ "total_tokens": "totalTokens",
88
+ });
89
+ });
90
+ export function imageGenerationUsageFromJSON(jsonString) {
91
+ return safeParse(jsonString, (x) => ImageGenerationUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationUsage' from JSON`);
92
+ }
93
+ //# sourceMappingURL=imagegenerationusage.js.map
@@ -0,0 +1,24 @@
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
+ * Emitted when a partial image becomes available during streaming generation
6
+ */
7
+ export type ImageGenPartialImageEvent = {
8
+ /**
9
+ * Base64-encoded partial image data
10
+ */
11
+ b64Json: string;
12
+ /**
13
+ * 0-based index indicating which partial image this is in the sequence
14
+ */
15
+ partialImageIndex: number;
16
+ /**
17
+ * The event type
18
+ */
19
+ type: "image_generation.partial_image";
20
+ };
21
+ /** @internal */
22
+ export declare const ImageGenPartialImageEvent$inboundSchema: z.ZodType<ImageGenPartialImageEvent, unknown>;
23
+ export declare function imageGenPartialImageEventFromJSON(jsonString: string): SafeParseResult<ImageGenPartialImageEvent, SDKValidationError>;
24
+ //# sourceMappingURL=imagegenpartialimageevent.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ee4283390600
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ /** @internal */
9
+ export const ImageGenPartialImageEvent$inboundSchema = z.object({
10
+ b64_json: z.string(),
11
+ partial_image_index: z.int(),
12
+ type: z.literal("image_generation.partial_image"),
13
+ }).transform((v) => {
14
+ return remap$(v, {
15
+ "b64_json": "b64Json",
16
+ "partial_image_index": "partialImageIndex",
17
+ });
18
+ });
19
+ export function imageGenPartialImageEventFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => ImageGenPartialImageEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenPartialImageEvent' from JSON`);
21
+ }
22
+ //# sourceMappingURL=imagegenpartialimageevent.js.map
@@ -0,0 +1,44 @@
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
+ * Provider error details
6
+ */
7
+ export type ImageGenStreamErrorEventError = {
8
+ /**
9
+ * Provider error code, when supplied
10
+ */
11
+ code?: string | null | undefined;
12
+ /**
13
+ * Provider error message
14
+ */
15
+ message: string;
16
+ /**
17
+ * Request parameter associated with the error, when supplied
18
+ */
19
+ param?: string | null | undefined;
20
+ /**
21
+ * Provider error type, when supplied
22
+ */
23
+ type?: string | null | undefined;
24
+ };
25
+ /**
26
+ * Emitted when streaming generation fails after the SSE response starts
27
+ */
28
+ export type ImageGenStreamErrorEvent = {
29
+ /**
30
+ * Provider error details
31
+ */
32
+ error: ImageGenStreamErrorEventError;
33
+ /**
34
+ * The event type
35
+ */
36
+ type: "error";
37
+ };
38
+ /** @internal */
39
+ export declare const ImageGenStreamErrorEventError$inboundSchema: z.ZodType<ImageGenStreamErrorEventError, unknown>;
40
+ export declare function imageGenStreamErrorEventErrorFromJSON(jsonString: string): SafeParseResult<ImageGenStreamErrorEventError, SDKValidationError>;
41
+ /** @internal */
42
+ export declare const ImageGenStreamErrorEvent$inboundSchema: z.ZodType<ImageGenStreamErrorEvent, unknown>;
43
+ export declare function imageGenStreamErrorEventFromJSON(jsonString: string): SafeParseResult<ImageGenStreamErrorEvent, SDKValidationError>;
44
+ //# sourceMappingURL=imagegenstreamerrorevent.d.ts.map
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3ba1d6d94b96
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const ImageGenStreamErrorEventError$inboundSchema = z.object({
9
+ code: z.nullable(z.string()).optional(),
10
+ message: z.string(),
11
+ param: z.nullable(z.string()).optional(),
12
+ type: z.nullable(z.string()).optional(),
13
+ });
14
+ export function imageGenStreamErrorEventErrorFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => ImageGenStreamErrorEventError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenStreamErrorEventError' from JSON`);
16
+ }
17
+ /** @internal */
18
+ export const ImageGenStreamErrorEvent$inboundSchema = z.object({
19
+ error: z.lazy(() => ImageGenStreamErrorEventError$inboundSchema),
20
+ type: z.literal("error"),
21
+ });
22
+ export function imageGenStreamErrorEventFromJSON(jsonString) {
23
+ return safeParse(jsonString, (x) => ImageGenStreamErrorEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenStreamErrorEvent' from JSON`);
24
+ }
25
+ //# sourceMappingURL=imagegenstreamerrorevent.js.map
@@ -0,0 +1,19 @@
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 { ImageOutputModality } from "./imageoutputmodality.js";
5
+ import { InputModality } from "./inputmodality.js";
6
+ export type ImageModelArchitecture = {
7
+ /**
8
+ * Supported input modalities
9
+ */
10
+ inputModalities: Array<InputModality>;
11
+ /**
12
+ * Supported output modalities
13
+ */
14
+ outputModalities: Array<ImageOutputModality>;
15
+ };
16
+ /** @internal */
17
+ export declare const ImageModelArchitecture$inboundSchema: z.ZodType<ImageModelArchitecture, unknown>;
18
+ export declare function imageModelArchitectureFromJSON(jsonString: string): SafeParseResult<ImageModelArchitecture, SDKValidationError>;
19
+ //# sourceMappingURL=imagemodelarchitecture.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b316f2890f6c
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 { ImageOutputModality$inboundSchema, } from "./imageoutputmodality.js";
9
+ import { InputModality$inboundSchema } from "./inputmodality.js";
10
+ /** @internal */
11
+ export const ImageModelArchitecture$inboundSchema = z.object({
12
+ input_modalities: z.array(InputModality$inboundSchema),
13
+ output_modalities: z.array(ImageOutputModality$inboundSchema),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "input_modalities": "inputModalities",
17
+ "output_modalities": "outputModalities",
18
+ });
19
+ });
20
+ export function imageModelArchitectureFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => ImageModelArchitecture$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageModelArchitecture' from JSON`);
22
+ }
23
+ //# sourceMappingURL=imagemodelarchitecture.js.map
@@ -0,0 +1,18 @@
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 { ImageEndpoint } from "./imageendpoint.js";
5
+ /**
6
+ * The full per-endpoint records for an image model.
7
+ */
8
+ export type ImageModelEndpointsResponse = {
9
+ endpoints: Array<ImageEndpoint>;
10
+ /**
11
+ * Model slug
12
+ */
13
+ id: string;
14
+ };
15
+ /** @internal */
16
+ export declare const ImageModelEndpointsResponse$inboundSchema: z.ZodType<ImageModelEndpointsResponse, unknown>;
17
+ export declare function imageModelEndpointsResponseFromJSON(jsonString: string): SafeParseResult<ImageModelEndpointsResponse, SDKValidationError>;
18
+ //# sourceMappingURL=imagemodelendpointsresponse.d.ts.map
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 77af9d23f8cb
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ImageEndpoint$inboundSchema } from "./imageendpoint.js";
8
+ /** @internal */
9
+ export const ImageModelEndpointsResponse$inboundSchema = z.object({
10
+ endpoints: z.array(ImageEndpoint$inboundSchema),
11
+ id: z.string(),
12
+ });
13
+ export function imageModelEndpointsResponseFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => ImageModelEndpointsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageModelEndpointsResponse' from JSON`);
15
+ }
16
+ //# sourceMappingURL=imagemodelendpointsresponse.js.map
@@ -0,0 +1,42 @@
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 { ImageModelArchitecture } from "./imagemodelarchitecture.js";
6
+ /**
7
+ * A single image model in the discovery listing.
8
+ */
9
+ export type ImageModelListItem = {
10
+ architecture: ImageModelArchitecture;
11
+ /**
12
+ * Unix timestamp (seconds) of when the model was created
13
+ */
14
+ created: number;
15
+ description: string;
16
+ /**
17
+ * Relative URL to the full per-endpoint records for this model
18
+ */
19
+ endpoints: string;
20
+ /**
21
+ * Model slug
22
+ */
23
+ id: string;
24
+ /**
25
+ * Display name
26
+ */
27
+ name: string;
28
+ /**
29
+ * Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL.
30
+ */
31
+ supportedParameters: {
32
+ [k: string]: CapabilityDescriptor;
33
+ };
34
+ /**
35
+ * Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints.
36
+ */
37
+ supportsStreaming: boolean;
38
+ };
39
+ /** @internal */
40
+ export declare const ImageModelListItem$inboundSchema: z.ZodType<ImageModelListItem, unknown>;
41
+ export declare function imageModelListItemFromJSON(jsonString: string): SafeParseResult<ImageModelListItem, SDKValidationError>;
42
+ //# sourceMappingURL=imagemodellistitem.d.ts.map
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 12f1f7100366
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 { ImageModelArchitecture$inboundSchema, } from "./imagemodelarchitecture.js";
10
+ /** @internal */
11
+ export const ImageModelListItem$inboundSchema = z.object({
12
+ architecture: ImageModelArchitecture$inboundSchema,
13
+ created: z.int(),
14
+ description: z.string(),
15
+ endpoints: z.string(),
16
+ id: z.string(),
17
+ name: z.string(),
18
+ supported_parameters: z.record(z.string(), CapabilityDescriptor$inboundSchema),
19
+ supports_streaming: z.boolean(),
20
+ }).transform((v) => {
21
+ return remap$(v, {
22
+ "supported_parameters": "supportedParameters",
23
+ "supports_streaming": "supportsStreaming",
24
+ });
25
+ });
26
+ export function imageModelListItemFromJSON(jsonString) {
27
+ return safeParse(jsonString, (x) => ImageModelListItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageModelListItem' from JSON`);
28
+ }
29
+ //# sourceMappingURL=imagemodellistitem.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
+ import { ImageModelListItem } from "./imagemodellistitem.js";
5
+ /**
6
+ * List of image generation models.
7
+ */
8
+ export type ImageModelsListResponse = {
9
+ data: Array<ImageModelListItem>;
10
+ };
11
+ /** @internal */
12
+ export declare const ImageModelsListResponse$inboundSchema: z.ZodType<ImageModelsListResponse, unknown>;
13
+ export declare function imageModelsListResponseFromJSON(jsonString: string): SafeParseResult<ImageModelsListResponse, SDKValidationError>;
14
+ //# sourceMappingURL=imagemodelslistresponse.d.ts.map
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 635379f06ace
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ImageModelListItem$inboundSchema, } from "./imagemodellistitem.js";
8
+ /** @internal */
9
+ export const ImageModelsListResponse$inboundSchema = z.object({
10
+ data: z.array(ImageModelListItem$inboundSchema),
11
+ });
12
+ export function imageModelsListResponseFromJSON(jsonString) {
13
+ return safeParse(jsonString, (x) => ImageModelsListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageModelsListResponse' from JSON`);
14
+ }
15
+ //# sourceMappingURL=imagemodelslistresponse.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const ImageOutputModality: {
4
+ readonly Text: "text";
5
+ readonly Image: "image";
6
+ readonly Embeddings: "embeddings";
7
+ readonly Audio: "audio";
8
+ readonly Video: "video";
9
+ readonly Rerank: "rerank";
10
+ readonly Speech: "speech";
11
+ readonly Transcription: "transcription";
12
+ };
13
+ export type ImageOutputModality = OpenEnum<typeof ImageOutputModality>;
14
+ /** @internal */
15
+ export declare const ImageOutputModality$inboundSchema: z.ZodType<ImageOutputModality, unknown>;
16
+ //# sourceMappingURL=imageoutputmodality.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7af79a028664
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ export const ImageOutputModality = {
7
+ Text: "text",
8
+ Image: "image",
9
+ Embeddings: "embeddings",
10
+ Audio: "audio",
11
+ Video: "video",
12
+ Rerank: "rerank",
13
+ Speech: "speech",
14
+ Transcription: "transcription",
15
+ };
16
+ /** @internal */
17
+ export const ImageOutputModality$inboundSchema = openEnums.inboundSchema(ImageOutputModality);
18
+ //# sourceMappingURL=imageoutputmodality.js.map
@@ -0,0 +1,35 @@
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 Billable: {
6
+ readonly OutputImage: "output_image";
7
+ readonly InputImage: "input_image";
8
+ readonly InputFont: "input_font";
9
+ readonly InputReference: "input_reference";
10
+ readonly InputText: "input_text";
11
+ };
12
+ export type Billable = OpenEnum<typeof Billable>;
13
+ export declare const Unit: {
14
+ readonly Image: "image";
15
+ readonly Megapixel: "megapixel";
16
+ readonly Token: "token";
17
+ };
18
+ export type Unit = OpenEnum<typeof Unit>;
19
+ /**
20
+ * One billable pricing line for an image provider.
21
+ */
22
+ export type ImagePricingEntry = {
23
+ billable: Billable;
24
+ costUsd: number;
25
+ unit: Unit;
26
+ variant?: string | undefined;
27
+ };
28
+ /** @internal */
29
+ export declare const Billable$inboundSchema: z.ZodType<Billable, unknown>;
30
+ /** @internal */
31
+ export declare const Unit$inboundSchema: z.ZodType<Unit, unknown>;
32
+ /** @internal */
33
+ export declare const ImagePricingEntry$inboundSchema: z.ZodType<ImagePricingEntry, unknown>;
34
+ export declare function imagePricingEntryFromJSON(jsonString: string): SafeParseResult<ImagePricingEntry, SDKValidationError>;
35
+ //# sourceMappingURL=imagepricingentry.d.ts.map
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7a0d3f05b12c
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 Billable = {
10
+ OutputImage: "output_image",
11
+ InputImage: "input_image",
12
+ InputFont: "input_font",
13
+ InputReference: "input_reference",
14
+ InputText: "input_text",
15
+ };
16
+ export const Unit = {
17
+ Image: "image",
18
+ Megapixel: "megapixel",
19
+ Token: "token",
20
+ };
21
+ /** @internal */
22
+ export const Billable$inboundSchema = openEnums
23
+ .inboundSchema(Billable);
24
+ /** @internal */
25
+ export const Unit$inboundSchema = openEnums
26
+ .inboundSchema(Unit);
27
+ /** @internal */
28
+ export const ImagePricingEntry$inboundSchema = z.object({
29
+ billable: Billable$inboundSchema,
30
+ cost_usd: z.number(),
31
+ unit: Unit$inboundSchema,
32
+ variant: z.string().optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "cost_usd": "costUsd",
36
+ });
37
+ });
38
+ export function imagePricingEntryFromJSON(jsonString) {
39
+ return safeParse(jsonString, (x) => ImagePricingEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImagePricingEntry' from JSON`);
40
+ }
41
+ //# sourceMappingURL=imagepricingentry.js.map
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { ImageGenCompletedEvent } from "./imagegencompletedevent.js";
6
+ import { ImageGenPartialImageEvent } from "./imagegenpartialimageevent.js";
7
+ import { ImageGenStreamErrorEvent } from "./imagegenstreamerrorevent.js";
8
+ export type ImageStreamingResponseData = ImageGenPartialImageEvent | ImageGenCompletedEvent | ImageGenStreamErrorEvent | discriminatedUnionTypes.Unknown<"type">;
9
+ export type ImageStreamingResponse = {
10
+ data: ImageGenPartialImageEvent | ImageGenCompletedEvent | ImageGenStreamErrorEvent | discriminatedUnionTypes.Unknown<"type">;
11
+ };
12
+ /** @internal */
13
+ export declare const ImageStreamingResponseData$inboundSchema: z.ZodType<ImageStreamingResponseData, unknown>;
14
+ export declare function imageStreamingResponseDataFromJSON(jsonString: string): SafeParseResult<ImageStreamingResponseData, SDKValidationError>;
15
+ /** @internal */
16
+ export declare const ImageStreamingResponse$inboundSchema: z.ZodType<ImageStreamingResponse, unknown>;
17
+ export declare function imageStreamingResponseFromJSON(jsonString: string): SafeParseResult<ImageStreamingResponse, SDKValidationError>;
18
+ //# sourceMappingURL=imagestreamingresponse.d.ts.map
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 845661ccae1f
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { discriminatedUnion } from "../types/discriminatedUnion.js";
8
+ import { ImageGenCompletedEvent$inboundSchema, } from "./imagegencompletedevent.js";
9
+ import { ImageGenPartialImageEvent$inboundSchema, } from "./imagegenpartialimageevent.js";
10
+ import { ImageGenStreamErrorEvent$inboundSchema, } from "./imagegenstreamerrorevent.js";
11
+ /** @internal */
12
+ export const ImageStreamingResponseData$inboundSchema = discriminatedUnion("type", {
13
+ ["image_generation.partial_image"]: ImageGenPartialImageEvent$inboundSchema,
14
+ ["image_generation.completed"]: ImageGenCompletedEvent$inboundSchema,
15
+ error: ImageGenStreamErrorEvent$inboundSchema,
16
+ });
17
+ export function imageStreamingResponseDataFromJSON(jsonString) {
18
+ return safeParse(jsonString, (x) => ImageStreamingResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageStreamingResponseData' from JSON`);
19
+ }
20
+ /** @internal */
21
+ export const ImageStreamingResponse$inboundSchema = z.object({
22
+ data: z.string().transform((v, ctx) => {
23
+ try {
24
+ return JSON.parse(v);
25
+ }
26
+ catch (err) {
27
+ ctx.addIssue({
28
+ input: v,
29
+ code: "custom",
30
+ message: `malformed json: ${err}`,
31
+ });
32
+ return z.NEVER;
33
+ }
34
+ }).pipe(discriminatedUnion("type", {
35
+ ["image_generation.partial_image"]: ImageGenPartialImageEvent$inboundSchema,
36
+ ["image_generation.completed"]: ImageGenCompletedEvent$inboundSchema,
37
+ error: ImageGenStreamErrorEvent$inboundSchema,
38
+ })),
39
+ });
40
+ export function imageStreamingResponseFromJSON(jsonString) {
41
+ return safeParse(jsonString, (x) => ImageStreamingResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageStreamingResponse' from JSON`);
42
+ }
43
+ //# sourceMappingURL=imagestreamingresponse.js.map