@mynthio/sdk 0.0.40 → 0.0.42

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 (44) hide show
  1. package/README.md +20 -4
  2. package/dist/convex/index.d.ts +39 -100
  3. package/dist/convex/index.js +41 -2
  4. package/dist/handler.d.ts +28 -0
  5. package/dist/handler.js +121 -0
  6. package/dist/index.d.ts +701 -360
  7. package/dist/index.js +1514 -2
  8. package/dist/next/index.d.ts +14 -24
  9. package/dist/next/index.js +25 -2
  10. package/dist/tanstack-start/index.d.ts +18 -23
  11. package/dist/tanstack-start/index.js +11 -2
  12. package/dist/types.d.ts +609 -660
  13. package/package.json +16 -21
  14. package/dist/client.d.ts +0 -41
  15. package/dist/client.d.ts.map +0 -1
  16. package/dist/constants.d.ts +0 -95
  17. package/dist/constants.d.ts.map +0 -1
  18. package/dist/convex/index.d.ts.map +0 -1
  19. package/dist/convex/utils.d.ts +0 -2
  20. package/dist/convex/utils.d.ts.map +0 -1
  21. package/dist/image-alt-result.d.ts +0 -19
  22. package/dist/image-alt-result.d.ts.map +0 -1
  23. package/dist/image-generation-result.d.ts +0 -58
  24. package/dist/image-generation-result.d.ts.map +0 -1
  25. package/dist/image-rate-result.d.ts +0 -21
  26. package/dist/image-rate-result.d.ts.map +0 -1
  27. package/dist/image-remove-background-result.d.ts +0 -24
  28. package/dist/image-remove-background-result.d.ts.map +0 -1
  29. package/dist/image-review-result.d.ts +0 -28
  30. package/dist/image-review-result.d.ts.map +0 -1
  31. package/dist/index-apss16tr.js +0 -3
  32. package/dist/index-ty295921.js +0 -3
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/next/index.d.ts.map +0 -1
  35. package/dist/tanstack-start/index.d.ts.map +0 -1
  36. package/dist/task-async.d.ts +0 -95
  37. package/dist/task-async.d.ts.map +0 -1
  38. package/dist/types.d.ts.map +0 -1
  39. package/dist/uploads.d.ts +0 -31
  40. package/dist/uploads.d.ts.map +0 -1
  41. package/dist/video-generation-result.d.ts +0 -46
  42. package/dist/video-generation-result.d.ts.map +0 -1
  43. package/dist/webhooks/utils.d.ts +0 -5
  44. package/dist/webhooks/utils.d.ts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,34 +1,375 @@
