diff --git a/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.AiImageEditorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.AiImageEditorCreateImage.g.cs index 90f09d7..bca8aab 100644 --- a/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.AiImageEditorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.AiImageEditorCreateImage.g.cs @@ -24,7 +24,7 @@ public partial interface IImageProjectsClient /// "image_count": 1,
/// "model": "default",
/// "aspect_ratio": "1:1",
- /// "resolution": "auto",
+ /// "resolution": "1k",
/// "style": {
/// "prompt": "Give me sunglasses"
/// },
diff --git a/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.BodySwapCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.BodySwapCreateImage.g.cs index b3e046d..663067e 100644 --- a/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.BodySwapCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.IImageProjectsClient.BodySwapCreateImage.g.cs @@ -12,6 +12,23 @@ public partial interface IImageProjectsClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// curl --request POST \
+ /// --url https://api.magichour.ai/v1/body-swap \
+ /// --header 'accept: application/json' \
+ /// --header 'authorization: Bearer <token>' \
+ /// --header 'content-type: application/json' \
+ /// --data '
+ /// {
+ /// "name": "My Body Swap image",
+ /// "resolution": "1k",
+ /// "assets": {
+ /// "person_file_path": "api-assets/id/1234.png",
+ /// "scene_file_path": "api-assets/id/5678.png"
+ /// }
+ /// }
+ /// ' + ///
global::System.Threading.Tasks.Task BodySwapCreateImageAsync( global::MagicHour.BodySwapCreateImageRequest request, diff --git a/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.ImageToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.ImageToVideoCreateVideo.g.cs index 77106c1..8a6697a 100644 --- a/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.ImageToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.ImageToVideoCreateVideo.g.cs @@ -132,15 +132,15 @@ public partial interface IVideoProjectsClient /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.TextToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.TextToVideoCreateVideo.g.cs index 6781028..b31314f 100644 --- a/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.TextToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.IVideoProjectsClient.TextToVideoCreateVideo.g.cs @@ -144,15 +144,15 @@ public partial interface IVideoProjectsClient /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs index 1449115..2af9c8a 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs @@ -61,7 +61,7 @@ partial void ProcessAiImageEditorCreateImageResponseContent( /// "image_count": 1,
/// "model": "default",
/// "aspect_ratio": "1:1",
- /// "resolution": "auto",
+ /// "resolution": "1k",
/// "style": {
/// "prompt": "Give me sunglasses"
/// },
diff --git a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs index f8c2115..c97c82a 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs @@ -49,6 +49,23 @@ partial void ProcessBodySwapCreateImageResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// curl --request POST \
+ /// --url https://api.magichour.ai/v1/body-swap \
+ /// --header 'accept: application/json' \
+ /// --header 'authorization: Bearer <token>' \
+ /// --header 'content-type: application/json' \
+ /// --data '
+ /// {
+ /// "name": "My Body Swap image",
+ /// "resolution": "1k",
+ /// "assets": {
+ /// "person_file_path": "api-assets/id/1234.png",
+ /// "scene_file_path": "api-assets/id/5678.png"
+ /// }
+ /// }
+ /// ' + ///
public async global::System.Threading.Tasks.Task BodySwapCreateImageAsync( global::MagicHour.BodySwapCreateImageRequest request, diff --git a/src/libs/MagicHour/Generated/MagicHour.Models.ImageToVideoCreateVideoRequest.g.cs b/src/libs/MagicHour/Generated/MagicHour.Models.ImageToVideoCreateVideoRequest.g.cs index 3b7f741..dded41e 100644 --- a/src/libs/MagicHour/Generated/MagicHour.Models.ImageToVideoCreateVideoRequest.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.Models.ImageToVideoCreateVideoRequest.g.cs @@ -83,15 +83,15 @@ public sealed partial class ImageToVideoCreateVideoRequest /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true @@ -181,15 +181,15 @@ public sealed partial class ImageToVideoCreateVideoRequest /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/Generated/MagicHour.Models.TextToVideoCreateVideoRequest.g.cs b/src/libs/MagicHour/Generated/MagicHour.Models.TextToVideoCreateVideoRequest.g.cs index 3ca1aad..6bc4090 100644 --- a/src/libs/MagicHour/Generated/MagicHour.Models.TextToVideoCreateVideoRequest.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.Models.TextToVideoCreateVideoRequest.g.cs @@ -103,15 +103,15 @@ public sealed partial class TextToVideoCreateVideoRequest /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true @@ -208,15 +208,15 @@ public sealed partial class TextToVideoCreateVideoRequest /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs index a5bf937..051a76e 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs @@ -692,15 +692,15 @@ partial void ProcessImageToVideoCreateVideoResponseContent( /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs index 62dd288..0e0dcdb 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs @@ -704,15 +704,15 @@ partial void ProcessTextToVideoCreateVideoResponseContent( /// /// Whether to include audio in the video. Defaults to `false` if not specified.
/// Audio support varies by model:
- /// * **`ltx-2`**: Automatically included with no extra credits
+ /// * **`ltx-2`**: Toggle-able: no additional credits for audio
/// * **`wan-2.2`**: Not supported
/// * **`seedance`**: Not supported
- /// * **`seedance-2.0`**: Automatically included with no extra credits
- /// * **`kling-2.5`**: Automatically included with no extra credits
- /// * **`kling-3.0`**: Toggle-able (can enable/disable)
- /// * **`sora-2`**: Automatically included with no extra credits
- /// * **`veo3.1`**: Toggle-able (can enable/disable)
- /// * **`veo3.1-lite`**: Toggle-able (can enable/disable)
+ /// * **`seedance-2.0`**: Toggle-able: no additional credits for audio
+ /// * **`kling-2.5`**: Toggle-able: no additional credits for audio
+ /// * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`sora-2`**: Toggle-able: no additional credits for audio
+ /// * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
+ /// * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
/// Legacy models:
/// * **`kling-1.6`**: Not supported
/// Example: true diff --git a/src/libs/MagicHour/openapi.yaml b/src/libs/MagicHour/openapi.yaml index 0917ff1..f5f8ee9 100644 --- a/src/libs/MagicHour/openapi.yaml +++ b/src/libs/MagicHour/openapi.yaml @@ -2626,7 +2626,7 @@ }, "audio": { "type": "boolean", - "description": "Whether to include audio in the video. Defaults to `false` if not specified.\n\nAudio support varies by model:\n* **`ltx-2`**: Automatically included with no extra credits\n* **`wan-2.2`**: Not supported\n* **`seedance`**: Not supported\n* **`seedance-2.0`**: Automatically included with no extra credits\n* **`kling-2.5`**: Automatically included with no extra credits\n* **`kling-3.0`**: Toggle-able (can enable/disable)\n* **`sora-2`**: Automatically included with no extra credits\n* **`veo3.1`**: Toggle-able (can enable/disable)\n* **`veo3.1-lite`**: Toggle-able (can enable/disable)\n\nLegacy models:\n* **`kling-1.6`**: Not supported", + "description": "Whether to include audio in the video. Defaults to `false` if not specified.\n\nAudio support varies by model:\n* **`ltx-2`**: Toggle-able: no additional credits for audio\n* **`wan-2.2`**: Not supported\n* **`seedance`**: Not supported\n* **`seedance-2.0`**: Toggle-able: no additional credits for audio\n* **`kling-2.5`**: Toggle-able: no additional credits for audio\n* **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled\n* **`sora-2`**: Toggle-able: no additional credits for audio\n* **`veo3.1`**: Toggle-able: audio adds extra credits when enabled\n* **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled\n\nLegacy models:\n* **`kling-1.6`**: Not supported", "example": true }, "style": { @@ -3609,7 +3609,7 @@ }, "audio": { "type": "boolean", - "description": "Whether to include audio in the video. Defaults to `false` if not specified.\n\nAudio support varies by model:\n* **`ltx-2`**: Automatically included with no extra credits\n* **`wan-2.2`**: Not supported\n* **`seedance`**: Not supported\n* **`seedance-2.0`**: Automatically included with no extra credits\n* **`kling-2.5`**: Automatically included with no extra credits\n* **`kling-3.0`**: Toggle-able (can enable/disable)\n* **`sora-2`**: Automatically included with no extra credits\n* **`veo3.1`**: Toggle-able (can enable/disable)\n* **`veo3.1-lite`**: Toggle-able (can enable/disable)\n\nLegacy models:\n* **`kling-1.6`**: Not supported", + "description": "Whether to include audio in the video. Defaults to `false` if not specified.\n\nAudio support varies by model:\n* **`ltx-2`**: Toggle-able: no additional credits for audio\n* **`wan-2.2`**: Not supported\n* **`seedance`**: Not supported\n* **`seedance-2.0`**: Toggle-able: no additional credits for audio\n* **`kling-2.5`**: Toggle-able: no additional credits for audio\n* **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled\n* **`sora-2`**: Toggle-able: no additional credits for audio\n* **`veo3.1`**: Toggle-able: audio adds extra credits when enabled\n* **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled\n\nLegacy models:\n* **`kling-1.6`**: Not supported", "example": true }, "style": { @@ -5370,23 +5370,23 @@ }, { "lang": "go", - "source": "package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tnullable \"github.com/magichourhq/magic-hour-go/nullable\"\n\tai_image_editor \"github.com/magichourhq/magic-hour-go/resources/v1/ai_image_editor\"\n\ttypes \"github.com/magichourhq/magic-hour-go/types\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"API_TOKEN\")),\n\t)\n\tres, err := client.V1.AiImageEditor.Create(ai_image_editor.CreateRequest{\n\t\tAspectRatio: nullable.NewValue(types.V1AiImageEditorCreateBodyAspectRatioEnum11),\n\t\tAssets: types.V1AiImageEditorCreateBodyAssets{\n\t\t\tImageFilePaths: nullable.NewValue([]string{\n\t\t\t\t\"api-assets/id/1234.png\",\n\t\t\t\t\"api-assets/id/1235.png\",\n\t\t\t}),\n\t\t},\n\t\tImageCount: nullable.NewValue(1.0),\n\t\tModel: nullable.NewValue(types.V1AiImageEditorCreateBodyModelEnumDefault),\n\t\tName: nullable.NewValue(\"My Ai Image Editor image\"),\n\t\tResolution: nullable.NewValue(types.V1AiImageEditorCreateBodyResolutionEnumAuto),\n\t\tStyle: types.V1AiImageEditorCreateBodyStyle{\n\t\t\tPrompt: \"Give me sunglasses\",\n\t\t},\n\t})\n}" + "source": "package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tnullable \"github.com/magichourhq/magic-hour-go/nullable\"\n\tai_image_editor \"github.com/magichourhq/magic-hour-go/resources/v1/ai_image_editor\"\n\ttypes \"github.com/magichourhq/magic-hour-go/types\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"API_TOKEN\")),\n\t)\n\tres, err := client.V1.AiImageEditor.Create(ai_image_editor.CreateRequest{\n\t\tAspectRatio: nullable.NewValue(types.V1AiImageEditorCreateBodyAspectRatioEnum11),\n\t\tAssets: types.V1AiImageEditorCreateBodyAssets{\n\t\t\tImageFilePaths: nullable.NewValue([]string{\n\t\t\t\t\"api-assets/id/1234.png\",\n\t\t\t\t\"api-assets/id/1235.png\",\n\t\t\t}),\n\t\t},\n\t\tImageCount: nullable.NewValue(1.0),\n\t\tModel: nullable.NewValue(types.V1AiImageEditorCreateBodyModelEnumDefault),\n\t\tName: nullable.NewValue(\"My Ai Image Editor image\"),\n\t\tResolution: nullable.NewValue(types.V1AiImageEditorCreateBodyResolutionEnum1k),\n\t\tStyle: types.V1AiImageEditorCreateBodyStyle{\n\t\t\tPrompt: \"Give me sunglasses\",\n\t\t},\n\t})\n}" }, { "lang": "rust", - "source": "let client = magic_hour::Client::default()\n .with_bearer_auth(&std::env::var(\"API_TOKEN\").unwrap());\nlet res = client\n .v1()\n .ai_image_editor()\n .create(magic_hour::resources::v1::ai_image_editor::CreateRequest {\n aspect_ratio: Some(\n magic_hour::models::V1AiImageEditorCreateBodyAspectRatioEnum::Enum11,\n ),\n assets: magic_hour::models::V1AiImageEditorCreateBodyAssets {\n image_file_paths: Some(\n vec![\n \"api-assets/id/1234.png\".to_string(), \"api-assets/id/1235.png\"\n .to_string()\n ],\n ),\n ..Default::default()\n },\n image_count: Some(1.0),\n model: Some(magic_hour::models::V1AiImageEditorCreateBodyModelEnum::Default),\n name: Some(\"My Ai Image Editor image\".to_string()),\n resolution: Some(\n magic_hour::models::V1AiImageEditorCreateBodyResolutionEnum::Auto,\n ),\n style: magic_hour::models::V1AiImageEditorCreateBodyStyle {\n prompt: \"Give me sunglasses\".to_string(),\n ..Default::default()\n },\n })\n .await;" + "source": "let client = magic_hour::Client::default()\n .with_bearer_auth(&std::env::var(\"API_TOKEN\").unwrap());\nlet res = client\n .v1()\n .ai_image_editor()\n .create(magic_hour::resources::v1::ai_image_editor::CreateRequest {\n aspect_ratio: Some(\n magic_hour::models::V1AiImageEditorCreateBodyAspectRatioEnum::Enum11,\n ),\n assets: magic_hour::models::V1AiImageEditorCreateBodyAssets {\n image_file_paths: Some(\n vec![\n \"api-assets/id/1234.png\".to_string(), \"api-assets/id/1235.png\"\n .to_string()\n ],\n ),\n ..Default::default()\n },\n image_count: Some(1.0),\n model: Some(magic_hour::models::V1AiImageEditorCreateBodyModelEnum::Default),\n name: Some(\"My Ai Image Editor image\".to_string()),\n resolution: Some(\n magic_hour::models::V1AiImageEditorCreateBodyResolutionEnum::Enum1k,\n ),\n style: magic_hour::models::V1AiImageEditorCreateBodyStyle {\n prompt: \"Give me sunglasses\".to_string(),\n ..Default::default()\n },\n })\n .await;" }, { "lang": "curl", - "source": "curl --request POST \\\n --url https://api.magichour.ai/v1/ai-image-editor \\\n --header 'accept: application/json' \\\n --header 'authorization: Bearer ' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"name\": \"My Ai Image Editor image\",\n \"image_count\": 1,\n \"model\": \"default\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"auto\",\n \"style\": {\n \"prompt\": \"Give me sunglasses\"\n },\n \"assets\": {\n \"image_file_paths\": [\n \"api-assets/id/1234.png\",\n \"api-assets/id/1235.png\"\n ]\n }\n}\n'" + "source": "curl --request POST \\\n --url https://api.magichour.ai/v1/ai-image-editor \\\n --header 'accept: application/json' \\\n --header 'authorization: Bearer ' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"name\": \"My Ai Image Editor image\",\n \"image_count\": 1,\n \"model\": \"default\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"1k\",\n \"style\": {\n \"prompt\": \"Give me sunglasses\"\n },\n \"assets\": {\n \"image_file_paths\": [\n \"api-assets/id/1234.png\",\n \"api-assets/id/1235.png\"\n ]\n }\n}\n'" }, { "lang": "php", - "source": " \"https://api.magichour.ai/v1/ai-image-editor\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'name' => 'My Ai Image Editor image',\n 'image_count' => 1,\n 'model' => 'default',\n 'aspect_ratio' => '1:1',\n 'resolution' => 'auto',\n 'style' => [\n 'prompt' => 'Give me sunglasses'\n ],\n 'assets' => [\n 'image_file_paths' => [\n 'api-assets/id/1234.png',\n 'api-assets/id/1235.png'\n ]\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer \",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}" + "source": " \"https://api.magichour.ai/v1/ai-image-editor\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'name' => 'My Ai Image Editor image',\n 'image_count' => 1,\n 'model' => 'default',\n 'aspect_ratio' => '1:1',\n 'resolution' => '1k',\n 'style' => [\n 'prompt' => 'Give me sunglasses'\n ],\n 'assets' => [\n 'image_file_paths' => [\n 'api-assets/id/1234.png',\n 'api-assets/id/1235.png'\n ]\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer \",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}" }, { "lang": "java", - "source": "HttpResponse response = Unirest.post(\"https://api.magichour.ai/v1/ai-image-editor\")\n .header(\"accept\", \"application/json\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Bearer \")\n .body(\"{\\\"name\\\":\\\"My Ai Image Editor image\\\",\\\"image_count\\\":1,\\\"model\\\":\\\"default\\\",\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"resolution\\\":\\\"auto\\\",\\\"style\\\":{\\\"prompt\\\":\\\"Give me sunglasses\\\"},\\\"assets\\\":{\\\"image_file_paths\\\":[\\\"api-assets/id/1234.png\\\",\\\"api-assets/id/1235.png\\\"]}}\")\n .asString();" + "source": "HttpResponse response = Unirest.post(\"https://api.magichour.ai/v1/ai-image-editor\")\n .header(\"accept\", \"application/json\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Bearer \")\n .body(\"{\\\"name\\\":\\\"My Ai Image Editor image\\\",\\\"image_count\\\":1,\\\"model\\\":\\\"default\\\",\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"resolution\\\":\\\"1k\\\",\\\"style\\\":{\\\"prompt\\\":\\\"Give me sunglasses\\\"},\\\"assets\\\":{\\\"image_file_paths\\\":[\\\"api-assets/id/1234.png\\\",\\\"api-assets/id/1235.png\\\"]}}\")\n .asString();" } ] } @@ -6894,6 +6894,36 @@ { "bearerAuth": [] } + ], + "x-codeSamples": [ + { + "lang": "python", + "source": "from magic_hour import Client\nfrom os import getenv\n\nclient = Client(token=getenv(\"API_TOKEN\"))\nres = client.v1.body_swap.generate(\n assets={\n \"person_file_path\": \"/path/to/person.png\",\n \"scene_file_path\": \"/path/to/scene.png\",\n },\n resolution=\"1k\",\n name=\"My Body Swap image\",\n wait_for_completion=True,\n download_outputs=True,\n download_directory=\".\",\n)" + }, + { + "lang": "javascript", + "source": "import { Client } from \"magic-hour\";\n\nconst client = new Client({ token: process.env[\"API_TOKEN\"]!! });\nconst res = await client.v1.bodySwap.generate(\n {\n assets: {\n personFilePath: \"/path/to/person.png\",\n sceneFilePath: \"/path/to/scene.png\",\n },\n name: \"My Body Swap image\",\n resolution: \"1k\",\n },\n {\n waitForCompletion: true,\n downloadOutputs: true,\n downloadDirectory: \".\",\n },\n);" + }, + { + "lang": "go", + "source": "package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tnullable \"github.com/magichourhq/magic-hour-go/nullable\"\n\tbody_swap \"github.com/magichourhq/magic-hour-go/resources/v1/body_swap\"\n\ttypes \"github.com/magichourhq/magic-hour-go/types\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"API_TOKEN\")),\n\t)\n\tres, err := client.V1.BodySwap.Create(body_swap.CreateRequest{\n\t\tAssets: types.V1BodySwapCreateBodyAssets{\n\t\t\tPersonFilePath: \"api-assets/id/1234.png\",\n\t\t\tSceneFilePath: \"api-assets/id/5678.png\",\n\t\t},\n\t\tName: nullable.NewValue(\"My Body Swap image\"),\n\t\tResolution: types.V1BodySwapCreateBodyResolutionEnum1k,\n\t})\n}" + }, + { + "lang": "rust", + "source": "let client = magic_hour::Client::default()\n .with_bearer_auth(&std::env::var(\"API_TOKEN\").unwrap());\nlet res = client\n .v1()\n .body_swap()\n .create(magic_hour::resources::v1::body_swap::CreateRequest {\n assets: magic_hour::models::V1BodySwapCreateBodyAssets {\n person_file_path: \"api-assets/id/1234.png\".to_string(),\n scene_file_path: \"api-assets/id/5678.png\".to_string(),\n },\n name: Some(\"My Body Swap image\".to_string()),\n resolution: magic_hour::models::V1BodySwapCreateBodyResolutionEnum::Enum1k,\n })\n .await;" + }, + { + "lang": "curl", + "source": "curl --request POST \\\n --url https://api.magichour.ai/v1/body-swap \\\n --header 'accept: application/json' \\\n --header 'authorization: Bearer ' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"name\": \"My Body Swap image\",\n \"resolution\": \"1k\",\n \"assets\": {\n \"person_file_path\": \"api-assets/id/1234.png\",\n \"scene_file_path\": \"api-assets/id/5678.png\"\n }\n}\n'" + }, + { + "lang": "php", + "source": " \"https://api.magichour.ai/v1/body-swap\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'name' => 'My Body Swap image',\n 'resolution' => '1k',\n 'assets' => [\n 'person_file_path' => 'api-assets/id/1234.png',\n 'scene_file_path' => 'api-assets/id/5678.png'\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer \",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}" + }, + { + "lang": "java", + "source": "HttpResponse response = Unirest.post(\"https://api.magichour.ai/v1/body-swap\")\n .header(\"accept\", \"application/json\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Bearer \")\n .body(\"{\\\"name\\\":\\\"My Body Swap image\\\",\\\"resolution\\\":\\\"1k\\\",\\\"assets\\\":{\\\"person_file_path\\\":\\\"api-assets/id/1234.png\\\",\\\"scene_file_path\\\":\\\"api-assets/id/5678.png\\\"}}\")\n .asString();" + } ] } },