{
  "openapi": "3.1.0",
  "info": {
    "title": "Wondercraft Public API",
    "version": "0.0.1"
  },
  "paths": {
    "/podcast/scripted": {
      "post": {
        "tags": [
          "Podcasts"
        ],
        "summary": "Create any audio content with a user provided script",
        "description": "Starts a background job to produce an audio file with the provided script segments. The response\n    contains a `job_id` that can be used to query with the `/podcast/{job_id}` to query for status.\n    Requires a valid `X-API-TOKEN` header.\n\n    Throws:\n    - 429 if the user has too many jobs in flight.\n    - 400 if any voice_id or music_id provided is invalid",
        "operationId": "generate_user_scripted_episode_podcast_scripted_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateUserScriptedEpisodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateEpisodeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/podcast": {
      "post": {
        "tags": [
          "Podcasts"
        ],
        "summary": "Create any audio content with an AI-generated script",
        "description": "Starts a background job that creates an AI generated script and produces an audio file.\n    The response contains a `job_id` that can be used with the `/podcast/{job_id}` endpoint\n    to query for status.\n    Requires a valid `X-API-TOKEN` header.\n\n    Throws:\n    - 429 if the user has too many jobs in flight.\n    - 422 if provided voice_ids are not unique\n    - 400 if any voice_ids or music_ids provided are invalid",
        "operationId": "generate_ai_scripted_episode_podcast_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateAiScriptedEpisodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateEpisodeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/podcast/{job_id}": {
      "get": {
        "tags": [
          "Podcasts"
        ],
        "summary": "Get audio content result and status",
        "description": "Gets the status of podcast generation job, including a link to download it if the job was\n    successful. Requires a valid `X-API-TOKEN` header.\n\n\n    The link returned expires after 24 hours.\n    Feel free to call this endpoint again to get a fresh link, no need to regenerate the podcast\n    and waste credits.\n\n    Throws\n    - 404 if job_id is invalid",
        "operationId": "get_episode_status_podcast__job_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEpisodeStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/podcast/convo-mode/ai-scripted": {
      "post": {
        "tags": [
          "Podcasts"
        ],
        "summary": "Generate AI-scripted podcast with 2 hosts using Convo Mode",
        "description": "Starts a background job that creates an AI generated script and produces an audio file in convo mode.\n    The response contains a `job_id` that can be used with the `/podcast/{job_id}` endpoint\n    to query for status.\n    Requires a valid `X-API-TOKEN` header.\n\n\n    **Note that generating via Convo Mode yields more natural results but takes longer.\n    Expect at least 1 minute of processing per minute duration of audio before investigating a potential failure.**\n\n    Throws:\n    - 429 if the user has too many jobs in flight.\n    - 400 if any voice_ids provided are invalid or if the length of voice_ids is not 2.",
        "operationId": "generate_ai_scripted_convo_mode_episode_podcast_convo_mode_ai_scripted_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateAiScriptedConvoModeEpisodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateEpisodeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/podcast/convo-mode/user-scripted": {
      "post": {
        "tags": [
          "Podcasts"
        ],
        "summary": "Generate podcast with 2 hosts using Convo Mode, with a user provided script",
        "description": "Starts a background job to produce an audio file with the provided script segments in convo mode. The response\n    contains a `job_id` that can be used to query with the `/podcast/{job_id}` to query for status.\n    Requires a valid `X-API-TOKEN` header.\n\n\n    **Note that generating via Convo Mode yields more natural results but takes longer.\n    Expect at least 1 minute of processing per minute duration of audio before investigating a potential failure.**\n\n\n    Throws:\n    - 429 if the user has too many jobs in flight.\n    - 400 if any voice_ids provided are invalid or if the length of voice_ids is not 2.",
        "operationId": "generate_user_scripted_convo_mode_episode_podcast_convo_mode_user_scripted_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateUserScriptedConvoModeEpisodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateEpisodeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/image/models": {
      "get": {
        "tags": [
          "Images"
        ],
        "summary": "List image models",
        "description": "Lists the image models available through the API, with the resolutions, aspect ratios and\ncredits per image each one supports. Requires a valid `X-API-KEY` header.",
        "operationId": "list_image_models_image_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListImageModelsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/image/upload": {
      "post": {
        "tags": [
          "Images"
        ],
        "summary": "Upload a reference image",
        "description": "Uploads a PNG, JPEG or WebP image (up to 20 MB) to use as a reference when generating images\nor videos. Returns an `image_id` to pass in `reference_image_ids` (or as a video start/end frame).\nRequires a valid `X-API-KEY` header.\n\nThrows:\n- 400 if the file is not a PNG, JPEG or WebP image, or its dimensions are too large\n- 413 if the file is larger than 20 MB",
        "operationId": "upload_image_image_upload_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_image_image_upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/image": {
      "post": {
        "tags": [
          "Images"
        ],
        "summary": "Generate images",
        "description": "Starts a background job that generates images from a prompt, optionally editing or combining\nreference images. The response contains a `job_id` to poll with `GET /image/{job_id}`, and the\ncredits the job will be charged. Requires a valid `X-API-KEY` header.\n\nThrows:\n- 400 if the model, resolution or aspect ratio is not supported, the model does not accept\n  reference images, or the prompt references images the request does not carry\n- 402 if the workspace does not have enough credits, or the model is not available on its plan\n- 404 if a reference image does not exist or is not accessible\n- 422 if the request body is invalid",
        "operationId": "generate_image_image_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateImageApiRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateImageJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/image/{job_id}": {
      "get": {
        "tags": [
          "Images"
        ],
        "summary": "Get image job status and results",
        "description": "Gets the status of an image generation job, with download links once it has succeeded.\nRequires a valid `X-API-KEY` header.\n\nThe links expire after 24 hours. Call this endpoint again for fresh links instead of\nregenerating the images.\n\nThrows:\n- 404 if the job does not exist or was not created with this API key's user",
        "operationId": "get_image_job_image__job_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageJobStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/video/models": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "List video models",
        "description": "Lists the video models available through the API, with the modes, resolutions (and credits per\nsecond at each), durations and aspect ratios each one supports. Requires a valid `X-API-KEY` header.",
        "operationId": "list_video_models_video_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVideoModelsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/video/upload": {
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Upload a reference or source video",
        "description": "Uploads an MP4 or MOV video (up to 100 MB and 60 seconds) to use as a reference clip or as the\nvideo to edit. Returns a `video_id` to pass in `reference_video_ids` or as `source_video_id`.\nRequires a valid `X-API-KEY` header.\n\nThrows:\n- 400 if the file is not an MP4 or MOV video, has no video stream, or is longer than 60 seconds\n- 413 if the file is larger than 100 MB",
        "operationId": "upload_video_video_upload_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_video_video_upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadVideoResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/video": {
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Generate a video",
        "description": "Starts a background job that generates a video. The mode follows from the inputs you send:\nnothing extra for text-to-video, `start_frame_image_id` for image-to-video (plus\n`end_frame_image_id` for first/last frame), `reference_image_ids` and/or `reference_video_ids`\nfor references, or `source_video_id` to edit a video. The response contains a `job_id` to poll\nwith `GET /video/{job_id}`, and the credits the job is expected to cost.\nRequires a valid `X-API-KEY` header.\n\nThrows:\n- 400 if the model, mode, resolution, duration or aspect ratio is not supported, a clip is too\n  short or long, or the prompt references inputs the request does not carry\n- 402 if the workspace does not have enough credits, or the model is not available on its plan\n- 404 if an image or video does not exist or is not accessible\n- 422 if the request body is invalid, e.g. it mixes inputs from different modes",
        "operationId": "generate_video_video_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateVideoApiRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVideoJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/video/{job_id}": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "Get video job status and result",
        "description": "Gets the status of a video generation job, with a download link once it has succeeded.\nRequires a valid `X-API-KEY` header.\n\nThe link expires after 24 hours. Call this endpoint again for a fresh link instead of\nregenerating the video.\n\nThrows:\n- 404 if the job does not exist or was not created with this API key's user",
        "operationId": "get_video_job_video__job_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoJobStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/verify": {
      "get": {
        "tags": [
          "Other"
        ],
        "summary": "Verify API key",
        "description": "An endpoint to verify that your API key is functional",
        "operationId": "verify_key_verify_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/podcasts": {
      "get": {
        "summary": "Get Podcasts For User",
        "operationId": "get_podcasts_for_user_podcasts_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiAspectRatio": {
        "type": "string",
        "enum": [
          "16:9",
          "9:16",
          "1:1"
        ],
        "title": "ApiAspectRatio"
      },
      "ApiGeneratedImage": {
        "properties": {
          "image_id": {
            "type": "string",
            "format": "uuid",
            "title": "Image Id",
            "description": "Can be reused as a reference image or video start frame"
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Download URL, valid for 24 hours; poll the job again for a fresh one"
          },
          "width": {
            "type": "integer",
            "title": "Width",
            "description": "Image width in pixels"
          },
          "height": {
            "type": "integer",
            "title": "Height",
            "description": "Image height in pixels"
          }
        },
        "type": "object",
        "required": [
          "image_id",
          "url",
          "width",
          "height"
        ],
        "title": "ApiGeneratedImage"
      },
      "ApiImageModel": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Model ID to pass as `model_id` when generating"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Display name of the model"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "What the model is good at"
          },
          "resolutions": {
            "items": {
              "$ref": "#/components/schemas/ApiResolution"
            },
            "type": "array",
            "title": "Resolutions",
            "description": "Output resolutions this model supports"
          },
          "default_resolution": {
            "$ref": "#/components/schemas/ApiResolution",
            "description": "Resolution used when the request sends none"
          },
          "aspect_ratios": {
            "items": {
              "$ref": "#/components/schemas/ApiAspectRatio"
            },
            "type": "array",
            "title": "Aspect Ratios",
            "description": "Aspect ratios this model supports"
          },
          "supports_reference_images": {
            "type": "boolean",
            "title": "Supports Reference Images",
            "description": "Whether `reference_image_ids` can be sent"
          },
          "max_reference_images": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Reference Images",
            "description": "Maximum number of reference images, or null when the model sets no limit"
          },
          "credits_by_resolution": {
            "additionalProperties": {
              "type": "number"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/ApiResolution"
            },
            "type": "object",
            "title": "Credits By Resolution",
            "description": "Credits charged per generated image at each supported resolution"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "resolutions",
          "default_resolution",
          "aspect_ratios",
          "supports_reference_images",
          "credits_by_resolution"
        ],
        "title": "ApiImageModel"
      },
      "ApiJobStatus": {
        "type": "string",
        "enum": [
          "queued",
          "processing",
          "succeeded",
          "failed"
        ],
        "title": "ApiJobStatus"
      },
      "ApiResolution": {
        "type": "string",
        "enum": [
          "480p",
          "720p",
          "1080p",
          "2k",
          "4k"
        ],
        "title": "ApiResolution",
        "description": "Output resolution shared by the image and video APIs; each model lists the values it supports."
      },
      "ApiVideoMode": {
        "type": "string",
        "enum": [
          "text",
          "image",
          "frames",
          "references",
          "video_to_video"
        ],
        "title": "ApiVideoMode"
      },
      "ApiVideoModel": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Model ID to pass as `model_id` when generating"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Display name of the model"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "What the model is good at"
          },
          "modes": {
            "items": {
              "$ref": "#/components/schemas/ApiVideoMode"
            },
            "type": "array",
            "title": "Modes",
            "description": "Generation modes this model supports"
          },
          "resolutions": {
            "items": {
              "$ref": "#/components/schemas/ApiVideoResolutionOption"
            },
            "type": "array",
            "title": "Resolutions",
            "description": "Supported resolutions and their price"
          },
          "default_resolution": {
            "$ref": "#/components/schemas/ApiResolution",
            "description": "Resolution used when the request sends none"
          },
          "durations": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Durations",
            "description": "Supported output durations in seconds"
          },
          "default_duration": {
            "type": "integer",
            "title": "Default Duration",
            "description": "Duration used when the request sends none"
          },
          "aspect_ratios": {
            "items": {
              "$ref": "#/components/schemas/ApiAspectRatio"
            },
            "type": "array",
            "title": "Aspect Ratios",
            "description": "Aspect ratios this model supports"
          },
          "supports_audio": {
            "type": "boolean",
            "title": "Supports Audio",
            "description": "Whether the output includes generated audio"
          },
          "max_reference_images": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Reference Images",
            "description": "Maximum `reference_image_ids` in references mode, or null when not supported"
          },
          "max_reference_videos": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Reference Videos",
            "description": "Maximum `reference_video_ids` in references mode, or null when not supported"
          },
          "output_duration_follows_source": {
            "type": "boolean",
            "title": "Output Duration Follows Source",
            "description": "In video_to_video mode the output is as long as the source clip, and `duration` is not sent"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "modes",
          "resolutions",
          "default_resolution",
          "durations",
          "default_duration",
          "aspect_ratios",
          "supports_audio",
          "output_duration_follows_source"
        ],
        "title": "ApiVideoModel"
      },
      "ApiVideoResolutionOption": {
        "properties": {
          "resolution": {
            "$ref": "#/components/schemas/ApiResolution",
            "description": "Value to send as `resolution`"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Size the model renders at this tier, e.g. 360p for a 480p tier"
          },
          "credits_per_second": {
            "type": "number",
            "title": "Credits Per Second",
            "description": "Credits charged per generated second at this tier"
          }
        },
        "type": "object",
        "required": [
          "resolution",
          "label",
          "credits_per_second"
        ],
        "title": "ApiVideoResolutionOption"
      },
      "Body_upload_image_image_upload_post": {
        "properties": {
          "image": {
            "type": "string",
            "format": "binary",
            "title": "Image",
            "description": "PNG, JPEG or WebP image, up to 20 MB"
          }
        },
        "type": "object",
        "required": [
          "image"
        ],
        "title": "Body_upload_image_image_upload_post"
      },
      "Body_upload_video_video_upload_post": {
        "properties": {
          "video": {
            "type": "string",
            "format": "binary",
            "title": "Video",
            "description": "MP4 or MOV video, up to 100 MB and 60 seconds"
          }
        },
        "type": "object",
        "required": [
          "video"
        ],
        "title": "Body_upload_video_video_upload_post"
      },
      "CreateImageJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Poll `GET /image/{job_id}` with this ID"
          },
          "estimated_credits": {
            "type": "number",
            "title": "Estimated Credits",
            "description": "Credits this job will be charged once the images are ready"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "estimated_credits"
        ],
        "title": "CreateImageJobResponse"
      },
      "CreateVideoJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Poll `GET /video/{job_id}` with this ID"
          },
          "estimated_credits": {
            "type": "number",
            "title": "Estimated Credits",
            "description": "Credits this job is expected to cost once the video is ready"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "estimated_credits"
        ],
        "title": "CreateVideoJobResponse"
      },
      "GenerateAiScriptedConvoModeEpisodeRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "The prompt to instruct the AI to generate the script. You can specify the duration, and include links. Sometimes, the AI hallucinates, so it helps to mention that this podcast has two hosts."
          },
          "voice_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Voice Ids",
            "description": "A list of voice_ids to use for the generated audio. **Must provide exactly 2 voices for this endpoint.** If the script has multiple speakers, we will use the voices from this list in the order they appear in. All ids in this list must be unique. If no IDs are provided, 2 defaults will be used."
          },
          "delivery_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Instructions",
            "description": "An optional delivery instructions for the generated audio. This will be used to guide the generation of the audio."
          },
          "music_spec": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MusicTrackSpec"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional spec for adding background music to the generated script. Note that if the chosenmusic track is longer than the duration of the generated script, it will be cut off."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "GenerateAiScriptedConvoModeEpisodeRequest",
        "description": "A request to start a job that generates an audio file for a podcast in convo mode\nwith a script generated by AI using the provided prompt.\nAn optional list of Voice IDs can be provided to control the audio generation output. If no voice_ids are provided,\ndefaults of up to 2 convo-mode voices will be chosen."
      },
      "GenerateAiScriptedEpisodeRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "The prompt for the episode, can include links"
          },
          "voice_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Voice Ids",
            "description": "A list of voice_ids to use for the generated audio. If the script has multiple speakers, we will use the voices from this list in the order then appear in. All ids in this list must be unique. If no IDs are provided, up to 2 defaults will be used."
          },
          "music_spec": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MusicTrackSpec"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional spec for adding background music to the generated script. Note that if the chosenmusic track is longer than the duration of the generated script, it will be cut off."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "GenerateAiScriptedEpisodeRequest",
        "description": "A request to start a job that generates an audio file for audio content with a script generated by AI using the\nprovided prompt.\nAn optional list of Voice IDs can be provided to control the audio generation output. If no voice_ids are provided,\ndefaults of up to 2 speakers will be chosen."
      },
      "GenerateEpisodeResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "The job ID for the episode generation. The status of this job can be queried using the`/podcast/{job_id}` endpoint."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "job_id"
        ],
        "title": "GenerateEpisodeResponse"
      },
      "GenerateImageApiRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "title": "Prompt",
            "description": "What to generate. Refer to references as `@Image 1`, \u2026"
          },
          "model_id": {
            "type": "string",
            "title": "Model Id",
            "description": "A model `id` from `GET /image/models`"
          },
          "resolution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiResolution"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the model's `resolutions`; defaults to its `default_resolution`"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiAspectRatio"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the model's `aspect_ratios`; defaults to 1:1 when supported"
          },
          "number_of_images": {
            "type": "integer",
            "maximum": 4.0,
            "minimum": 1.0,
            "title": "Number Of Images",
            "description": "How many images to generate in this job",
            "default": 1
          },
          "reference_image_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Reference Image Ids",
            "description": "Images from `POST /image/upload` or earlier image jobs, in prompt order. The first is the image being edited; the rest are extra references."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt",
          "model_id"
        ],
        "title": "GenerateImageApiRequest"
      },
      "GenerateUserScriptedConvoModeEpisodeRequest": {
        "properties": {
          "script": {
            "items": {
              "$ref": "#/components/schemas/ScriptSegment"
            },
            "type": "array",
            "title": "Script",
            "description": "The segments forming the script for the episode"
          },
          "delivery_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Instructions",
            "description": "An optional delivery instructions for the generated audio. This will be used to guide the generation of the audio."
          },
          "music_spec": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MusicTrackSpec"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional spec for adding background music to the generated script. Note that if the chosenmusic track is longer than the duration of the generated script, it will be cut off."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "script"
        ],
        "title": "GenerateUserScriptedConvoModeEpisodeRequest",
        "description": "A request to start a job that generates an audio file for a podcast in convo mode\nwith a script generated by the user."
      },
      "GenerateUserScriptedEpisodeRequest": {
        "properties": {
          "script": {
            "items": {
              "$ref": "#/components/schemas/ScriptSegment"
            },
            "type": "array",
            "title": "Script",
            "description": "The segments forming the script for the episode"
          },
          "music_spec": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MusicTrackSpec"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional spec for adding background music to the generated script. Note that if the chosenmusic track is longer than the duration of the generated script, it will be cut off."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "script"
        ],
        "title": "GenerateUserScriptedEpisodeRequest",
        "description": "A request to start a job to generate audio content with a provided script."
      },
      "GenerateVideoApiRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "title": "Prompt",
            "description": "What to generate. Refer to references as `@Image 1` or `@Video 1`."
          },
          "model_id": {
            "type": "string",
            "title": "Model Id",
            "description": "A model `id` from `GET /video/models`"
          },
          "resolution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiResolution"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the model's `resolutions`; defaults to its `default_resolution`"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiAspectRatio"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the model's `aspect_ratios`; defaults to 16:9 when supported"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 30.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "Seconds, one of the model's `durations`; defaults to its `default_duration`"
          },
          "start_frame_image_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Frame Image Id",
            "description": "Image to open the video with (image mode), from `POST /image/upload` or an image job"
          },
          "end_frame_image_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Frame Image Id",
            "description": "Image to end the video with (frames mode); requires `start_frame_image_id`"
          },
          "reference_image_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Reference Image Ids",
            "description": "Subject or style reference images (references mode), in prompt order"
          },
          "reference_video_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Reference Video Ids",
            "description": "Motion or style reference clips (references mode), in prompt order"
          },
          "source_video_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Video Id",
            "description": "Video to edit (video_to_video mode), from `POST /video/upload` or a video job"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt",
          "model_id"
        ],
        "title": "GenerateVideoApiRequest"
      },
      "GetEpisodeStatusResponse": {
        "properties": {
          "finished": {
            "type": "boolean",
            "title": "Finished",
            "description": "Whether the episode generation is finished"
          },
          "script": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Script",
            "description": "The script used for generating the episode"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "A URL for downloading the episode"
          },
          "error": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Whether an error occurred while generating the episode"
          },
          "error_details": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Details",
            "description": "The error message if the episode generation failed"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "finished"
        ],
        "title": "GetEpisodeStatusResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ImageJobStatusResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "The job ID"
          },
          "status": {
            "$ref": "#/components/schemas/ApiJobStatus",
            "description": "queued, processing, succeeded or failed"
          },
          "images": {
            "items": {
              "$ref": "#/components/schemas/ApiGeneratedImage"
            },
            "type": "array",
            "title": "Images",
            "description": "Generated images once succeeded"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Why the job failed, when status is failed"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status"
        ],
        "title": "ImageJobStatusResponse"
      },
      "ListImageModelsResponse": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/ApiImageModel"
            },
            "type": "array",
            "title": "Models",
            "description": "Image models available through the API"
          }
        },
        "type": "object",
        "required": [
          "models"
        ],
        "title": "ListImageModelsResponse"
      },
      "ListVideoModelsResponse": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/ApiVideoModel"
            },
            "type": "array",
            "title": "Models",
            "description": "Video models available through the API"
          }
        },
        "type": "object",
        "required": [
          "models"
        ],
        "title": "ListVideoModelsResponse"
      },
      "MusicTrackSpec": {
        "properties": {
          "music_id": {
            "type": "string",
            "title": "Music Id",
            "description": "The ID of the music track to used in the background. This can be copied from theWondercraft platform"
          },
          "fade_in_ms": {
            "type": "integer",
            "title": "Fade In Ms",
            "description": "The number of milliseconds to fade in from the start of the music track",
            "default": 0
          },
          "fade_out_ms": {
            "type": "integer",
            "title": "Fade Out Ms",
            "description": "The number of milliseconds to fade out from the end of the music track",
            "default": 0
          },
          "playback_start": {
            "type": "integer",
            "title": "Playback Start",
            "description": "A millisecond into the music track at which we start playing. Equivalent to trimming thebeginning of the music track. Defaults to 0 (i.e. no trimming)",
            "default": 0
          },
          "playback_end": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Playback End",
            "description": "How many milliseconds into the music should we playback. Equivalent to trimming up to this numberof milliseconds from the music track. Defaults to the entire music track."
          },
          "volume": {
            "type": "number",
            "title": "Volume",
            "description": "The volume to apply to the music track. Defaults to 0.05. Must be between 0.0 and 1.0",
            "default": 0.05
          },
          "loop": {
            "type": "boolean",
            "title": "Loop",
            "description": "Whether to loop the music track. Defaults to False.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "music_id"
        ],
        "title": "MusicTrackSpec",
        "description": "A music track to add to the generated audio. Note that the music will always be added at the very beginning of the\ngenerated podcast and will be automatically trimmed to match the content length."
      },
      "ScriptSegment": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The text to be spoken for this part of the dialogue"
          },
          "voice_id": {
            "type": "string",
            "title": "Voice Id",
            "description": "A unique identifier for the voice copied from the Wondercraft Platform to use for the speaker of this segment."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text",
          "voice_id"
        ],
        "title": "ScriptSegment",
        "description": "A single unit of speech in the script defined by the user."
      },
      "UploadImageResponse": {
        "properties": {
          "image_id": {
            "type": "string",
            "format": "uuid",
            "title": "Image Id",
            "description": "Pass this ID in `reference_image_ids` when generating"
          },
          "width": {
            "type": "integer",
            "title": "Width",
            "description": "Image width in pixels"
          },
          "height": {
            "type": "integer",
            "title": "Height",
            "description": "Image height in pixels"
          }
        },
        "type": "object",
        "required": [
          "image_id",
          "width",
          "height"
        ],
        "title": "UploadImageResponse"
      },
      "UploadVideoResponse": {
        "properties": {
          "video_id": {
            "type": "string",
            "format": "uuid",
            "title": "Video Id",
            "description": "Pass as `reference_video_ids` or `source_video_id` when generating"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms",
            "description": "Video length in milliseconds"
          },
          "width": {
            "type": "integer",
            "title": "Width",
            "description": "Video width in pixels"
          },
          "height": {
            "type": "integer",
            "title": "Height",
            "description": "Video height in pixels"
          }
        },
        "type": "object",
        "required": [
          "video_id",
          "duration_ms",
          "width",
          "height"
        ],
        "title": "UploadVideoResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerifyResponse": {
        "properties": {
          "status": {
            "type": "string",
            "const": "ok",
            "title": "Status",
            "description": "A value representing a successful request"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "The email address of the user this token is associated with"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "email"
        ],
        "title": "VerifyResponse",
        "example": {
          "email": "example@example.com",
          "status": "ok"
        }
      },
      "VideoJobStatusResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "The job ID"
          },
          "status": {
            "$ref": "#/components/schemas/ApiJobStatus",
            "description": "queued, processing, succeeded or failed"
          },
          "video_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Id",
            "description": "Can be reused as a reference or source video"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "Download URL, valid for 24 hours; poll again for a fresh one"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms",
            "description": "Output length in milliseconds"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width",
            "description": "Output width in pixels"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height",
            "description": "Output height in pixels"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model that generated the video"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Why the job failed, when status is failed"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status"
        ],
        "title": "VideoJobStatusResponse"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.wondercraft.ai/v1",
      "description": "Base Wondercraft API"
    }
  ]
}