1
- import { MynthAPIError } from "./client";
2
- import type { AvailableModel, ModelCapability } from "./constants";
3
- import type { AvailableVideoModel, VideoInputRole, VideoResolutionTier } from "./constants";
4
- import { AVAILABLE_MODELS, AVAILABLE_VIDEO_MODELS } from "./constants";
5
- import { ImageAltResult } from "./image-alt-result";
6
- import { ImageGenerationResult } from "./image-generation-result";
7
- import { ImageRateResult } from "./image-rate-result";
8
- import { ImageRemoveBackgroundResult } from "./image-remove-background-result";
9
- import { ImageReviewResult } from "./image-review-result";
10
- import type { TaskAsyncAccess } from "./task-async";
11
- import { TaskAsync, TaskAsyncFetchError, TaskAsyncTaskFailedError, TaskAsyncTaskFetchError, TaskAsyncTimeoutError, TaskAsyncUnauthorizedError } from "./task-async";
12
- import type { MynthSDKTypes } from "./types";
13
- import { VideoGenerationResult } from "./video-generation-result";
1
+ import { a as AvailableVideoModel, c as VideoResolutionTier, i as AvailableModel, n as AVAILABLE_MODELS, o as ModelCapability, r as AVAILABLE_VIDEO_MODELS, s as VideoInputRole, t as MynthSDKTypes } from "./types.js";
2
+ //#region src/client.d.ts
3
+ /**
4
+ * Error thrown when an API request fails.
5
+ */
6
+ export declare class MynthAPIError extends Error {
7
+ /** HTTP status code of the failed request */
8
+ readonly status: number;
9
+ /** Error code from the API response, if available */
10
+ readonly code?: string | undefined;
11
+ constructor(message: string, status: number, code?: string);
12
+ }
13
+ type MynthClientRequestOptions = {
14
+ headers?: Record<string, string>;
15
+ accessToken?: string | undefined;
16
+ auth?: boolean | undefined;
17
+ signal?: AbortSignal | undefined;
18
+ };
19
+ /**
20
+ * Internal HTTP client for making API requests.
21
+ * @internal
22
+ */
23
+ declare class MynthClient {
24
+ private readonly apiKey;
25
+ private readonly baseUrl;
26
+ constructor(options: {
27
+ apiKey?: string | undefined;
28
+ baseUrl?: string | undefined;
29
+ });
30
+ getAuthHeaders(override?: Pick<MynthClientRequestOptions, "accessToken" | "auth">): Record<string, string>;
31
+ getUrl(path: string): string;
32
+ post<DataType>(path: string, data: unknown, { signal }?: Pick<MynthClientRequestOptions, "signal">): Promise<DataType>;
33
+ get<DataType>(path: string, { headers, accessToken, auth, signal }?: MynthClientRequestOptions): Promise<{
34
+ data: DataType;
35
+ status: number;
36
+ ok: boolean;
37
+ }>;
38
+ getOrThrow<DataType>(path: string, options?: MynthClientRequestOptions): Promise<DataType>;
39
+ }
40
+ //#endregion
41
+ //#region src/image-alt-result.d.ts
42
+ /**
43
+ * Represents the result of a completed image alt text task.
44
+ */
45
+ export declare class ImageAltResult {
46
+ /** The task ID created for this alt text request */
47
+ readonly taskId: string;
48
+ /** Cost charged for the completed task */
49
+ readonly cost: string;
50
+ /** Generated alt text */
51
+ readonly alt: string;
52
+ constructor(data: {
53
+ taskId: string;
54
+ cost: string;
55
+ alt: string;
56
+ });
57
+ static fromTaskData(data: MynthSDKTypes.ImageAltTaskData): ImageAltResult;
58
+ }
59
+ //#endregion
60
+ //#region src/image-generation-result.d.ts
61
+ type TypedImageResultImageSuccess<RatingT> = Omit<MynthSDKTypes.ImageResultImageSuccess, "rating"> & {
62
+ rating?: RatingT;
63
+ };
64
+ type TypedImageResultImageFailure = MynthSDKTypes.ImageResultImageFailure;
65
+ type TypedImageResultImage<RatingT> = TypedImageResultImageSuccess<RatingT> | TypedImageResultImageFailure;
66
+ type TypedImageResult<RatingT> = Omit<MynthSDKTypes.ImageResult, "images"> & {
67
+ images: TypedImageResultImage<RatingT>[];
68
+ };
69
+ /**
70
+ * Represents a completed image generation task.
71
+ *
72
+ * @template MetadataT - Type of the metadata attached to the request
73
+ * @template RatingT - Type of the rating response
74
+ */
75
+ export declare class ImageGenerationResult<MetadataT = Record<string, unknown> | undefined, RatingT = MynthSDKTypes.ImageResultRating | undefined> {
76
+ /** Raw task data from the API */
77
+ readonly data: MynthSDKTypes.ImageGenerationTaskData;
78
+ constructor(data: MynthSDKTypes.ImageGenerationTaskData);
79
+ /** Unique identifier for this task */
80
+ get id(): string;
81
+ /** Current status of the task */
82
+ get status(): MynthSDKTypes.TaskStatus;
83
+ /**
84
+ * The generation result containing images, cost, and model info.
85
+ * Returns `null` if the task hasn't completed yet.
86
+ */
87
+ get result(): TypedImageResult<RatingT> | null;
88
+ /** Whether the task completed successfully */
89
+ get isCompleted(): boolean;
90
+ /** Whether the task failed */
91
+ get isFailed(): boolean;
92
+ /**
93
+ * Get all successfully generated image URLs.
94
+ * Convenience method that extracts just the URLs from successful images.
95
+ * Images delivered only to a user destination may have a `null` url and are omitted here;
96
+ * use `getImages()` and read `mynth_url` to access the CDN URL directly.
97
+ */
98
+ get urls(): string[];
99
+ /**
100
+ * Get generated images from the task result.
101
+ *
102
+ * @param options.includeFailed - If true, includes failed image results
103
+ * @returns Array of image results
104
+ */
105
+ getImages(options: {
106
+ includeFailed: true;
107
+ }): TypedImageResultImage<RatingT>[];
108
+ getImages(options?: {
109
+ includeFailed?: false;
110
+ }): TypedImageResultImageSuccess<RatingT>[];
111
+ /**
112
+ * Get the metadata that was attached to the generation request.
113
+ */
114
+ getMetadata(): MetadataT;
115
+ }
116
+ //#endregion
117
+ //#region src/image-rate-result.d.ts
118
+ /**
119
+ * Represents the result of a completed image content rating task.
120
+ *
121
+ * @template LevelT - Union of possible rating level strings (e.g. `"sfw" | "nsfw"`)
122
+ */
123
+ export declare class ImageRateResult<LevelT extends string = "sfw" | "nsfw"> {
124
+ /** The task ID created for this rating request */
125
+ readonly taskId: string;
126
+ /** Cost charged for the completed task */
127
+ readonly cost: string;
128
+ /** Assigned rating level */
129
+ readonly level: LevelT;
130
+ constructor(data: {
131
+ taskId: string;
132
+ cost: string;
133
+ level: LevelT;
134
+ });
135
+ static fromTaskData<LevelT extends string = "sfw" | "nsfw">(data: MynthSDKTypes.ImageRateTaskData): ImageRateResult<LevelT>;
136
+ }
137
+ //#endregion
138
+ //#region src/image-remove-background-result.d.ts
139
+ /**
140
+ * Represents the result of a completed image background removal task.
141
+ *
142
+ * @template MetadataT - Type of the metadata attached to the request
143
+ */
144
+ export declare class ImageRemoveBackgroundResult<MetadataT = Record<string, unknown> | undefined> {
145
+ /** The task ID created for this request */
146
+ readonly taskId: string;
147
+ /** Cost charged for the completed task */
148
+ readonly cost: string;
149
+ /** The image with its background removed */
150
+ readonly image: MynthSDKTypes.ImageRemoveBackgroundResultImage;
151
+ /** Metadata attached to the request */
152
+ readonly metadata: MetadataT;
153
+ constructor(data: {
154
+ taskId: string;
155
+ cost: string;
156
+ image: MynthSDKTypes.ImageRemoveBackgroundResultImage;
157
+ metadata: MetadataT;
158
+ });
159
+ static fromTaskData<MetadataT = Record<string, unknown> | undefined>(data: MynthSDKTypes.ImageRemoveBackgroundTaskData): ImageRemoveBackgroundResult<MetadataT>;
160
+ }
161
+ //#endregion
162
+ //#region src/image-review-result.d.ts
163
+ /**
164
+ * Represents the result of a completed image quality review task.
165
+ */
166
+ export declare class ImageReviewResult {
167
+ /** The task ID created for this review request */
168
+ readonly taskId: string;
169
+ /** Cost charged for the completed task */
170
+ readonly cost: string;
171
+ /** Median reviewer score from 1 to 4. Higher is better. */
172
+ readonly score: number;
173
+ /** Review summary */
174
+ readonly summary: string;
175
+ /** Defects found by the reviewer panel */
176
+ readonly findings: MynthSDKTypes.ImageReviewFinding[];
177
+ /** Strengths identified by the reviewer panel */
178
+ readonly strengths: MynthSDKTypes.ImageReviewStrength[];
179
+ constructor(data: {
180
+ taskId: string;
181
+ cost: string;
182
+ score: number;
183
+ summary: string;
184
+ findings: MynthSDKTypes.ImageReviewFinding[];
185
+ strengths: MynthSDKTypes.ImageReviewStrength[];
186
+ });
187
+ static fromTaskData(data: MynthSDKTypes.ImageReviewTaskData): ImageReviewResult;
188
+ }
189
+ //#endregion
190
+ //#region src/task-async.d.ts
191
+ /**
192
+ * Polling cadence overrides. Anything omitted keeps the image-task default.
193
+ */
194
+ type TaskAsyncPolling = {
195
+ /** Total wait budget before `TaskAsyncTimeoutError`. */
196
+ timeoutMs?: number;
197
+ /** How long the opening fast-polling phase lasts. `0` disables it. */
198
+ fastDurationMs?: number;
199
+ /** Interval used during the fast phase. */
200
+ fastIntervalMs?: number;
201
+ /** Interval used after the fast phase. */
202
+ intervalMs?: number;
203
+ };
204
+ /**
205
+ * Error thrown when task polling exceeds the maximum timeout duration.
206
+ */
207
+ export declare class TaskAsyncTimeoutError extends Error {
208
+ constructor(taskId: string, timeoutMs?: number);
209
+ }
210
+ /**
211
+ * Error thrown when access to a task is denied (invalid API key or PAT).
212
+ */
213
+ export declare class TaskAsyncUnauthorizedError extends Error {
214
+ constructor(taskId: string);
215
+ }
216
+ /**
217
+ * Error thrown when fetching task status fails after multiple retries.
218
+ */
219
+ export declare class TaskAsyncFetchError extends Error {
220
+ constructor(taskId: string, cause?: Error);
221
+ }
222
+ /**
223
+ * Error thrown when fetching full task data fails.
224
+ */
225
+ export declare class TaskAsyncTaskFetchError extends Error {
226
+ constructor(taskId: string, status?: number, cause?: Error);
227
+ }
228
+ /**
229
+ * Error thrown when a task fails before completion.
230
+ */
231
+ export declare class TaskAsyncTaskFailedError extends Error {
232
+ constructor(taskId: string);
233
+ }
234
+ /**
235
+ * Options for {@link TaskAsync.wait}.
236
+ */
237
+ type TaskAsyncWaitOptions = {
238
+ /**
239
+ * Stops this wait when aborted, rejecting with the signal's reason. Polling
240
+ * stops as well once no other `wait()` call is still waiting on the task.
241
+ * Aborting never cancels the task itself: Mynth keeps generating it.
242
+ */
243
+ signal?: AbortSignal | undefined;
244
+ };
245
+ /**
246
+ * Public access information for a task, used for client-side polling.
247
+ */
248
+ type TaskAsyncAccess = {
249
+ /** Public access token for client-side status polling */
250
+ publicAccessToken?: string | undefined;
251
+ };
252
+ /**
253
+ * Represents an async task that can be polled for completion.
254
+ * Use `wait()` to poll until completion and get the typed result.
255
+ *
256
+ * @template ResultT - The result type returned once the task completes
257
+ */
258
+ export declare class TaskAsync<ResultT> {
259
+ /** The unique identifier for this task */
260
+ readonly id: string;
261
+ private readonly client;
262
+ private readonly _access;
263
+ private readonly resultFactory;
264
+ private readonly polling;
265
+ private poll;
266
+ constructor(id: string, options: {
267
+ client: MynthClient;
268
+ pat?: string | undefined;
269
+ resultFactory: (data: MynthSDKTypes.TaskData) => ResultT;
270
+ polling?: TaskAsyncPolling;
271
+ });
272
+ /**
273
+ * Public access information for client-side polling.
274
+ * Contains the public access token if one was generated.
275
+ */
276
+ get access(): TaskAsyncAccess;
277
+ toString(): string;
278
+ /**
279
+ * Polls the task until completion and returns the typed result.
280
+ * Concurrent calls share one polling loop and settle with the same result.
281
+ *
282
+ * @param options.signal - Stops this wait when aborted (see {@link TaskAsyncWaitOptions})
283
+ * @throws {TaskAsyncTimeoutError} If polling exceeds the timeout
284
+ * @throws {TaskAsyncUnauthorizedError} If access is denied
285
+ * @throws {TaskAsyncFetchError} If fetching status fails repeatedly
286
+ * @throws {TaskAsyncTaskFetchError} If fetching the completed task fails
287
+ * @throws {TaskAsyncTaskFailedError} If the task fails before completion
288
+ */
289
+ wait({ signal }?: TaskAsyncWaitOptions): Promise<ResultT>;
290
+ private startPoll;
291
+ private pollUntilCompleted;
292
+ private fetchStatus;
293
+ private fetchTask;
294
+ private sleep;
295
+ }
296
+ //#endregion
297
+ //#region src/video-generation-result.d.ts
298
+ /**
299
+ * Represents a completed video generation task.
300
+ *
301
+ * @template MetadataT - Type of the metadata attached to the request
302
+ */
303
+ export declare class VideoGenerationResult<MetadataT = Record<string, unknown> | undefined> {
304
+ /** Raw task data from the API */
305
+ readonly data: MynthSDKTypes.VideoGenerationTaskData;
306
+ constructor(data: MynthSDKTypes.VideoGenerationTaskData);
307
+ /** Unique identifier for this task */
308
+ get id(): string;
309
+ /** Current status of the task */
310
+ get status(): MynthSDKTypes.TaskStatus;
311
+ /**
312
+ * The generation result containing videos and model info.
313
+ * Returns `null` if the task hasn't completed yet.
314
+ */
315
+ get result(): MynthSDKTypes.VideoResult | null;
316
+ /** Whether the task completed successfully */
317
+ get isCompleted(): boolean;
318
+ /** Whether the task failed */
319
+ get isFailed(): boolean;
320
+ /**
321
+ * Get all successfully generated video URLs.
322
+ * Convenience method that extracts just the URLs from successful videos.
323
+ */
324
+ get urls(): string[];
325
+ /**
326
+ * Get generated videos from the task result.
327
+ *
328
+ * @param options.includeFailed - If true, includes failed video results
329
+ * @returns Array of video results
330
+ */
331
+ getVideos(options: {
332
+ includeFailed: true;
333
+ }): MynthSDKTypes.VideoResultVideo[];
334
+ getVideos(options?: {
335
+ includeFailed?: false;
336
+ }): MynthSDKTypes.VideoResultVideoSuccess[];
337
+ /**
338
+ * Get the metadata that was attached to the generation request.
339
+ */
340
+ getMetadata(): MetadataT;
341
+ }
342
+ //#endregion
343
+ //#region src/index.d.ts
14
344
  /**
15
345
  * Configuration options for the Mynth client.
16
346
  */
