magic-hour 0.21.0 → 0.22.0

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 (73) hide show
  1. package/dist/client.js +4 -2
  2. package/dist/core/core-client.d.ts +4 -3
  3. package/dist/core/core-client.js +10 -10
  4. package/dist/environment.d.ts +1 -1
  5. package/dist/environment.js +1 -1
  6. package/dist/resources/v1/ai-clothes-changer/resource-client.d.ts +1 -1
  7. package/dist/resources/v1/ai-clothes-changer/resource-client.js +1 -1
  8. package/dist/resources/v1/ai-gif-generator/resource-client.d.ts +1 -1
  9. package/dist/resources/v1/ai-gif-generator/resource-client.js +1 -1
  10. package/dist/resources/v1/ai-headshot-generator/resource-client.d.ts +1 -1
  11. package/dist/resources/v1/ai-headshot-generator/resource-client.js +1 -1
  12. package/dist/resources/v1/ai-image-generator/resource-client.d.ts +1 -1
  13. package/dist/resources/v1/ai-image-generator/resource-client.js +1 -1
  14. package/dist/resources/v1/ai-image-upscaler/resource-client.d.ts +1 -1
  15. package/dist/resources/v1/ai-image-upscaler/resource-client.js +1 -1
  16. package/dist/resources/v1/ai-meme-generator/resource-client.d.ts +1 -1
  17. package/dist/resources/v1/ai-meme-generator/resource-client.js +1 -1
  18. package/dist/resources/v1/ai-photo-editor/resource-client.d.ts +1 -1
  19. package/dist/resources/v1/ai-photo-editor/resource-client.js +1 -1
  20. package/dist/resources/v1/ai-qr-code-generator/resource-client.d.ts +1 -1
  21. package/dist/resources/v1/ai-qr-code-generator/resource-client.js +1 -1
  22. package/dist/resources/v1/face-swap-photo/resource-client.d.ts +1 -1
  23. package/dist/resources/v1/face-swap-photo/resource-client.js +1 -1
  24. package/dist/resources/v1/image-background-remover/resource-client.d.ts +1 -1
  25. package/dist/resources/v1/image-background-remover/resource-client.js +1 -1
  26. package/dist/resources/v1/photo-colorizer/resource-client.d.ts +1 -1
  27. package/dist/resources/v1/photo-colorizer/resource-client.js +1 -1
  28. package/dist/types/v1-ai-clothes-changer-create-response.d.ts +8 -1
  29. package/dist/types/v1-ai-clothes-changer-create-response.js +4 -0
  30. package/dist/types/v1-ai-face-editor-create-response.d.ts +8 -1
  31. package/dist/types/v1-ai-face-editor-create-response.js +4 -0
  32. package/dist/types/v1-ai-gif-generator-create-response.d.ts +8 -1
  33. package/dist/types/v1-ai-gif-generator-create-response.js +4 -0
  34. package/dist/types/v1-ai-headshot-generator-create-response.d.ts +8 -1
  35. package/dist/types/v1-ai-headshot-generator-create-response.js +4 -0
  36. package/dist/types/v1-ai-image-generator-create-response.d.ts +8 -1
  37. package/dist/types/v1-ai-image-generator-create-response.js +4 -0
  38. package/dist/types/v1-ai-image-upscaler-create-response.d.ts +8 -1
  39. package/dist/types/v1-ai-image-upscaler-create-response.js +4 -0
  40. package/dist/types/v1-ai-meme-generator-create-response.d.ts +8 -1
  41. package/dist/types/v1-ai-meme-generator-create-response.js +4 -0
  42. package/dist/types/v1-ai-photo-editor-create-response.d.ts +8 -1
  43. package/dist/types/v1-ai-photo-editor-create-response.js +4 -0
  44. package/dist/types/v1-ai-qr-code-generator-create-response.d.ts +8 -1
  45. package/dist/types/v1-ai-qr-code-generator-create-response.js +4 -0
  46. package/dist/types/v1-ai-talking-photo-create-response.d.ts +10 -1
  47. package/dist/types/v1-ai-talking-photo-create-response.js +4 -0
  48. package/dist/types/v1-animation-create-response.d.ts +10 -1
  49. package/dist/types/v1-animation-create-response.js +4 -0
  50. package/dist/types/v1-face-swap-create-response.d.ts +11 -2
  51. package/dist/types/v1-face-swap-create-response.js +4 -0
  52. package/dist/types/v1-face-swap-photo-create-response.d.ts +8 -1
  53. package/dist/types/v1-face-swap-photo-create-response.js +4 -0
  54. package/dist/types/v1-image-background-remover-create-response.d.ts +8 -1
  55. package/dist/types/v1-image-background-remover-create-response.js +4 -0
  56. package/dist/types/v1-image-projects-get-response.d.ts +8 -1
  57. package/dist/types/v1-image-projects-get-response.js +4 -0
  58. package/dist/types/v1-image-to-video-create-response.d.ts +10 -1
  59. package/dist/types/v1-image-to-video-create-response.js +4 -0
  60. package/dist/types/v1-lip-sync-create-response.d.ts +10 -1
  61. package/dist/types/v1-lip-sync-create-response.js +4 -0
  62. package/dist/types/v1-photo-colorizer-create-response.d.ts +8 -1
  63. package/dist/types/v1-photo-colorizer-create-response.js +4 -0
  64. package/dist/types/v1-text-to-video-create-response.d.ts +10 -1
  65. package/dist/types/v1-text-to-video-create-response.js +4 -0
  66. package/dist/types/v1-video-projects-get-response.d.ts +9 -0
  67. package/dist/types/v1-video-projects-get-response.js +4 -0
  68. package/dist/types/v1-video-to-video-create-body-style-art-style-enum.d.ts +1 -1
  69. package/dist/types/v1-video-to-video-create-body-style.d.ts +2 -2
  70. package/dist/types/v1-video-to-video-create-body-style.js +2 -0
  71. package/dist/types/v1-video-to-video-create-response.d.ts +10 -1
  72. package/dist/types/v1-video-to-video-create-response.js +4 -0
  73. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -6,8 +6,10 @@ const environment_1 = require("./environment");
