> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myunite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate or edit an image, a video or music, or quote it

> Runs one generation operation, named in operation, with that operation's fields: image and video make one from a prompt; upscale, cutout and reframe edit a finished piece given as source; audio makes a music track; ad_adaptation recomposes one image for up to 10 formats, one piece per format; motion sets a finished static ad in motion by its own layers; speech speaks a text in the person's own voice, cloned for the call from their recording given as voiceSample; lipsync fits the mouth of a talking video given as source to the voice in audio; montage cuts video clips, in the order given, into one video, each clip with its own from, to, zoom and sound, with an audio generation under them and optional captions. A model left out is the operation's default (GET /create/models). With estimateOnly it quotes the request (200, nothing generated or charged). Generating needs maxCredits, the most the call may spend: a price above it is 422 confirmation_required, which states the price. The answer is 202 with the generation (status queued), pollAfterSeconds and the credit balance; read it with GET /create/generations/{id}. The Idempotency-Key header is optional: the same key returns the same generation with Idempotent-Replayed: true, and the same key with a different body is 409. Without it, the same arguments within 10 minutes return the same generation, and a later call is a new take, charged again. Media (source, references, startFrame, endFrame, sourceVideo, reference) are an upl_ uploadId, a gen_ generation id (gen_<id>#<n> for one of several outputs) or a public https link; a soundtrack is the gen_ id of a track made with operation audio. The workspace must have generation enabled (public_create): otherwise 403 feature_not_enabled; speech, lipsync and montage also need public_create_video.