17
347
  type MynthOptions = {
18
- /**
19
- * Your Mynth API key. If not provided, reads from MYNTH_API_KEY environment variable.
20
- */
21
- apiKey?: string;
22
- /**
23
- * Custom base URL for the API. Useful for proxies or testing.
24
- */
25
- baseUrl?: string;
26
- /**
27
- * Default destination name (slug) to deliver generated images to.
28
- * If not provided, reads from MYNTH_DESTINATION environment variable.
29
- * Can be overridden on a per-request basis via `request.destination`.
30
- */
31
- destination?: string;
348
+ /**
349
+ * Your Mynth API key. If not provided, reads from MYNTH_API_KEY environment variable.
350
+ */
351
+ apiKey?: string | undefined;
352
+ /**
353
+ * Custom base URL for the API. Useful for proxies or testing.
354
+ */
355
+ baseUrl?: string | undefined;
356
+ /**
357
+ * Default destination name (slug) to deliver generated images to.
358
+ * If not provided, reads from MYNTH_DESTINATION environment variable.
359
+ * Can be overridden on a per-request basis via `request.destination`.
360
+ */
361
+ destination?: string | undefined;
362
+ };
363
+ /**
364
+ * Per-call options for SDK methods that talk to the API.
365
+ */
366
+ type MynthRequestOptions = {
367
+ /**
368
+ * Aborts the call: pending uploads and API requests are cancelled, and a
369
+ * method that waits for completion stops polling. A task that was already
370
+ * created keeps running on Mynth.
371
+ */
372
+ signal?: AbortSignal | undefined;
32
373
  };
