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

# Generate Replace Actor Video

> Create a motion-transfer job that applies reference video movement to a supplied character image.



## OpenAPI

````yaml /openapi.json post /v1/replace-actors/generations
openapi: 3.1.0
info:
  title: TurboAds Public API
  version: 1.0.0
  description: >-
    Workspace-scoped API for creating media generation jobs and polling for
    results.
servers:
  - url: https://api.turboads.ai
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Discover projects available to the API key workspace.
  - name: Voices
    description: Discover voices for talking actor generations.
  - name: Actors
    description: Discover actors for talking actor generations.
  - name: Images
    description: Create image generation jobs, poll status, and fetch final URLs.
  - name: Videos
    description: Create video generation jobs, poll status, and fetch final URLs.
  - name: Replace Actors
    description: Create motion-transfer jobs from a character image and reference video.
  - name: Talking Actors
    description: Create AI actor videos, poll status, and fetch final URLs.
paths:
  /v1/replace-actors/generations:
    post:
      tags:
        - Replace Actors
      summary: Generate Replace Actor Video
      description: >-
        Create a motion-transfer job that applies reference video movement to a
        supplied character image.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceActorGenerationRequest'
            example:
              project_id: j97project123abc456def789
              image_url: https://example.com/character.png
              video_url: https://example.com/reference-video.mp4
              prompt: >-
                Keep the same movement and product interaction from the
                reference video
              duration: 8
              aspect_ratio: '9:16'
      responses:
        '200':
          description: Replace Actor generation job created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/VideoGenerationCreateResponse'
              examples:
                success:
                  summary: Success
                  value:
                    data:
                      id: j97video123abc456def789
                      status: pending
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ReplaceActorGenerationRequest:
      type: object
      required:
        - project_id
      properties:
        project_id:
          type: string
          description: Existing project ID in the API key workspace.
        image_url:
          type: string
          format: uri
          description: >-
            Public character image URL. Use image_file_id instead when uploading
            through the API.
        video_url:
          type: string
          format: uri
          description: >-
            Public motion reference video URL. Use video_file_id instead when
            uploading through the API.
        prompt:
          type: string
          description: Optional context for the replacement job.
        duration:
          type: number
          minimum: 3
          maximum: 30
          default: 30
          description: Reference video duration in seconds.
        aspect_ratio:
          type: string
          enum:
            - '1:1'
            - '9:16'
            - '16:9'
          default: '9:16'
        image_file_id:
          type: string
          description: Completed image file upload ID for the replacement character image.
        video_file_id:
          type: string
          description: Completed video file upload ID for the motion reference video.
      description: >-
        Provide either image_file_id and video_file_id from file uploads, or
        image_url and video_url.
    VideoGenerationCreateResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          description: Generated video ID to poll.
        status:
          type: string
          enum:
            - pending
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
    RateLimitErrorResponse:
      type: object
      required:
        - error
        - retry_after_ms
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        retry_after_ms:
          type: number
          description: Milliseconds to wait before retrying.
    ApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
  responses:
    BadRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Required fields are missing or malformed.
              value:
                error:
                  code: invalid_request
                  message: Required fields are missing or malformed.
    Unauthorized:
      description: The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Missing, invalid, or revoked API key.
              value:
                error:
                  code: unauthorized
                  message: Missing, invalid, or revoked API key.
    PaymentRequired:
      description: The workspace does not have enough credits for the requested generation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Insufficient credits.
              value:
                error:
                  code: insufficient_credits
                  message: 'Insufficient credits. Required: 8, Available: 2'
    Forbidden:
      description: The requested project is outside the API key workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Project does not belong to this API key workspace.
              value:
                error:
                  code: forbidden
                  message: Project does not belong to this API key workspace.
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Resource not found.
              value:
                error:
                  code: not_found
                  message: Resource not found.
    RateLimited:
      description: The API key exceeded its rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
          examples:
            error:
              summary: Rate limited
              value:
                error:
                  code: rate_limited
                  message: Rate limit exceeded.
                retry_after_ms: 1200
    InternalServerError:
      description: Unexpected server or storage configuration error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            error:
              summary: Internal server error
              value:
                error:
                  code: internal_error
                  message: Something went wrong.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your TurboAds API key
      x-default: ta_live_your_api_key

````