6
6
  class Client {
7
7
  constructor(opts) {
8
8
  var _a, _b;
9
- const baseUrl = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.baseUrl) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.environment) !== null && _b !== void 0 ? _b : environment_1.Environment.Environment;
10
- this._client = new core_1.CoreClient({ baseUrl, timeout: opts === null || opts === void 0 ? void 0 : opts.timeout });
9
+ this._client = new core_1.CoreClient({
10
+ baseUrl: (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.baseUrl) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.environment) !== null && _b !== void 0 ? _b : environment_1.Environment.Environment,
11
+ timeout: opts === null || opts === void 0 ? void 0 : opts.timeout,
12
+ });
11
13
  this._opts = { lazyLoad: opts === null || opts === void 0 ? void 0 : opts.lazyLoad };
12
14
  this._client.registerAuth("bearerAuth", new core_1.AuthBearer(opts === null || opts === void 0 ? void 0 : opts.token));
13
15
  if (this._opts.lazyLoad === false) {
@@ -4,7 +4,7 @@ import { AuthProvider } from "./auth";
4
4
  import { ApiPromise } from "./api-promise";
5
5
  import { QueryStyle } from "./query";
6
6
  export interface CoreClientProps {
7
- baseUrl: string;
7
+ baseUrl: string | Record<string, string | undefined>;
8
8
  timeout?: number | undefined;
9
9
  }
10
10
  export type ApiResponse = Response | NodeResponse;
@@ -12,6 +12,7 @@ export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
12
12
  export type RequestConfig = {
13
13
  method: HttpMethod;
14
14
  path: string;
15
+ serviceName?: string | undefined;
15
16
  responseSchema?: z.Schema;
16
17
  responseStream?: boolean;
17
18
  responseRaw?: boolean;
@@ -33,13 +34,13 @@ export interface RequestOptions {
33
34
  additionalQuery?: Record<string, string>;
34
35
  }
35
36
  export declare class CoreClient {
36
- baseUrl: string;
37
+ private baseUrl;
37
38
  private auths;
38
39
  private timeout;
39
40
  constructor(props: CoreClientProps);
40
41
  registerAuth(name: string, provider: AuthProvider): void;
41
42
  private applyAuths;
42
- buildUrl(path: string): string;
43
+ buildUrl(path: string, serviceName?: string): string;
43
44
  private buildUrlFromCfg;
44
45
  private applyHeaders;
45
46
  private encodeBodyByContentType;
@@ -16,10 +16,14 @@ const api_error_1 = require("./api-error");
16
16
  const form_data_1 = require("./form-data");
17
17
  const query_1 = require("./query");
18
18
  const content_type_1 = require("./content-type");
19
+ const _DEFAULT_SERVICE_NAME = "__default_service__";
19
20
  class CoreClient {
20
21
  // private agent: any // TODO
21
22
  constructor(props) {
22
- this.baseUrl = props.baseUrl;
23
+ this.baseUrl =
24
+ typeof props.baseUrl === "string"
25
+ ? { [_DEFAULT_SERVICE_NAME]: props.baseUrl }
26
+ : props.baseUrl;
23
27
  this.auths = {};
24
28
  this.timeout = props.timeout;
25
29
  }
@@ -38,20 +42,16 @@ class CoreClient {
38
42
  return cfg;
39
43
  });
40
44
  }
41
- buildUrl(path) {
42
- const base = this.baseUrl.endsWith("/")
43
- ? this.baseUrl.slice(0, -1)
44
- : this.baseUrl;
45
+ buildUrl(path, serviceName = _DEFAULT_SERVICE_NAME) {
46
+ var _a;
47
+ const baseUrl = (_a = this.baseUrl[serviceName !== null && serviceName !== void 0 ? serviceName : _DEFAULT_SERVICE_NAME]) !== null && _a !== void 0 ? _a : "";
48
+ const base = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
45
49
  const cleanPath = path.startsWith("/") ? path.slice(1) : path;
46
50
  return `${base}/${cleanPath}`;
47
51
  }
48
52
  buildUrlFromCfg(cfg) {
49
53
  var _a, _b, _c;
50
- const base = this.baseUrl.endsWith("/")
51
- ? this.baseUrl.slice(0, -1)
52
- : this.baseUrl;
53
- const path = cfg.path.startsWith("/") ? cfg.path.slice(1) : cfg.path;
54
- let url = `${base}/${path}`;
54
+ let url = this.buildUrl(cfg.path, cfg.serviceName);
55
55
  const searchParams = new URLSearchParams(((_a = cfg.query) !== null && _a !== void 0 ? _a : []).join("&"));
56
56
  for (const [key, val] of Object.entries((_c = (_b = cfg.opts) === null || _b === void 0 ? void 0 : _b.additionalQuery) !== null && _c !== void 0 ? _c : {})) {
57
57
  searchParams.append(key, val);
@@ -1,4 +1,4 @@
1
1
  export declare enum Environment {
2
2
  Environment = "https://api.magichour.ai",
3
- MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.21.0"
3
+ MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.22.0"
4
4
  }
@@ -4,5 +4,5 @@ exports.Environment = void 0;
4
4
  var Environment;
5
5
  (function (Environment) {
6
6
  Environment["Environment"] = "https://api.magichour.ai";
7
- Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.21.0";
7
+ Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.22.0";
8
8
  })(Environment || (exports.Environment = Environment = {}));
@@ -6,7 +6,7 @@ export declare class AiClothesChangerClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI Clothes Changer
8
8
  *
9
- * Change outfits in photos in seconds with just a photo reference. Each photo costs 25 frames.
9
+ * Change outfits in photos in seconds with just a photo reference. Each photo costs 25 credits.
10
10
  *
11
11
  * POST /v1/ai-clothes-changer
12
12
  */
@@ -11,7 +11,7 @@ class AiClothesChangerClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI Clothes Changer
13
13
  *
14
- * Change outfits in photos in seconds with just a photo reference. Each photo costs 25 frames.
14
+ * Change outfits in photos in seconds with just a photo reference. Each photo costs 25 credits.
15
15
  *
16
16
  * POST /v1/ai-clothes-changer
17
17
  */
@@ -6,7 +6,7 @@ export declare class AiGifGeneratorClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI GIFs
8
8
  *
9
- * Create an AI GIF. Each GIF costs 25 frames.
9
+ * Create an AI GIF. Each GIF costs 25 credits.
10
10
  *
11
11
  * POST /v1/ai-gif-generator
12
12
  */
@@ -11,7 +11,7 @@ class AiGifGeneratorClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI GIFs
13
13
  *
14
- * Create an AI GIF. Each GIF costs 25 frames.
14
+ * Create an AI GIF. Each GIF costs 25 credits.
15
15
  *
16
16
  * POST /v1/ai-gif-generator
17
17
  */
@@ -6,7 +6,7 @@ export declare class AiHeadshotGeneratorClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI Headshots
8
8
  *
9
- * Create an AI headshot. Each headshot costs 50 frames.
9
+ * Create an AI headshot. Each headshot costs 50 credits.
10
10
  *
11
11
  * POST /v1/ai-headshot-generator
12
12
  */
@@ -11,7 +11,7 @@ class AiHeadshotGeneratorClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI Headshots
13
13
  *
14
- * Create an AI headshot. Each headshot costs 50 frames.
14
+ * Create an AI headshot. Each headshot costs 50 credits.
15
15
  *
16
16
  * POST /v1/ai-headshot-generator
17
17
  */
@@ -6,7 +6,7 @@ export declare class AiImageGeneratorClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI Images
8
8
  *
9
- * Create an AI image. Each image costs 5 frames.
9
+ * Create an AI image. Each image costs 5 credits.
10
10
  *
11
11
  * POST /v1/ai-image-generator
12
12
  */
@@ -11,7 +11,7 @@ class AiImageGeneratorClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI Images
13
13
  *
14
- * Create an AI image. Each image costs 5 frames.
14
+ * Create an AI image. Each image costs 5 credits.
15
15
  *
16
16
  * POST /v1/ai-image-generator
17
17
  */
@@ -6,7 +6,7 @@ export declare class AiImageUpscalerClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI Image Upscaler
8
8
  *
9
- * Upscale your image using AI. Each 2x upscale costs 50 frames, and 4x upscale costs 200 frames.
9
+ * Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
10
10
  *
11
11
  * POST /v1/ai-image-upscaler
12
12
  */
@@ -11,7 +11,7 @@ class AiImageUpscalerClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI Image Upscaler
13
13
  *
14
- * Upscale your image using AI. Each 2x upscale costs 50 frames, and 4x upscale costs 200 frames.
14
+ * Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
15
15
  *
16
16
  * POST /v1/ai-image-upscaler
17
17
  */
@@ -6,7 +6,7 @@ export declare class AiMemeGeneratorClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI Meme Generator
8
8
  *
9
- * Create an AI generated meme. Each meme costs 10 frames.
9
+ * Create an AI generated meme. Each meme costs 10 credits.
10
10
  *
11
11
  * POST /v1/ai-meme-generator
12
12
  */
@@ -11,7 +11,7 @@ class AiMemeGeneratorClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI Meme Generator
13
13
  *
14
- * Create an AI generated meme. Each meme costs 10 frames.
14
+ * Create an AI generated meme. Each meme costs 10 credits.
15
15
  *
16
16
  * POST /v1/ai-meme-generator
17
17
  */
@@ -8,7 +8,7 @@ export declare class AiPhotoEditorClient extends CoreResourceClient {
8
8
  *
9
9
  * > **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
10
10
  *
11
- * Edit photo using AI. Each photo costs 10 frames.
11
+ * Edit photo using AI. Each photo costs 10 credits.
12
12
  *
13
13
  * POST /v1/ai-photo-editor
14
14
  */
@@ -13,7 +13,7 @@ class AiPhotoEditorClient extends core_1.CoreResourceClient {
13
13
  *
14
14
  * > **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
15
15
  *
16
- * Edit photo using AI. Each photo costs 10 frames.
16
+ * Edit photo using AI. Each photo costs 10 credits.
17
17
  *
18
18
  * POST /v1/ai-photo-editor
19
19
  */
@@ -6,7 +6,7 @@ export declare class AiQrCodeGeneratorClient extends CoreResourceClient {
6
6
  /**
7
7
  * AI QR Code
8
8
  *
9
- * Create an AI QR code. Each QR code costs 20 frames.
9
+ * Create an AI QR code. Each QR code costs 20 credits.
10
10
  *
11
11
  * POST /v1/ai-qr-code-generator
12
12
  */
@@ -11,7 +11,7 @@ class AiQrCodeGeneratorClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * AI QR Code
13
13
  *
14
- * Create an AI QR code. Each QR code costs 20 frames.
14
+ * Create an AI QR code. Each QR code costs 20 credits.
15
15
  *
16
16
  * POST /v1/ai-qr-code-generator
17
17
  */
@@ -6,7 +6,7 @@ export declare class FaceSwapPhotoClient extends CoreResourceClient {
6
6
  /**
7
7
  * Face Swap Photo
8
8
  *
9
- * Create a face swap photo. Each photo costs 5 frames. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
9
+ * Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
10
10
  *
11
11
  * POST /v1/face-swap-photo
12
12
  */
@@ -11,7 +11,7 @@ class FaceSwapPhotoClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * Face Swap Photo
13
13
  *
14
- * Create a face swap photo. Each photo costs 5 frames. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
14
+ * Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
15
15
  *
16
16
  * POST /v1/face-swap-photo
17
17
  */
@@ -6,7 +6,7 @@ export declare class ImageBackgroundRemoverClient extends CoreResourceClient {
6
6
  /**
7
7
  * Image Background Remover
8
8
  *
9
- * Remove background from image. Each image costs 5 frames.
9
+ * Remove background from image. Each image costs 5 credits.
10
10
  *
11
11
  * POST /v1/image-background-remover
12
12
  */
@@ -11,7 +11,7 @@ class ImageBackgroundRemoverClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * Image Background Remover
13
13
  *
14
- * Remove background from image. Each image costs 5 frames.
14
+ * Remove background from image. Each image costs 5 credits.
15
15
  *
16
16
  * POST /v1/image-background-remover
17
17
  */
@@ -6,7 +6,7 @@ export declare class PhotoColorizerClient extends CoreResourceClient {
6
6
  /**
7
7
  * Photo Colorizer
8
8
  *
9
- * Colorize image. Each image costs 5 frames.
9
+ * Colorize image. Each image costs 5 credits.
10
10
  *
11
11
  * POST /v1/photo-colorizer
12
12
  */
@@ -11,7 +11,7 @@ class PhotoColorizerClient extends core_1.CoreResourceClient {
11
11
  /**
12
12
  * Photo Colorizer
13
13
  *
14
- * Colorize image. Each image costs 5 frames.
14
+ * Colorize image. Each image costs 5 credits.
15
15
  *
16
16
  * POST /v1/photo-colorizer
17
17
  */
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiClothesChangerCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiClothesChangerCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiClothesChangerCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiClothesChangerCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiClothesChangerCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiClothesChangerCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiFaceEditorCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiFaceEditorCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiFaceEditorCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiFaceEditorCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiFaceEditorCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiFaceEditorCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiGifGeneratorCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiGifGeneratorCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiGifGeneratorCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiGifGeneratorCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiGifGeneratorCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiGifGeneratorCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiHeadshotGeneratorCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiHeadshotGeneratorCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiHeadshotGeneratorCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiHeadshotGeneratorCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiHeadshotGeneratorCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiHeadshotGeneratorCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiImageGeneratorCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiImageGeneratorCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiImageGeneratorCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiImageGeneratorCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiImageGeneratorCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiImageGeneratorCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });
@@ -4,7 +4,13 @@ import * as z from "zod";
4
4
  */
5
5
  export type V1AiImageUpscalerCreateResponse = {
6
6
  /**
7
- * The frame cost of the image generation
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
8
14
  */
9
15
  frameCost: number;
10
16
  /**
@@ -18,6 +24,7 @@ export type V1AiImageUpscalerCreateResponse = {
18
24
  * we expect to come in as network data
19
25
  */
20
26
  export type External$V1AiImageUpscalerCreateResponse = {
27
+ credits_charged: number;
21
28
  frame_cost: number;
22
29
  id: string;
23
30
  };
@@ -41,11 +41,13 @@ const z = __importStar(require("zod"));
41
41
  */
42
42
  const SchemaIn$V1AiImageUpscalerCreateResponse = z
43
43
  .object({
44
+ credits_charged: z.number().int(),
44
45
  frame_cost: z.number().int(),
45
46
  id: z.string(),
46
47
  })
47
48
  .transform((obj) => {
48
49
  return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
49
51
  frame_cost: "frameCost",
50
52
  id: "id",
51
53
  });
@@ -56,11 +58,13 @@ const SchemaIn$V1AiImageUpscalerCreateResponse = z
56
58
  */
57
59
  const SchemaOut$V1AiImageUpscalerCreateResponse = z
58
60
  .object({
61
+ creditsCharged: z.number().int(),
59
62
  frameCost: z.number().int(),
60
63
  id: z.string(),
61
64
  })
62
65
  .transform((obj) => {
63
66
  return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
64
68
  frameCost: "frame_cost",
65
69
  id: "id",
66
70
  });