33
374
  type MynthModel = MynthSDKTypes.Model;
34
375
  type MynthModelPricing = MynthSDKTypes.ModelPricing;
@@ -37,31 +378,31 @@ type ExtractVideoMetadata<T extends MynthSDKTypes.VideoGenerationClientRequest>
37
378
  type ExtractRemoveBackgroundMetadata<T extends MynthSDKTypes.ImageRemoveBackgroundClientRequest> = T["metadata"];
38
379
  type ExtractRatingConfig<T extends MynthSDKTypes.ImageGenerationClientRequest> = T["rating"];
39
380
  type ExtractRatingLevels<T extends MynthSDKTypes.ImageGenerationClientRequest> = ExtractRatingConfig<T> extends {
40
- levels: readonly (infer L)[];
381
+ levels: readonly (infer L)[];
41
382
  } ? L : ExtractRatingConfig<T> extends {
42
- levels: (infer L)[];
383
+ levels: (infer L)[];
43
384
  } ? L : never;
44
385
  type ExtractRatingLevelValues<T extends MynthSDKTypes.ImageGenerationClientRequest> = ExtractRatingLevels<T> extends {
45
- value: infer V;
386
+ value: infer V;
46
387
  } ? (V extends string ? V : never) : never;
47
388
  type IsRatingCustom<T extends MynthSDKTypes.ImageGenerationClientRequest> = ExtractRatingConfig<T> extends {
48
- mode: "custom";
49
- levels: readonly any[] | any[];
389
+ mode: "custom";
390
+ levels: readonly any[] | any[];
50
391
  } ? true : false;
51
392
  type ExtractRatingResponse<T extends MynthSDKTypes.ImageGenerationClientRequest> = IsRatingCustom<T> extends true ? {
52
- status: "success";
53
- level: ExtractRatingLevelValues<T>;
393
+ status: "success";
394
+ level: ExtractRatingLevelValues<T>;
54
395
  } | MynthSDKTypes.ImageResultRatingFailure : ExtractRatingConfig<T> extends true | {
55
- mode: "nsfw_sfw";
396
+ mode: "nsfw_sfw";
56
397
  } ? {
57
- status: "success";
58
- level: MynthSDKTypes.ImageResultRatingDefaultLevel;
398
+ status: "success";
399
+ level: MynthSDKTypes.ImageResultRatingDefaultLevel;
59
400
  } | MynthSDKTypes.ImageResultRatingFailure : MynthSDKTypes.ImageResultRating | undefined;
60
401
  type ExtractRateLevelValues<T extends MynthSDKTypes.ImageRateClientRequest> = T extends {
61
- mode: "custom";
62
- levels: readonly {
63
- value: infer V;
64
- }[];
402
+ mode: "custom";
403
+ levels: readonly {
404
+ value: infer V;
405
+ }[];
65
406
  } ? V extends string ? V : string : MynthSDKTypes.ImageResultRatingDefaultLevel;
66
407
  /**
67
408
  * Client for interacting with the Mynth image generation and analysis APIs.
@@ -84,196 +425,198 @@ type ExtractRateLevelValues<T extends MynthSDKTypes.ImageRateClientRequest> = T
84
425
  * ```
85
426
  */
