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

> ## Agent Instructions
> Five API is a video generation REST API. Base URL: https://api.fiveapi.ai. Authenticate with the header Authorization: Bearer <API key>; read the key from the FIVEAPI_API_KEY environment variable and never hard-code it.
> Every generation is an asynchronous task: POST /v1/{brand}/{version}/{task} returns a queued task, then poll GET /v1/tasks/{task_id} or receive a signed webhook, and download output.video.url before expires_at (7 days).
> The OpenAPI spec is at https://docs.fiveapi.ai/api-reference/openapi.yaml. An installable agent skill: npx skills add https://docs.fiveapi.ai

# Video Fast Extend 1.1 — video extend

> Continue an existing clip with **Video Fast Extend 1.1**, with matched audio when `generate_audio` is
true. 480p, 720p or 1080p.

`duration` is the number of seconds **added** after the clip (3–30). The clip, after the optional
`start_time` / `end_time` window (send both or neither), must be 2–30 seconds long, and clip plus added
seconds may not exceed 30 seconds. The result is the clip followed by the continuation, so
`output.video.duration` is at least `duration`.

The clip must be a public HTTPS URL of an MP4 or MOV file, 360–2,000 px per side, at most 500 MB. Guide:
[Video extend](/guides/video-extend).




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/video-fast/v1.1/video-extend
openapi: 3.1.0
info:
  title: Five API
  version: 1.0.0
  summary: Generate AI videos from text, images, reference assets and clips.
  description: >
    The Five API turns a text prompt, an image, a set of reference assets or a
    video clip into a short video.


    Every generation is an asynchronous **task**: `POST
    /v1/{brand}/{version}/{task}` returns a `queued` task at

    once, and the result arrives by webhook or by polling `GET
    /v1/tasks/{task_id}`.


    * Base URL: `https://api.fiveapi.ai`

    * Authentication: `Authorization: Bearer <API key>` (or the `x-api-key`
    header)

    * JSON in and out, `snake_case` fields, UTF-8, ISO 8601 UTC timestamps

    * Every response carries `X-Request-Id`; error bodies repeat it as
    `error.request_id`
  contact:
    name: Five API support
    email: support@fiveapi.ai
    url: https://docs.fiveapi.ai
servers:
  - url: https://api.fiveapi.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Video Fast 1.0
    description: Fast, low-cost generation at 480p or 768p.
  - name: Wan 3.0 Spark
    description: Native 30-second video with richer detail and synchronized audio.
  - name: Wan 3.0 Prime Spark
    description: Wan 3.0 quality at full 30 seconds, noticeably faster.
  - name: Video Fast Extend 1.1
    description: Continue an existing clip with matched audio.
  - name: Tasks
    description: Read, list and cancel generation tasks.
  - name: Models
    description: The model catalogue and each model's input schema.
  - name: Account
    description: Balance, plan limits and daily usage.