Requires the `create:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json post /create/generations
openapi: 3.1.0
info:
  title: Unite API
  version: 1.0.0
  description: >-
    Run Ad Score pre-tests from your own systems: upload a creative, create a
    pre-test, and read its result and PDF report. The Ad Score routes are under
    /adscore and need the adscore:read or adscore:write scope; uploads and
    webhook endpoints are shared by every product and stay at the root. Every
    request needs an API key sent as a Bearer token. Every response carries an
    X-Request-Id header.
servers:
  - url: https://myunite.ai/api/v1
security:
  - bearerAuth: []
tags:
  - name: Catalog
    description: What you can send when you create a pre-test.
  - name: Uploads
    description: Send creative files and brand assets.
  - name: Brands
    description: Create and complete brands for your workspace.
  - name: Pretests
    description: Create pre-tests and read their results.
  - name: Quota
    description: How many pre-tests you can still run.
  - name: Create
    description: Generate and edit images, videos and music, and read what was generated.
  - name: Webhooks
    description: Manage the endpoints that are notified when a pre-test changes.
paths:
  /create/generations:
    post:
      tags:
        - Create
      summary: Generate or edit an image, a video or music, or quote it
      description: >-
        Runs one generation operation, named in operation, with that operation's
        fields: image and video make one from a prompt; upscale, cutout and
        reframe edit a finished piece given as source; audio makes a music
        track; ad_adaptation recomposes one image for up to 10 formats, one
        piece per format; motion sets a finished static ad in motion by its own
        layers; speech speaks a text in the person's own voice, cloned for the
        call from their recording given as voiceSample; lipsync fits the mouth
        of a talking video given as source to the voice in audio; montage cuts
        video clips, in the order given, into one video, each clip with its own
        from, to, zoom and sound, with an audio generation under them and
        optional captions. A model left out is the operation's default (GET
        /create/models). With estimateOnly it quotes the request (200, nothing
        generated or charged). Generating needs maxCredits, the most the call
        may spend: a price above it is 422 confirmation_required, which states
        the price. The answer is 202 with the generation (status queued),
        pollAfterSeconds and the credit balance; read it with GET
        /create/generations/{id}. The Idempotency-Key header is optional: the
        same key returns the same generation with Idempotent-Replayed: true, and
        the same key with a different body is 409. Without it, the same
        arguments within 10 minutes return the same generation, and a later call
        is a new take, charged again. Media (source, references, startFrame,
        endFrame, sourceVideo, reference) are an upl_ uploadId, a gen_
        generation id (gen_<id>#<n> for one of several outputs) or a public
        https link; a soundtrack is the gen_ id of a track made with operation
        audio. The workspace must have generation enabled (public_create):
        otherwise 403 feature_not_enabled; speech, lipsync and montage also need
        public_create_video.


        Requires the `create:write` scope.
      operationId: createGeneration
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            1 to 255 visible ASCII characters. The same key, the same
            generation; a new key is a new take.
          schema:
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[\x21-\x7E]{1,255}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGenerationRequest'
      responses:
        '200':
          description: The quote, when estimateOnly is true.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationQuote'
        '202':
          description: Generation accepted.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Location:
              $ref: '#/components/headers/Location'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationStarted'
        '400':
          description: 'Error. Possible codes: invalid_request.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Error. Possible codes: invalid_api_key, api_key_revoked,
            api_key_expired.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: 'Error. Possible codes: insufficient_credits.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Error. Possible codes: feature_not_enabled, key_owner_not_member,
            insufficient_scope.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 'Error. Possible codes: not_found, upload_not_found.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Error. Possible codes: idempotency_conflict.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Error. Possible codes: invalid_request, confirmation_required,
            content_rejected, upload_invalid, file_too_large,
            source_url_rejected, source_url_unreachable.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Error. Possible codes: rate_limited, concurrency_limit,
            spend_limit_reached.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'Error. Possible codes: internal_error.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 'Error. Possible codes: internal_error.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateGenerationRequest:
      oneOf:
        - $ref: '#/components/schemas/CreateImageGenerationRequest'
        - $ref: '#/components/schemas/CreateVideoGenerationRequest'
        - $ref: '#/components/schemas/CreateUpscaleGenerationRequest'
        - $ref: '#/components/schemas/CreateCutoutGenerationRequest'
        - $ref: '#/components/schemas/CreateReframeGenerationRequest'
        - $ref: '#/components/schemas/CreateAudioGenerationRequest'
        - $ref: '#/components/schemas/CreateAdAdaptationGenerationRequest'
        - $ref: '#/components/schemas/CreateMotionGenerationRequest'
        - $ref: '#/components/schemas/CreateSpeechGenerationRequest'
        - $ref: '#/components/schemas/CreateLipsyncGenerationRequest'
        - $ref: '#/components/schemas/CreateMontageGenerationRequest'
      discriminator:
        propertyName: operation
        mapping:
          image: '#/components/schemas/CreateImageGenerationRequest'
          video: '#/components/schemas/CreateVideoGenerationRequest'
          upscale: '#/components/schemas/CreateUpscaleGenerationRequest'
          cutout: '#/components/schemas/CreateCutoutGenerationRequest'
          reframe: '#/components/schemas/CreateReframeGenerationRequest'
          audio: '#/components/schemas/CreateAudioGenerationRequest'
          ad_adaptation: '#/components/schemas/CreateAdAdaptationGenerationRequest'
          motion: '#/components/schemas/CreateMotionGenerationRequest'
          speech: '#/components/schemas/CreateSpeechGenerationRequest'
          lipsync: '#/components/schemas/CreateLipsyncGenerationRequest'
          montage: '#/components/schemas/CreateMontageGenerationRequest'
    GenerationQuote:
      type: object
      properties:
        estimate:
          type: object
          properties:
            model:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
            estimatedCredits:
              description: The price as charged, in credits.
              type:
                - number
                - 'null'
            adjustments:
              type: array
              items:
                type: string
              description: What was changed to fit the model.
            unusableMedia:
              type: array
              items:
                type: object
                properties:
                  param:
                    type: string
                  value:
                    type: string
                  reason:
                    type: string
                    enum:
                      - no_slot
                      - slot_taken
                      - slot_full
                      - dropped
                required:
                  - param
                  - value
                  - reason
            blockedReason:
              description: Why this request cannot run as it is.
              type: string
          required:
            - model
            - estimatedCredits
            - adjustments
            - unusableMedia
        credits:
          type: object
          properties:
            balance:
              type: number
          required:
            - balance
      required:
        - estimate
        - credits
    GenerationStarted:
      type: object
      properties:
        generation:
          type: object
          properties:
            id:
              type: string
              description: gen_ followed by the generation id.
            status:
              type: string
              enum:
                - queued
                - generating
                - completed
                - failed
            mediaType:
              type: string
              enum:
                - image
                - video
                - audio
            model:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
            prompt:
              description: Only when one generation is read, never in a list.
              type: string
            createdAt:
              type: string
              description: ISO 8601 UTC.
            completedAt:
              description: ISO 8601 UTC. Null until the generation ends.
              type:
                - string
                - 'null'
            cost:
              type: object
              properties:
                estimatedCredits:
                  type:
                    - number
                    - 'null'
                chargedCredits:
                  description: Null while the charge is still settling.
                  type:
                    - number
                    - 'null'
                refunded:
                  type: boolean
                refundedCredits:
                  description: >-
                    When only part of the generation is refunded (formats that
                    failed), the credits refunded or being refunded.
                  type: number
              required:
                - estimatedCredits
                - chargedCredits
                - refunded
            outputs:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                  thumbnailUrl:
                    type:
                      - string
                      - 'null'
                  mimeType:
                    type:
                      - string
                      - 'null'
                  width:
                    type:
                      - number
                      - 'null'
                  height:
                    type:
                      - number
                      - 'null'
                  durationSeconds:
                    type:
                      - number
                      - 'null'
                  format:
                    description: >-
                      When one piece was adapted to several formats, the WxH
                      format of this file.
                    type: string
                  ref:
                    description: >-
                      When the generation has several files, this one as a media
                      argument: gen_<id>#<n>, n counted from 1 in outputs.
                    type: string
                required:
                  - url
                  - thumbnailUrl
                  - mimeType
                  - width
                  - height
                  - durationSeconds
            error:
              anyOf:
                - type: object
                  properties:
                    code:
                      type: string
                      enum:
                        - content_rejected
                        - cancelled
                        - system_failure
                        - generation_failed
                    message:
                      type: string
                  required:
                    - code
                    - message
                - type: 'null'
            videoEditId:
              description: The edit this video came from; its cost is the edit's.
              type: string
          required:
            - id
            - status
            - mediaType
            - model
            - createdAt
            - completedAt
            - cost
            - outputs
            - error
        pollAfterSeconds:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        reused:
          type: boolean
          const: true
        credits:
          type: object
          properties:
            balance:
              type: number
          required:
            - balance
      required:
        - generation
        - pollAfterSeconds
        - credits
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - api_key_revoked
                - api_key_expired
                - insufficient_scope
                - insufficient_role
                - confirmation_required
                - content_rejected
                - insufficient_credits
                - spend_limit_reached
                - feature_not_enabled
                - key_owner_not_member
                - rate_limited
                - concurrency_limit
                - invalid_request
                - idempotency_key_required
                - idempotency_conflict
                - idempotency_key_retired
                - upload_not_found
                - upload_invalid
                - file_too_large
                - video_too_long
                - source_url_rejected
                - source_url_unreachable
                - invalid_ooh_format
                - voice_origin_mismatch
                - invalid_placement
                - brand_not_found
                - quota_exhausted
                - not_found
                - report_not_ready
                - pretest_in_progress
                - webhook_url_rejected
                - webhook_endpoint_limit
                - internal_error
              description: >-
                Stable machine-readable code. Branch on this, not on the
                message. voice_origin_mismatch is legacy: no longer returned.
            message:
              type: string
              description: Human-readable explanation in English. Its wording can change.
            requestId:
              type: string
              description: >-
                Same value as the X-Request-Id response header. Quote it when
                you email support@myunite.ai.
            docUrl:
              type: string
              description: Page that explains this code.
            param:
              description: >-
                The field, query parameter or header the error refers to, when
                there is one.
              type: string
          required:
            - code
            - message
            - requestId
            - docUrl
      required:
        - error
    CreateImageGenerationRequest:
      type: object
      required:
        - operation
        - prompt
      additionalProperties: false
      properties:
        operation:
          type: string
          const: image
        prompt:
          type: string
          minLength: 1
          maxLength: 20000
        model:
          type: string
          enum:
            - gpt_image_2_5
            - gpt_image_2_6
            - nano_banana_2_pro
            - nano_banana_2
          default: gpt_image_2_5
        aspect:
          type: string
          enum:
            - '1:1'
            - '4:3'
            - '3:4'
            - '16:9'
            - '9:16'
            - auto
            - '21:9'
            - '3:2'
            - '2:3'
            - '5:4'
            - '4:5'
            - '4:1'
            - '1:4'
            - '8:1'
            - '1:8'
        quality:
          type: string
          enum:
            - low
            - medium
            - high
        resolution:
          type: string
          enum:
            - 1K
            - 2K
            - 4K
        references:
          type: array
          maxItems: 16
          items:
            type: string
            minLength: 1
            maxLength: 4096
            description: >-
              An upl_ uploadId, a gen_ generation id (gen_<id>#<n> for its nth
              output, the output's ref) or a public https link.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateVideoGenerationRequest:
      type: object
      required:
        - operation
        - prompt
      additionalProperties: false
      properties:
        operation:
          type: string
          const: video
        prompt:
          type: string
          minLength: 1
          maxLength: 20000
        model:
          type: string
          enum:
            - ugc_video_wan
            - minimax_h3
            - gemini_omni_flash_v1_2
            - seedance_2_5
          default: ugc_video_wan
        aspect:
          type: string
          enum:
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
            - '21:9'
        resolution:
          type: string
          enum:
            - 480p
            - 720p
            - 1080p
            - 768p
            - 2k
            - 360p
            - 4k
        seconds:
          type: integer
          minimum: 3
          maximum: 30
        audio:
          type: boolean
          description: false for a silent clip, on models with sound.
        startFrame:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The image the clip opens on: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        endFrame:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The image the clip ends on: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        sourceVideo:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            A video to edit: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        expectedSpeech:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            The exact words the clip should say; GET /create/generations/{id}
            then adds checks measuring its speech and mouth, free. Needs
            public_create_video.
        references:
          type: array
          maxItems: 16
          items:
            type: string
            minLength: 1
            maxLength: 4096
            description: >-
              An upl_ uploadId, a gen_ generation id (gen_<id>#<n> for its nth
              output, the output's ref) or a public https link.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateUpscaleGenerationRequest:
      type: object
      required:
        - operation
        - source
      additionalProperties: false
      properties:
        operation:
          type: string
          const: upscale
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The image or video to upscale: an upl_ uploadId, a gen_ generation
            id (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        model:
          type: string
          enum:
            - clarity_upscaler
            - topaz_video_upscale
            - crystal_video_upscaler
          description: >-
            Without it, clarity_upscaler for an image and topaz_video_upscale
            for a video.
        scale:
          type: number
          minimum: 1
          maximum: 16
          description: >-
            How many times larger, on clarity_upscaler and
            crystal_video_upscaler.
        resolution:
          type: string
          enum:
            - 720p
            - 1080p
            - 4k
          description: The target size, on topaz_video_upscale.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateCutoutGenerationRequest:
      type: object
      required:
        - operation
        - source
      additionalProperties: false
      properties:
        operation:
          type: string
          const: cutout
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The image whose background is removed: an upl_ uploadId, a gen_
            generation id (gen_<id>#<n> for its nth output, the output's ref) or
            a public https link.
        model:
          type: string
          enum:
            - remove_background_image
          default: remove_background_image
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateReframeGenerationRequest:
      type: object
      required:
        - operation
        - source
        - aspect
      additionalProperties: false
      properties:
        operation:
          type: string
          const: reframe
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The image to reframe: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        model:
          type: string
          enum:
            - ideogram_v3_reframe
          default: ideogram_v3_reframe
        aspect:
          type: string
          enum:
            - '1:1'
            - '3:4'
            - '9:16'
            - '4:3'
            - '16:9'
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateAudioGenerationRequest:
      type: object
      required:
        - operation
        - prompt
      additionalProperties: false
      properties:
        operation:
          type: string
          const: audio
        prompt:
          type: string
          minLength: 1
          maxLength: 20000
          description: Genre, mood, instruments, tempo, vocals, language and structure.
        model:
          type: string
          enum:
            - google_lyria_3_5
          default: google_lyria_3_5
        reference:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            One image the music follows: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateAdAdaptationGenerationRequest:
      type: object
      required:
        - operation
        - source
        - formats
      additionalProperties: false
      properties:
        operation:
          type: string
          const: ad_adaptation
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The finished image to adapt: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        formats:
          type: array
          minItems: 1
          maxItems: 10
          uniqueItems: true
          items:
            type: string
            pattern: ^[1-9][0-9]{0,5}x[1-9][0-9]{0,5}$
          description: >-
            Each WxH in pixels, 50 to 4096 a side, such as 1080x1920; one piece
            per format, each one priced.
        instructions:
          type: string
          minLength: 1
          maxLength: 3000
          description: What to keep or change.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateMotionGenerationRequest:
      type: object
      required:
        - operation
        - source
        - format
      additionalProperties: false
      properties:
        operation:
          type: string
          const: motion
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The finished static image to set in motion: an upl_ uploadId, a gen_
            generation id (gen_<id>#<n> for its nth output, the output's ref) or
            a public https link.
        format:
          type: string
          enum:
            - '9:16'
            - '4:5'
            - '1:1'
            - '16:9'
            - 1.91:1
          description: >-
            The video's canvas; a piece of another proportion plays whole over a
            blurred fill.
        seconds:
          type: integer
          minimum: 4
          maximum: 60
          description: Default 7.
        motion:
          type: string
          enum:
            - reveal
            - parallax
            - float
            - impact
          description: >-
            reveal (default) builds the piece in, parallax moves through its
            depth, float lifts the product, impact punches it in.
        hero:
          type: string
          minLength: 2
          maxLength: 120
          description: What the piece sells, as it looks; the motion centers on it.
        shine:
          type: boolean
          description: A light sweep over a glossy hero.
        fresh:
          type: boolean
          description: Split the layers again, charged again.
        soundtrack:
          type: string
          minLength: 1
          maxLength: 72
          pattern: ^gen_
          description: >-
            The gen_ generation id (gen_<id>#<n> for its nth output) of a track
            made with operation audio.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateSpeechGenerationRequest:
      type: object
      required:
        - operation
        - text
        - voiceSample
      additionalProperties: false
      properties:
        operation:
          type: string
          const: speech
        text:
          type: string
          minLength: 1
          maxLength: 2000
          description: The exact words to speak, numbers written as spoken.
        voiceSample:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The person's own recording speaking, whose sound is used: an upl_
            uploadId or a public https link. A generation is not a voice sample.
          pattern: ^(upl_|https://)
        subjectConsent:
          type: boolean
          description: >-
            Optional: true records that the voice is the person's own and that
            they agreed to speech made in it.
        language:
          type: string
          pattern: ^[a-z]{2}$
          description: >-
            The language of the text, two letters such as en or pt; pt when left
            out.
        model:
          type: string
          enum:
            - elevenlabs_avatar_speech
          default: elevenlabs_avatar_speech
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateLipsyncGenerationRequest:
      type: object
      required:
        - operation
        - source
        - audio
      additionalProperties: false
      properties:
        operation:
          type: string
          const: lipsync
        source:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The talking video: an upl_ uploadId, a gen_ generation id
            (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link.
        audio:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The voice the mouth follows, up to 60 seconds: the gen_ generation
            id (gen_<id>#<n> for its nth output) of an audio, such as a speech,
            or a video whose sound is used (an upl_ uploadId, a gen_ generation
            id (gen_<id>#<n> for its nth output, the output's ref) or a public
            https link).
        subjectConsent:
          type: boolean
          description: 'Optional: true records that the person in the video authorized it.'
        expectedSpeech:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            The exact words the clip should say; GET /create/generations/{id}
            then adds checks measuring its speech and mouth, free. Needs
            public_create_video.
        model:
          type: string
          enum:
            - lipsync/syncso-v2
          default: lipsync/syncso-v2
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
    CreateMontageGenerationRequest:
      type: object
      required:
        - operation
        - clips
        - format
      additionalProperties: false
      properties:
        operation:
          type: string
          const: montage
        clips:
          type: array
          minItems: 1
          maxItems: 40
          description: >-
            The clips in the order they play; a clip can repeat with another
            stretch or zoom.
          items:
            type: object
            required:
              - media
            additionalProperties: false
            properties:
              media:
                type: string
                minLength: 1
                maxLength: 4096
                description: >-
                  A video clip (an image is refused): an upl_ uploadId, a gen_
                  generation id (gen_<id>#<n> for its nth output, the output's
                  ref) or a public https link.
              from:
                type: number
                minimum: 0
                description: The clip's second where its stretch starts; default 0.
              to:
                type: number
                minimum: 0
                description: Where the stretch ends, after from; default the clip's end.
              zoom:
                type: number
                minimum: 1
                maximum: 3
                description: 1 is none; 1.08 punches in.
              sound:
                type: string
                enum:
                  - keep
                  - mute
                description: keep (default) plays the clip's own sound.
        format:
          type: string
          enum:
            - '9:16'
            - '4:5'
            - '1:1'
            - '16:9'
            - 1.91:1
          description: The video's canvas.
        audio:
          type: string
          minLength: 1
          maxLength: 72
          pattern: ^gen_
          description: >-
            The gen_ generation id (gen_<id>#<n> for its nth output) of an
            audio, such as a track made with operation audio or a speech, played
            under the clips.
        audioLevel:
          type: string
          enum:
            - bed
            - balanced
            - lead
          description: >-
            bed (default with a clip's own sound) sits under the voices,
            balanced matches them, lead carries the piece. Only with audio.
        captions:
          type: boolean
          description: >-
            true burns in captions of the clips' speech; a clip has to keep its
            sound.
        estimateOnly:
          type: boolean
          description: 'Quote only: nothing is generated or charged.'
        maxCredits:
          type: number
          minimum: 0
          description: The most this call may spend; needed to generate.
  headers:
    X-Request-Id:
      description: >-
        Identifier of this request. Quote it when you email support@myunite.ai.
        It is also in error.requestId.
      schema:
        type: string
    RateLimit-Limit:
      description: >-
        Requests allowed per minute for this key and bucket: 600 for reads, 60
        for writes. Sent on responses once the key is accepted. On 401 errors
        and on 403 errors raised while the key is checked they may be absent.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the oldest counted request leaves the window.
      schema:
        type: integer
    Location:
      description: Path of the created pre-test, for example /api/v1/adscore/pretests/{id}.
      schema:
        type: string
    Idempotent-Replayed:
      description: >-
        Sent as true when the response replays a resource created by an earlier
        request with the same Idempotency-Key.
      schema:
        type: string
        enum:
          - 'true'
    Retry-After:
      description: Seconds to wait before you try again.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key, sent as `Authorization: Bearer unite_live_...`. Create keys in
        the workspace settings.

````

## Related topics

- [Envio de arquivos](https://docs.myunite.ai/uploads.md)
- [Get a pre-test](https://docs.myunite.ai/api-reference/pretests/get-a-pre-test.md)
- [Create an upload target for a creative file](https://docs.myunite.ai/api-reference/uploads/create-an-upload-target-for-a-creative-file.md)
- [List the models of every generation operation](https://docs.myunite.ai/api-reference/create/list-the-models-of-every-generation-operation.md)
- [List generations, or read several by id](https://docs.myunite.ai/api-reference/create/list-generations-or-read-several-by-id.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.