86
427
  declare class MynthImage {
87
- private readonly client;
88
- private readonly defaultDestination?;
89
- /**
90
- * Creates a new MynthImage client instance.
91
- *
92
- * @param options - Configuration options
93
- * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
94
- * @param options.baseUrl - Custom API base URL
95
- * @param options.destination - Default destination name (defaults to MYNTH_DESTINATION env var)
96
- * @throws {Error} If no API key is provided and MYNTH_API_KEY is not set
97
- */
98
- constructor(options?: MynthOptions);
99
- /**
100
- * Generate images from a text prompt.
101
- *
102
- * @param request - Image generation request parameters
103
- * @returns A completed ImageGenerationResult with the generation results
104
- *
105
- * @example
106
- * ```typescript
107
- * const result = await image.generate({
108
- * prompt: "A serene lake at dawn",
109
- * model: "black-forest-labs/flux.1-dev",
110
- * });
111
- * console.log(result.urls);
112
- * ```
113
- */
114
- generate<const T extends MynthSDKTypes.ImageGenerationClientRequest>(request: T): Promise<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>;
115
- /**
116
- * Upload one or more images to Mynth temporary input storage.
117
- *
118
- * Accepts File/Blob or an array of File/Blob inputs.
119
- *
120
- * @param input - Image input or inputs to upload
121
- * @returns Uploaded image URLs that can be passed to generation `inputs`
122
- *
123
- * @example
124
- * ```typescript
125
- * const { urls } = await image.upload(file);
126
- * await image.generate({ prompt: "Use this reference", inputs: urls });
127
- * ```
128
- */
129
- upload(input: MynthSDKTypes.ImageUploadInput | readonly MynthSDKTypes.ImageUploadInput[]): Promise<MynthSDKTypes.ImageUploadResponse>;
130
- /**
131
- * Start image generation without waiting for completion.
132
- *
133
- * @param request - Image generation request parameters
134
- * @returns A TaskAsync that can be polled for completion via `.wait()`
135
- *
136
- * @example
137
- * ```typescript
138
- * const taskAsync = await image.generateAsync({
139
- * prompt: "A futuristic cityscape",
140
- * });
141
- *
142
- * return { id: taskAsync.id, access: taskAsync.access };
143
- * ```
144
- */
145
- generateAsync<const T extends MynthSDKTypes.ImageGenerationClientRequest>(request: T): Promise<TaskAsync<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>>;
146
- private createGenerationTask;
147
- /**
148
- * Rate the content of a single image.
149
- *
150
- * Uses AI classification to assign a rating level. Mode defaults to
151
- * `"nsfw_sfw"` (`"sfw"` / `"nsfw"`); pass custom `levels` to define your own scale.
152
- *
153
- * @param request - Image URL or local file, and optional rating mode
154
- * @returns An ImageRateResult with the assigned level
155
- *
156
- * @example
157
- * ```typescript
158
- * // Default sfw/nsfw (mode optional)
159
- * const result = await image.rate({ url: "https://..." });
160
- * console.log(result.level); // "sfw" | "nsfw"
161
- *
162
- * // Custom levels
163
- * const result = await image.rate({
164
- * url: "https://...",
165
- * mode: "custom",
166
- * levels: [
167
- * { value: "safe", description: "No explicit content" },
168
- * { value: "mature", description: "Adult themes, no nudity" },
169
- * { value: "explicit", description: "Contains nudity or graphic content" },
170
- * ] as const,
171
- * });
172
- * console.log(result.level); // "safe" | "mature" | "explicit"
173
- * ```
174
- */
175
- rate<const T extends MynthSDKTypes.ImageRateClientRequest>(request: T): Promise<ImageRateResult<ExtractRateLevelValues<T>>>;
176
- /**
177
- * Start image content rating without waiting for completion.
178
- *
179
- * @param request - Image URL or local file, and optional rating mode
180
- * @returns A TaskAsync that can be polled for completion via `.wait()`
181
- *
182
- * @example
183
- * ```typescript
184
- * const taskAsync = await image.rateAsync({ url: "https://..." });
185
- *
186
- * const result = await taskAsync.wait();
187
- * console.log(result.level);
188
- * ```
189
- */
190
- rateAsync<const T extends MynthSDKTypes.ImageRateClientRequest>(request: T): Promise<TaskAsync<ImageRateResult<ExtractRateLevelValues<T>>>>;
191
- private resolveUrlOrFile;
192
- private createRateTask;
193
- /**
194
- * Generate alt text for a single image.
195
- *
196
- * Uses AI image analysis to produce short alt text for the image.
197
- *
198
- * @param request - Image URL or local file
199
- * @returns An ImageAltResult with the generated alt text
200
- *
201
- * @example
202
- * ```typescript
203
- * const result = await image.alt({ url: "https://..." });
204
- * console.log(result.alt);
205
- * ```
206
- */
207
- alt(request: MynthSDKTypes.ImageAltClientRequest): Promise<ImageAltResult>;
208
- /**
209
- * Start image alt text generation without waiting for completion.
210
- *
211
- * @param request - Image URL or local file
212
- * @returns A TaskAsync that can be polled for completion via `.wait()`
213
- *
214
- * @example
215
- * ```typescript
216
- * const taskAsync = await image.altAsync({ url: "https://..." });
217
- *
218
- * const result = await taskAsync.wait();
219
- * console.log(result.alt);
220
- * ```
221
- */
222
- altAsync(request: MynthSDKTypes.ImageAltClientRequest): Promise<TaskAsync<ImageAltResult>>;
223
- private createAltTask;
224
- /**
225
- * Review a single image with a multi-model quality panel.
226
- *
227
- * @param request - Image URL or local file, and optional review effort
228
- * @returns An ImageReviewResult with the score, summary, findings, and strengths
229
- *
230
- * @example
231
- * ```typescript
232
- * const result = await image.review({ url: "https://..." });
233
- * console.log(result.score); // 1–4, higher is better
234
- * console.log(result.findings);
235
- * ```
236
- */
237
- review(request: MynthSDKTypes.ImageReviewClientRequest): Promise<ImageReviewResult>;
238
- /**
239
- * Start an image quality review without waiting for completion.
240
- *
241
- * @param request - Image URL or local file, and optional review effort
242
- * @returns A TaskAsync that can be polled for completion via `.wait()`
243
- */
244
- reviewAsync(request: MynthSDKTypes.ImageReviewClientRequest): Promise<TaskAsync<ImageReviewResult>>;
245
- private createReviewTask;
246
- /**
247
- * Remove the background from a single image.
248
- *
249
- * Mynth picks the model. The result keeps the provider's format unless
250
- * `output.format` asks for `png` or `webp`.
251
- *
252
- * @param request - Image URL or local file, plus optional output, destination, webhook, and metadata
253
- * @returns An ImageRemoveBackgroundResult with the transparent image
254
- *
255
- * @example
256
- * ```typescript
257
- * const result = await image.removeBackground({ url: "https://..." });
258
- * console.log(result.image.url);
259
- * ```
260
- */
261
- removeBackground<const T extends MynthSDKTypes.ImageRemoveBackgroundClientRequest>(request: T): Promise<ImageRemoveBackgroundResult<ExtractRemoveBackgroundMetadata<T>>>;
262
- /**
263
- * Start background removal without waiting for completion.
264
- *
265
- * @param request - Image URL or local file, plus optional output, destination, webhook, and metadata
266
- * @returns A TaskAsync that can be polled for completion via `.wait()`
267
- *
268
- * @example
269
- * ```typescript
270
- * const taskAsync = await image.removeBackgroundAsync({ url: "https://..." });
271
- *
272
- * return { id: taskAsync.id, access: taskAsync.access };
273
- * ```
274
- */
275
- removeBackgroundAsync<const T extends MynthSDKTypes.ImageRemoveBackgroundClientRequest>(request: T): Promise<TaskAsync<ImageRemoveBackgroundResult<ExtractRemoveBackgroundMetadata<T>>>>;
276
- private createRemoveBackgroundTask;
428
+ private readonly client;
429
+ private readonly defaultDestination;
430
+ /**
431
+ * Creates a new MynthImage client instance.
432
+ *
433
+ * @param options - Configuration options
434
+ * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
435
+ * @param options.baseUrl - Custom API base URL
436
+ * @param options.destination - Default destination name (defaults to MYNTH_DESTINATION env var)
437
+ * @throws {Error} If no API key is provided and MYNTH_API_KEY is not set
438
+ */
439
+ constructor(options?: MynthOptions);
440
+ /**
441
+ * Generate images from a text prompt.
442
+ *
443
+ * @param request - Image generation request parameters
444
+ * @param options.signal - Aborts the upload, the create request, or the wait for completion
445
+ * @returns A completed ImageGenerationResult with the generation results
446
+ *
447
+ * @example
448
+ * ```typescript
449
+ * const result = await image.generate({
450
+ * prompt: "A serene lake at dawn",
451
+ * model: "black-forest-labs/flux.1-dev",
452
+ * });
453
+ * console.log(result.urls);
454
+ * ```
455
+ */
456
+ generate<const T extends MynthSDKTypes.ImageGenerationClientRequest>(request: T, options?: MynthRequestOptions): Promise<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>;
457
+ /**
458
+ * Upload one or more images to Mynth temporary input storage.
459
+ *
460
+ * Accepts File/Blob or an array of File/Blob inputs.
461
+ *
462
+ * @param input - Image input or inputs to upload
463
+ * @returns Uploaded image URLs that can be passed to generation `inputs`
464
+ *
465
+ * @example
466
+ * ```typescript
467
+ * const { urls } = await image.upload(file);
468
+ * await image.generate({ prompt: "Use this reference", inputs: urls });
469
+ * ```
470
+ */
471
+ upload(input: MynthSDKTypes.ImageUploadInput | readonly MynthSDKTypes.ImageUploadInput[]): Promise<MynthSDKTypes.ImageUploadResponse>;
472
+ /**
473
+ * Start image generation without waiting for completion.
474
+ *
475
+ * @param request - Image generation request parameters
476
+ * @param options.signal - Aborts the upload or the create request. Pass a signal to `.wait()` to abort the wait.
477
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
478
+ *
479
+ * @example
480
+ * ```typescript
481
+ * const taskAsync = await image.generateAsync({
482
+ * prompt: "A futuristic cityscape",
483
+ * });
484
+ *
485
+ * return { id: taskAsync.id, access: taskAsync.access };
486
+ * ```
487
+ */
488
+ generateAsync<const T extends MynthSDKTypes.ImageGenerationClientRequest>(request: T, options?: MynthRequestOptions): Promise<TaskAsync<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>>;
489
+ private createGenerationTask;
490
+ /**
491
+ * Rate the content of a single image.
492
+ *
493
+ * Uses AI classification to assign a rating level. Mode defaults to
494
+ * `"nsfw_sfw"` (`"sfw"` / `"nsfw"`); pass custom `levels` to define your own scale.
495
+ *
496
+ * @param request - Image URL or local file, and optional rating mode
497
+ * @returns An ImageRateResult with the assigned level
498
+ *
499
+ * @example
500
+ * ```typescript
501
+ * // Default sfw/nsfw (mode optional)
502
+ * const result = await image.rate({ url: "https://..." });
503
+ * console.log(result.level); // "sfw" | "nsfw"
504
+ *
505
+ * // Custom levels
506
+ * const result = await image.rate({
507
+ * url: "https://...",
508
+ * mode: "custom",
509
+ * levels: [
510
+ * { value: "safe", description: "No explicit content" },
511
+ * { value: "mature", description: "Adult themes, no nudity" },
512
+ * { value: "explicit", description: "Contains nudity or graphic content" },
513
+ * ] as const,
514
+ * });
515
+ * console.log(result.level); // "safe" | "mature" | "explicit"
516
+ * ```
517
+ */
518
+ rate<const T extends MynthSDKTypes.ImageRateClientRequest>(request: T): Promise<ImageRateResult<ExtractRateLevelValues<T>>>;
519
+ /**
520
+ * Start image content rating without waiting for completion.
521
+ *
522
+ * @param request - Image URL or local file, and optional rating mode
523
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
524
+ *
525
+ * @example
526
+ * ```typescript
527
+ * const taskAsync = await image.rateAsync({ url: "https://..." });
528
+ *
529
+ * const result = await taskAsync.wait();
530
+ * console.log(result.level);
531
+ * ```
532
+ */
533
+ rateAsync<const T extends MynthSDKTypes.ImageRateClientRequest>(request: T): Promise<TaskAsync<ImageRateResult<ExtractRateLevelValues<T>>>>;
534
+ private resolveUrlOrFile;
535
+ private createRateTask;
536
+ /**
537
+ * Generate alt text for a single image.
538
+ *
539
+ * Uses AI image analysis to produce short alt text for the image.
540
+ *
541
+ * @param request - Image URL or local file
542
+ * @returns An ImageAltResult with the generated alt text
543
+ *
544
+ * @example
545
+ * ```typescript
546
+ * const result = await image.alt({ url: "https://..." });
547
+ * console.log(result.alt);
548
+ * ```
549
+ */
550
+ alt(request: MynthSDKTypes.ImageAltClientRequest): Promise<ImageAltResult>;
551
+ /**
552
+ * Start image alt text generation without waiting for completion.
553
+ *
554
+ * @param request - Image URL or local file
555
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
556
+ *
557
+ * @example
558
+ * ```typescript
559
+ * const taskAsync = await image.altAsync({ url: "https://..." });
560
+ *
561
+ * const result = await taskAsync.wait();
562
+ * console.log(result.alt);
563
+ * ```
564
+ */
565
+ altAsync(request: MynthSDKTypes.ImageAltClientRequest): Promise<TaskAsync<ImageAltResult>>;
566
+ private createAltTask;
567
+ /**
568
+ * Review a single image with a multi-model quality panel.
569
+ *
570
+ * @param request - Image URL or local file, and optional review effort
571
+ * @returns An ImageReviewResult with the score, summary, findings, and strengths
572
+ *
573
+ * @example
574
+ * ```typescript
575
+ * const result = await image.review({ url: "https://..." });
576
+ * console.log(result.score); // 1–4, higher is better
577
+ * console.log(result.findings);
578
+ * ```
579
+ */
580
+ review(request: MynthSDKTypes.ImageReviewClientRequest): Promise<ImageReviewResult>;
581
+ /**
582
+ * Start an image quality review without waiting for completion.
583
+ *
584
+ * @param request - Image URL or local file, and optional review effort
585
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
586
+ */
587
+ reviewAsync(request: MynthSDKTypes.ImageReviewClientRequest): Promise<TaskAsync<ImageReviewResult>>;
588
+ private createReviewTask;
589
+ /**
590
+ * Remove the background from a single image.
591
+ *
592
+ * Mynth picks the model. The result keeps the provider's format unless
593
+ * `output.format` asks for `png` or `webp`.
594
+ *
595
+ * @param request - Image URL or local file, plus optional output, destination, webhook, and metadata
596
+ * @returns An ImageRemoveBackgroundResult with the transparent image
597
+ *
598
+ * @example
599
+ * ```typescript
600
+ * const result = await image.removeBackground({ url: "https://..." });
601
+ * console.log(result.image.url);
602
+ * ```
603
+ */
604
+ removeBackground<const T extends MynthSDKTypes.ImageRemoveBackgroundClientRequest>(request: T): Promise<ImageRemoveBackgroundResult<ExtractRemoveBackgroundMetadata<T>>>;
605
+ /**
606
+ * Start background removal without waiting for completion.
607
+ *
608
+ * @param request - Image URL or local file, plus optional output, destination, webhook, and metadata
609
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * const taskAsync = await image.removeBackgroundAsync({ url: "https://..." });
614
+ *
615
+ * return { id: taskAsync.id, access: taskAsync.access };
616
+ * ```
617
+ */
618
+ removeBackgroundAsync<const T extends MynthSDKTypes.ImageRemoveBackgroundClientRequest>(request: T): Promise<TaskAsync<ImageRemoveBackgroundResult<ExtractRemoveBackgroundMetadata<T>>>>;
619
+ private createRemoveBackgroundTask;
277
620
  }