paths:
  /v1/video-fast/v1.1/video-extend:
    post:
      tags:
        - Video Fast Extend 1.1
      summary: Video Fast Extend 1.1 — video extend
      description: >
        Continue an existing clip with **Video Fast Extend 1.1**, with matched
        audio when `generate_audio` is

        true. 480p, 720p or 1080p.


        `duration` is the number of seconds **added** after the clip (3–30). The
        clip, after the optional

        `start_time` / `end_time` window (send both or neither), must be 2–30
        seconds long, and clip plus added

        seconds may not exceed 30 seconds. The result is the clip followed by
        the continuation, so

        `output.video.duration` is at least `duration`.


        The clip must be a public HTTPS URL of an MP4 or MOV file, 360–2,000 px
        per side, at most 500 MB. Guide:

        [Video extend](/guides/video-extend).
      operationId: videoFastExtend11VideoExtend
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoExtendRequest'
            examples:
              window:
                summary: Add 5 seconds after the first 8 seconds of a clip
                value:
                  video_url: https://assets.example.com/inputs/clip.mp4
                  prompt: the camera keeps panning right across the skyline
                  duration: 5
                  resolution: 480p
                  start_time: 0
                  end_time: 8
      responses:
        '200':
          description: The task was accepted and queued.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
              example:
                id: task_01J9XG8H9J0K1L2M3N4P5Q6R7S
                object: task
                model: video-fast/v1.1/video-extend
                task: video-extend
                status: queued
                input:
                  video_url: https://assets.example.com/inputs/clip.mp4
                  prompt: the camera keeps panning right across the skyline
                  duration: 5
                  resolution: 480p
                  start_time: 0
                  end_time: 8
                error: null
                credits:
                  estimated: 68
                created_at: '2026-10-23T08:02:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >
        Optional key that makes the request safe to retry: any string up to 128
        characters, unique per account,

        kept for 24 hours. The same key with the same body replays the first
        answer (`Idempotent-Replayed: true`)

        instead of creating a second task. See
        [Idempotency](/concepts/idempotency).
      schema:
        type: string
        maxLength: 128
        examples:
          - order-8812-attempt-1
  schemas:
    VideoExtendRequest:
      type: object
      title: Video Fast Extend 1.1 request
      required:
        - video_url
        - prompt
        - duration
        - resolution
      properties:
        video_url:
          type: string
          format: uri
          description: >-
            Public HTTPS URL of the MP4 or MOV clip to continue, 360–2,000 px
            per side, at most 500 MB. The clip (after the optional window) must
            be 2–30 seconds long.
          examples:
            - https://assets.example.com/inputs/clip.mp4
        prompt:
          type: string
          maxLength: 2000
          description: How the video continues after the clip.
          examples:
            - the camera keeps panning right across the skyline
        start_time:
          type: number
          minimum: 0
          description: >-
            Start of the window of the clip to continue from, in seconds. Send
            `start_time` and `end_time` together, or neither.
          examples:
            - 0
        end_time:
          type: number
          description: End of the window, in seconds. Must be greater than `start_time`.
          examples:
            - 8
        duration:
          type: integer
          minimum: 3
          maximum: 30
          description: >-
            Seconds to add after the clip. Clip plus added seconds may not
            exceed 30 seconds.
          examples:
            - 5
        resolution:
          type: string
          enum:
            - 480p
            - 720p
            - 1080p
          description: Output resolution.
          examples:
            - 480p
        generate_audio:
          $ref: '#/components/schemas/GenerateAudio'
        prompt_expansion:
          $ref: '#/components/schemas/PromptExpansion'
        webhook_url:
          $ref: '#/components/schemas/WebhookUrl'
        metadata:
          $ref: '#/components/schemas/Metadata'
    Task:
      type: object
      description: >-
        A generation task. `error` is always present (`null` unless the task
        failed); other empty members are omitted.
      required:
        - id
        - object
        - model
        - task
        - status
        - input
        - error
        - credits
        - created_at
      properties:
        id:
          type: string
          description: Task id, `task_` followed by 26 characters.
          examples:
            - task_01J9X7Z0K7Q8W3F2P1N6M5V4R3
        object:
          type: string
          const: task
        model:
          type: string
          description: The model id the task was created with.
          examples:
            - wan/v3.0-spark/image-to-video
        task:
          type: string
          enum:
            - text-to-video
            - image-to-video
            - reference-to-video
            - video-extend
          description: The task type, the last segment of the model id.
        status:
          $ref: '#/components/schemas/TaskStatus'
        input:
          type: object
          additionalProperties: true
          description: The accepted request body, without `webhook_url` and `metadata`.
        output:
          $ref: '#/components/schemas/TaskOutput'
        error:
          description: Why the task failed. `null` unless `status` is `failed`.
          oneOf:
            - $ref: '#/components/schemas/TaskError'
            - type: 'null'
        credits:
          $ref: '#/components/schemas/Credits'
        queue:
          $ref: '#/components/schemas/Queue'
        webhook_url:
          type: string
          format: uri
          description: The webhook URL sent with the task.
        metadata:
          type: object
          additionalProperties: true
          description: The metadata sent with the task.
        created_at:
          type: string
          format: date-time
          description: When the task was created.
        started_at:
          type: string
          format: date-time
          description: When generation started.
        completed_at:
          type: string
          format: date-time
          description: When the task reached `completed`, `failed` or `cancelled`.
        expires_at:
          type: string
          format: date-time
          description: When the output is removed, 7 days after completion.
    GenerateAudio:
      type: boolean
      default: false
      description: Generate synchronized audio together with the video.
    PromptExpansion:
      type: string
      enum:
        - none
        - basic
        - advanced
      default: advanced
      description: >-
        How much the prompt is rewritten before generation: `none` keeps your
        text, `basic` polishes it, `advanced` expands it into a detailed shot
        description. The final text is returned as `output.actual_prompt`.
    WebhookUrl:
      type: string
      format: uri
      description: >-
        Public HTTPS URL that receives this task's events. Overrides your
        account's default webhook endpoint.
      examples:
        - https://hooks.example.com/fiveapi
    Metadata:
      type: object
      additionalProperties: true
      description: >-
        Your own JSON, up to 4,096 bytes when serialized. Returned unchanged on
        the task and in every webhook.
      examples:
        - order_id: ord_8812
    TaskStatus:
      type: string
      enum:
        - queued
        - processing
        - completed
        - failed
        - cancelled
      description: >-
        `queued` → `processing` → one of the terminal states `completed`,
        `failed`, `cancelled`.
    TaskOutput:
      type: object
      description: The result. Present on `completed` tasks until `expires_at`.
      properties:
        video:
          $ref: '#/components/schemas/Video'
        actual_prompt:
          type: string
          description: The prompt after expansion, when it was rewritten.
        seed:
          type: integer
          format: int64
          description: The seed used, when the model reports it.
    TaskError:
      type: object
      description: Why a task failed.
      required:
        - code
        - message
        - retryable
      properties:
        code:
          type: string
          enum:
            - input_fetch_failed
            - input_invalid
            - content_moderation_rejected
            - generation_failed
            - timeout
            - service_unavailable
          description: Stable failure code. See [Errors](/concepts/errors#task-failures).
        message:
          type: string
          description: Human-readable detail. It may change; branch on `code`.
        retryable:
          type: boolean
          description: True when submitting the same request again may succeed.
        reason:
          type: string
          enum:
            - ip
            - audio_copyright
            - public_figure
          description: 'For `content_moderation_rejected`: the category, when classified.'
    Credits:
      type: object
      required:
        - estimated
      properties:
        estimated:
          type: integer
          format: int64
          description: Credits held when the task was accepted.
          examples:
            - 60
        charged:
          type: integer
          format: int64
          description: >-
            Credits charged. Set when the task completes; absent on failed and
            cancelled tasks, whose hold was released.
          examples:
            - 60
    Queue:
      type: object
      description: Present while the task is `queued`.
      properties:
        position:
          type: integer
          description: Position in the model's queue; lower starts sooner.
          examples:
            - 3
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - billing_error
                - permission_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - api_error
              description: The error category.
            code:
              type: string
              description: >-
                Stable machine-readable code. Branch on this, never on
                `message`.
              examples:
                - insufficient_credits
            message:
              type: string
              description: Human-readable detail. It may change.
            param:
              type: string
              description: The request field at fault, when there is one.
            request_id:
              type: string
              description: Same as the `X-Request-Id` header.
            details:
              type: object
              additionalProperties: true
              description: >-
                Extra members for some codes, for example `required` and
                `available` on `insufficient_credits`.
    Video:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Download URL of the MP4, valid until `expires_at`.
          examples:
            - >-
              https://openassets.fiveapi.ai/x2v/results/551fe9fa/openapi_1793171336.mp4
        content_type:
          type: string
          examples:
            - video/mp4
        file_size:
          type: integer
          format: int64
          description: Size in bytes.
        width:
          type: integer
          description: Width in pixels.
        height:
          type: integer
          description: Height in pixels.
        duration:
          type: number
          description: Length in seconds.
        fps:
          type: integer
          description: Frames per second.
        cover_url:
          type: string
          format: uri
          description: First-frame image (JPG), when available.
  headers:
    X-Request-Id:
      description: Id of this request (`req_...`). Quote it when you contact support.
      schema:
        type: string
        examples:
          - req_01M5KPY92Y148QP01G532MM3BH
    Idempotent-Replayed:
      description: '`true` when the response was replayed for a repeated `Idempotency-Key`.'
      schema:
        type: string
        examples:
          - 'true'
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        examples:
          - 10
    X-RateLimit-Limit:
      description: >-
        Requests per minute allowed for your account (or the key's lower
        ceiling).
      schema:
        type: integer
        examples:
          - 300
    X-RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
        examples:
          - 287
    X-RateLimit-Reset:
      description: Unix time in seconds when the minute window resets.
      schema:
        type: integer
        format: int64
        examples:
          - 1792736640
  responses:
    BadRequest:
      description: >
        The request is malformed or breaks the model's rules: `invalid_json`,
        `missing_parameter`,

        `invalid_parameter`, `unsupported_model`, `url_not_allowed` or
        `idempotency_key_reused`. Nothing was

        charged.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing_parameter:
              summary: A required field is missing
              value:
                error:
                  type: invalid_request_error
                  code: missing_parameter
                  message: 'missing required parameter: duration'
                  param: duration
                  request_id: req_01M5KN36M1JPANPMDW0HEWMMB0
            invalid_parameter:
              summary: A resolution and duration the model does not offer
              value:
                error:
                  type: invalid_request_error
                  code: invalid_parameter
                  message: duration 20 s at 768p is not available on this model
                  param: duration
                  request_id: req_01M5KN36P1JPANPMDW0HEWMM07
            url_not_allowed:
              summary: The input URL breaks the URL policy
              value:
                error:
                  type: invalid_request_error
                  code: url_not_allowed
                  message: image_url must use https
                  param: image_url
                  request_id: req_01M5KPQ1HMDVX7324R9FQFH87S
            idempotency_key_reused:
              summary: Same Idempotency-Key, different body
              value:
                error:
                  type: invalid_request_error
                  code: idempotency_key_reused
                  message: >-
                    this Idempotency-Key was already used with a different
                    request body
                  param: Idempotency-Key
                  request_id: req_01M5KN36RZ8C1Q2T3V4W5X6Y7Z
    Unauthorized:
      description: >-
        The API key is missing, unknown, revoked or expired (`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'
          examples:
            invalid_api_key:
              summary: No key, or an unknown key
              value:
                error:
                  type: authentication_error
                  code: invalid_api_key
                  message: >-
                    missing API key: send Authorization: Bearer sk_live_… (or
                    x-api-key)
                  request_id: req_01M5KN14MXD6SJ01ZQ2FPS6Y8X
            api_key_revoked:
              summary: The key was revoked in the console
              value:
                error:
                  type: authentication_error
                  code: api_key_revoked
                  message: this API key has been revoked
                  request_id: req_01M5KN14PY5YH5QPA2QS7Y07Y4
    PaymentRequired:
      description: >-
        Your spendable balance does not cover the estimated price
        (`insufficient_credits`). `details` carries `required` and `available`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: billing_error
              code: insufficient_credits
              message: this task needs 60 credits, 25 are available
              request_id: req_01M5KPQ11B3NS7R5ZFFVZBD4W3
              details:
                required: 60
                available: 25
    Forbidden:
      description: >
        The key lacks the scope (`insufficient_scope`), the caller's IP address
        is not on the key's allowlist

        (`ip_not_allowed`), or the account is suspended or not approved yet
        (`account_suspended`,

        `account_not_active`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficient_scope:
              summary: The key lacks the scope
              value:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: this key does not have the video:write scope
                  request_id: req_01M5KN14S3T4U5V6W7X8Y9Z0A1
            ip_not_allowed:
              summary: The caller is not on the key's IP allowlist
              value:
                error:
                  type: permission_error
                  code: ip_not_allowed
                  message: requests from 203.0.113.9 are not allowed for this key
                  request_id: req_01M5KN14T4U5V6W7X8Y9Z0A1B2
            account_not_active:
              summary: The account is waiting for approval
              value:
                error:
                  type: permission_error
                  code: account_not_active
                  message: this account is not active yet (pending approval)
                  request_id: req_01M5KN14U5V6W7X8Y9Z0A1B2C3
    Conflict:
      description: >-
        The task is already `completed` or `failed` (`task_already_terminal`),
        or a request with the same `Idempotency-Key` is still running
        (`idempotency_in_progress`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            task_already_terminal:
              summary: Cancel on a finished task
              value:
                error:
                  type: conflict_error
                  code: task_already_terminal
                  message: task task_01J9X7Z0K7Q8W3F2P1N6M5V4R3 is already completed
                  request_id: req_01M5KN37A1B2C3D4E5F6G7H8J9
            idempotency_in_progress:
              summary: The first request with this key is still running
              value:
                error:
                  type: conflict_error
                  code: idempotency_in_progress
                  message: a request with this Idempotency-Key is still being processed
                  request_id: req_01M5KN37B2C3D4E5F6G7H8J9K0
    TooManyRequests:
      description: >
        A limit of your plan was reached: the request rate
        (`rate_limit_exceeded`), the number of queued and

        processing tasks (`concurrency_limit_exceeded`) or the daily credit cap
        (`daily_cap_exceeded`). Wait

        `Retry-After` seconds before retrying.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limit_exceeded:
              summary: Too many requests
              value:
                error:
                  type: rate_limit_error
                  code: rate_limit_exceeded
                  message: rate limit exceeded for this account (10 rps, 300 rpm)
                  request_id: req_01M5KN37C3D4E5F6G7H8J9K0L1
            concurrency_limit_exceeded:
              summary: Too many tasks in flight
              value:
                error:
                  type: rate_limit_error
                  code: concurrency_limit_exceeded
                  message: >-
                    the account already has 20 tasks queued or processing (plan
                    limit 20)
                  request_id: req_01M5KN37D4E5F6G7H8J9K0L1M2
            daily_cap_exceeded:
              summary: Daily credit cap reached
              value:
                error:
                  type: rate_limit_error
                  code: daily_cap_exceeded
                  message: this account's daily credit cap (5000) would be exceeded
                  request_id: req_01M5KN37E5F6G7H8J9K0L1M2N3
    InternalError:
      description: >-
        An unexpected error (`internal_error`). Retry with backoff and the same
        `Idempotency-Key`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: internal_error
              message: an internal error occurred; retry with the same Idempotency-Key
              request_id: req_01M5KN37F6G7H8J9K0L1M2N3P4
    ServiceUnavailable:
      description: >-
        Generation capacity is temporarily unavailable (`service_unavailable`).
        Nothing was charged; retry after `Retry-After` seconds with the same
        `Idempotency-Key`.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: service_unavailable
              message: >-
                the pipeline cannot take new tasks right now, retry with the
                same Idempotency-Key
              request_id: req_01M5KPY92Y148QP01G532MM3BH
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Your API key from the [developer console](https://fiveapi.ai), sent as
        `Authorization: Bearer sk_live_...`.

        The `x-api-key: sk_live_...` header is accepted as an alternative.

````

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