278
621
  /**
279
622
  * Client for interacting with the Mynth video generation API.
@@ -297,119 +640,119 @@ declare class MynthImage {
297
640
  * ```
298
641
  */
299
642
  declare class MynthVideo {
300
- private readonly client;
301
- /**
302
- * Creates a new MynthVideo client instance.
303
- *
304
- * @param options - Configuration options
305
- * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
306
- * @param options.baseUrl - Custom API base URL
307
- * @throws {Error} If no API key is provided and MYNTH_API_KEY is not set
308
- */
309
- constructor(options?: Omit<MynthOptions, "destination">);
310
- /**
311
- * Generate a video from a text prompt, optionally guided by input images.
312
- *
313
- * Waits for the task to complete. Video generation is slow: this poll can
314
- * legitimately run for many minutes. Use `generateAsync()` (or a webhook)
315
- * when you cannot hold a request open that long.
316
- *
317
- * @param request - Video generation request parameters
318
- * @returns A completed VideoGenerationResult
319
- *
320
- * @example
321
- * ```typescript
322
- * const result = await video.generate({
323
- * model: "bytedance/seedance-2.0-mini",
324
- * prompt: "A drone shot over a misty forest at dawn",
325
- * });
326
- * console.log(result.urls);
327
- * ```
328
- */
329
- generate<const T extends MynthSDKTypes.VideoGenerationClientRequest>(request: T): Promise<VideoGenerationResult<ExtractVideoMetadata<T>>>;
330
- /**
331
- * Start video generation without waiting for completion.
332
- *
333
- * The preferred entry point for server code: hand `taskAsync.id` and
334
- * `taskAsync.access.publicAccessToken` to the browser, or register a webhook,
335
- * instead of holding a connection open for the length of a render.
336
- *
337
- * @param request - Video generation request parameters
338
- * @returns A TaskAsync that can be polled for completion via `.wait()`
339
- *
340
- * @example
341
- * ```typescript
342
- * const taskAsync = await video.generateAsync({
343
- * model: "prunaai/p-video",
344
- * prompt: "A neon city street in the rain",
345
- * });
346
- *
347
- * return { id: taskAsync.id, access: taskAsync.access };
348
- * ```
349
- */
350
- generateAsync<const T extends MynthSDKTypes.VideoGenerationClientRequest>(request: T): Promise<TaskAsync<VideoGenerationResult<ExtractVideoMetadata<T>>>>;
351
- /**
352
- * Upload one or more images to Mynth temporary input storage.
353
- *
354
- * Video inputs are images, so this is the same storage `image.upload()` uses.
355
- * Passing files straight to `generate()` uploads them for you; call this
356
- * directly only when you want to reuse the URLs across several requests.
357
- *
358
- * @param input - Image input or inputs to upload
359
- * @returns Uploaded image URLs that can be passed to generation `inputs`
360
- */
361
- upload(input: MynthSDKTypes.ImageUploadInput | readonly MynthSDKTypes.ImageUploadInput[]): Promise<MynthSDKTypes.ImageUploadResponse>;
362
- /**
363
- * Price a video generation request without generating anything.
364
- *
365
- * The request is validated exactly as `generate()` would validate it, so an
366
- * unsupported duration, resolution or input combination throws here too —
367
- * making this a cheap pre-flight check as well as a cost lookup. Because
368
- * video pins a concrete model, the returned estimate is exact.
369
- *
370
- * @param request - The same request you would pass to `generate()`
371
- * @returns The estimated cost in USD
372
- *
373
- * @example
374
- * ```typescript
375
- * const { estimatedCost } = await video.estimate({
376
- * model: "google/gemini-omni-flash-1.1",
377
- * prompt: "A timelapse of clouds over a canyon",
378
- * duration: 10,
379
- * resolution: "4k",
380
- * });
381
- * ```
382
- */
383
- estimate(request: MynthSDKTypes.VideoGenerationClientRequest): Promise<MynthSDKTypes.VideoGenerationEstimate>;
384
- private toRequestBody;
385
- private createGenerationTask;
643
+ private readonly client;
644
+ /**
645
+ * Creates a new MynthVideo client instance.
646
+ *
647
+ * @param options - Configuration options
648
+ * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
649
+ * @param options.baseUrl - Custom API base URL
650
+ * @throws {Error} If no API key is provided and MYNTH_API_KEY is not set
651
+ */
652
+ constructor(options?: Omit<MynthOptions, "destination">);
653
+ /**
654
+ * Generate a video from a text prompt, optionally guided by input images.
655
+ *
656
+ * Waits for the task to complete. Video generation is slow: this poll can
657
+ * legitimately run for many minutes. Use `generateAsync()` (or a webhook)
658
+ * when you cannot hold a request open that long.
659
+ *
660
+ * @param request - Video generation request parameters
661
+ * @returns A completed VideoGenerationResult
662
+ *
663
+ * @example
664
+ * ```typescript
665
+ * const result = await video.generate({
666
+ * model: "bytedance/seedance-2.0-mini",
667
+ * prompt: "A drone shot over a misty forest at dawn",
668
+ * });
669
+ * console.log(result.urls);
670
+ * ```
671
+ */
672
+ generate<const T extends MynthSDKTypes.VideoGenerationClientRequest>(request: T): Promise<VideoGenerationResult<ExtractVideoMetadata<T>>>;
673
+ /**
674
+ * Start video generation without waiting for completion.
675
+ *
676
+ * The preferred entry point for server code: hand `taskAsync.id` and
677
+ * `taskAsync.access.publicAccessToken` to the browser, or register a webhook,
678
+ * instead of holding a connection open for the length of a render.
679
+ *
680
+ * @param request - Video generation request parameters
681
+ * @returns A TaskAsync that can be polled for completion via `.wait()`
682
+ *
683
+ * @example
684
+ * ```typescript
685
+ * const taskAsync = await video.generateAsync({
686
+ * model: "prunaai/p-video",
687
+ * prompt: "A neon city street in the rain",
688
+ * });
689
+ *
690
+ * return { id: taskAsync.id, access: taskAsync.access };
691
+ * ```
692
+ */
693
+ generateAsync<const T extends MynthSDKTypes.VideoGenerationClientRequest>(request: T): Promise<TaskAsync<VideoGenerationResult<ExtractVideoMetadata<T>>>>;
694
+ /**
695
+ * Upload one or more images to Mynth temporary input storage.
696
+ *
697
+ * Video inputs are images, so this is the same storage `image.upload()` uses.
698
+ * Passing files straight to `generate()` uploads them for you; call this
699
+ * directly only when you want to reuse the URLs across several requests.
700
+ *
701
+ * @param input - Image input or inputs to upload
702
+ * @returns Uploaded image URLs that can be passed to generation `inputs`
703
+ */
704
+ upload(input: MynthSDKTypes.ImageUploadInput | readonly MynthSDKTypes.ImageUploadInput[]): Promise<MynthSDKTypes.ImageUploadResponse>;
705
+ /**
706
+ * Price a video generation request without generating anything.
707
+ *
708
+ * The request is validated exactly as `generate()` would validate it, so an
709
+ * unsupported duration, resolution or input combination throws here too —
710
+ * making this a cheap pre-flight check as well as a cost lookup. Because
711
+ * video pins a concrete model, the returned estimate is exact.
712
+ *
713
+ * @param request - The same request you would pass to `generate()`
714
+ * @returns The estimated cost in USD
715
+ *
716
+ * @example
717
+ * ```typescript
718
+ * const { estimatedCost } = await video.estimate({
719
+ * model: "google/gemini-omni-flash-1.1",
720
+ * prompt: "A timelapse of clouds over a canyon",
721
+ * duration: 10,
722
+ * resolution: "4k",
723
+ * });
724
+ * ```
725
+ */
726
+ estimate(request: MynthSDKTypes.VideoGenerationClientRequest): Promise<MynthSDKTypes.VideoGenerationEstimate>;
727
+ private toRequestBody;
728
+ private createGenerationTask;
386
729
  }
387
730
  /**
388
731
  * Client for interacting with the public Mynth model catalog.
389
732
  */
390
733
  declare class MynthModels {
391
- private readonly client;
392
- /**
393
- * Creates a new MynthModels client instance.
394
- *
395
- * @param options - Configuration options
396
- * @param options.baseUrl - Custom API base URL
397
- */
398
- constructor(options?: Pick<MynthOptions, "baseUrl">);
399
- /**
400
- * List available image generation models.
401
- *
402
- * This endpoint is public and does not require a Mynth API key.
403
- *
404
- * @returns Available image and video models with display names, served modes, and pricing
405
- *
406
- * @example
407
- * ```typescript
408
- * const models = await mynth.models.list();
409
- * console.log(models[0]?.id);
410
- * ```
411
- */
412
- list(): Promise<MynthSDKTypes.Model[]>;
734
+ private readonly client;
735
+ /**
736
+ * Creates a new MynthModels client instance.
737
+ *
738
+ * @param options - Configuration options
739
+ * @param options.baseUrl - Custom API base URL
740
+ */
741
+ constructor(options?: Pick<MynthOptions, "baseUrl">);
742
+ /**
743
+ * List available image generation models.
744
+ *
745
+ * This endpoint is public and does not require a Mynth API key.
746
+ *
747
+ * @returns Available image and video models with display names, served modes, and pricing
748
+ *
749
+ * @example
750
+ * ```typescript
751
+ * const models = await mynth.models.list();
752
+ * console.log(models[0]?.id);
753
+ * ```
754
+ */
755
+ list(): Promise<MynthSDKTypes.Model[]>;
413
756
  }
414
757
  /**
415
758
  * Bundled Mynth client providing access to all media type clients.
@@ -425,25 +768,23 @@ declare class MynthModels {
425
768
  * ```
426
769
  */
427
770
  declare class Mynth {
428
- /** Public model catalog client */
429
- readonly models: MynthModels;
430
- private readonly options;
431
- private imageClient?;
432
- private videoClient?;
433
- /**
434
- * Creates a new Mynth client instance.
435
- *
436
- * @param options - Configuration options
437
- * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
438
- * @param options.baseUrl - Custom API base URL
439
- */
440
- constructor(options?: MynthOptions);
441
- /** Image generation and analysis client */
442
- get image(): MynthImage;
443
- /** Video generation client */
444
- get video(): MynthVideo;
771
+ /** Public model catalog client */
772
+ readonly models: MynthModels;
773
+ private readonly options;
774
+ private imageClient?;
775
+ private videoClient?;
776
+ /**
777
+ * Creates a new Mynth client instance.
778
+ *
779
+ * @param options - Configuration options
780
+ * @param options.apiKey - Your API key (defaults to MYNTH_API_KEY env var)
781
+ * @param options.baseUrl - Custom API base URL
782
+ */
783
+ constructor(options?: MynthOptions);
784
+ /** Image generation and analysis client */
785
+ get image(): MynthImage;
786
+ /** Video generation client */
787
+ get video(): MynthVideo;
445
788
  }
446
- export { AVAILABLE_MODELS, AVAILABLE_VIDEO_MODELS, ImageAltResult, ImageGenerationResult, ImageRateResult, ImageRemoveBackgroundResult, ImageReviewResult, Mynth, MynthImage, MynthModels, MynthVideo, TaskAsync, VideoGenerationResult, MynthAPIError, TaskAsyncFetchError, TaskAsyncTaskFailedError, TaskAsyncTaskFetchError, TaskAsyncTimeoutError, TaskAsyncUnauthorizedError, };
447
- export type { AvailableModel, AvailableVideoModel, ModelCapability, MynthModel, MynthModelPricing, MynthOptions, MynthSDKTypes, TaskAsyncAccess, VideoInputRole, VideoResolutionTier, };
448
- export default Mynth;
449
- //# sourceMappingURL=index.d.ts.map
789
+ //#endregion
790
+ export { AVAILABLE_MODELS, AVAILABLE_VIDEO_MODELS, type AvailableModel, type AvailableVideoModel, type ModelCapability, Mynth, Mynth as default, MynthImage, type MynthModel, type MynthModelPricing, MynthModels, type MynthOptions, type MynthRequestOptions, type MynthSDKTypes, MynthVideo, type TaskAsyncAccess, type TaskAsyncWaitOptions, type VideoInputRole, type VideoResolutionTier };