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

# Upload and Extend Audio

> Extend audio tracks while preserving the original style

<Tip>
  1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
  2. Regardless of whether `callback_url` is provided, you can retrieve the response result through the unified [Query Music Detail](/api-manual/music-series/query-music-detail) endpoint.
</Tip>

## Usage Guide

* This endpoint extends uploaded audio files while preserving the original style
* Upload an existing audio track and specify where to continue from
* The AI generates additional content that seamlessly blends with the original
* Uploaded audio files must not exceed 8 minutes in length (**Note**: For V4\_5ALL model, max 1 minute)

## Parameter Details

* When `default_param_flag: true` (Custom Parameters Mode):

  * Full control over style, title, and other parameters

  * If `instrumental: true`: only `style`, `title`, and `upload_url` are required

  * If `instrumental: false`: `style`, `title`, `prompt` (used as exact lyrics), and `upload_url` are required

  * Character limits vary by model:

    * **V4**: `prompt` 3000 characters, `style` 200 characters, `title` 80 characters

    * **V4\_5 & V4\_5PLUS**: `prompt` 5000 characters, `style` 1000 characters, `title` 100 characters

    * **V4\_5ALL**: `prompt` 5000 characters, `style` 1000 characters, `title` 80 characters

    * **V5**: `prompt` 5000 characters, `style` 1000 characters, `title` 100 characters

* When `default_param_flag: false`:

  * Only `upload_url` is required. If `instrumental: false`, lyrics will be automatically generated

## Developer Notes

* Recommendation: Use `default_param_flag: false` for quick extensions that maintain the original style
* The `continue_at` parameter determines where the extension begins - set it to the point where you want new content to start

## Optional parameters

* `prompt` (string): Description or lyrics for the extended audio. Required when `default_param_flag` is `true` and `instrumental` is `false`. The prompt will be used strictly as lyrics. When `default_param_flag` is `false`, lyrics will be automatically generated based on the prompt.

* `style` (string): Music style specification. Required when `default_param_flag` is `true`.

* `title` (string): Track title for the extended audio. Character limits vary by model (V4: 80, V4\_5 & V4\_5PLUS & V5: 100, V4\_5ALL: 80).

* `negative_tags` (string): Music styles to exclude from generation.

* `vocal_gender` (string): Vocal gender preference. Use `m` for male, `f` for female. Note: This parameter can only increase the probability but cannot guarantee the specified gender.

* `style_weight` (number): Strength of adherence to style. Range 0-1, up to 2 decimals.

* `weirdness_constraint` (number): Controls creative deviation. Range 0-1, up to 2 decimals.

* `audio_weight` (number): Balance weight for audio features. Range 0-1, up to 2 decimals.

* `persona_id` (string): Persona ID to apply to the generated music. How to generate persona\_id, visit [generate-persona](/api-manual/music-series/generate-persona).


## OpenAPI

````yaml /api-manual/music-series/upload-and-extend-audio.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Upload and Extend Audio API
  description: Extend audio tracks while preserving the original style
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Music Generation
      summary: Submit Upload and Extend Audio Task
      description: Upload an audio file and extend it while preserving the original style
      operationId: submitUploadExtendTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              default-params:
                summary: Default Parameters - Simple Extension
                value:
                  model: upload-and-extend-audio
                  callback_url: https://your-domain.com/callback
                  input:
                    upload_url: https://storage.example.com/audio.mp3
                    default_param_flag: true
                    instrumental: true
                    continue_at: 60
                    mv: V5
              custom-params:
                summary: Custom Parameters - Full Control
                value:
                  model: upload-and-extend-audio
                  callback_url: https://your-domain.com/callback
                  input:
                    upload_url: https://storage.example.com/audio.mp3
                    default_param_flag: false
                    instrumental: false
                    prompt: Extend the music with more relaxing notes
                    style: Classical
                    title: Peaceful Piano Extended
                    continue_at: 60
                    mv: V4_5PLUS
                    negative_tags: Heavy Metal, Fast Drums
                    vocal_gender: f
                    style_weight: 0.65
              instrumental-extension:
                summary: Instrumental Track Extension
                value:
                  model: upload-and-extend-audio
                  callback_url: https://your-domain.com/callback
                  input:
                    upload_url: https://storage.example.com/instrumental.mp3
                    default_param_flag: false
                    instrumental: true
                    style: Cinematic, Orchestral
                    title: Epic Journey Extended
                    continue_at: 90
                    mv: V5
                    style_weight: 0.7
                    weirdness_constraint: 0.3
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: |-
            API model identifier.

            Must be `upload-and-extend-audio` for this endpoint.
          enum:
            - upload-and-extend-audio
          example: upload-and-extend-audio
        callback_url:
          type: string
          format: uri
          description: Webhook callback URL for result notifications
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - upload_url
            - default_param_flag
            - instrumental
            - continue_at
            - mv
          description: Input parameters for audio extension
          properties:
            upload_url:
              type: string
              format: uri
              description: >-
                The URL for uploading audio files, required regardless of
                whether `default_param_flag` is true or false.


                Ensure the uploaded audio does not exceed 8 minutes in length.


                **Note**: For the V4_5ALL model, the uploaded audio must not
                exceed 1 minute in length.
              example: https://storage.example.com/audio.mp3
            default_param_flag:
              type: boolean
              description: >-
                Enable or disable custom parameter mode.


                - When `true`: Enables custom mode with full control over style,
                title, and other parameters.


                - When `false`: Only `upload_url` is required.
              example: true
            instrumental:
              type: boolean
              description: >-
                Determines whether the audio is instrumental (without lyrics).


                - In custom parameter mode (`default_param_flag: true`):
                  - If `true`: only `style`, `title`, and `upload_url` are required.
                  - If `false`: `style`, `title`, `prompt` (prompt will be used as exact lyrics), and `upload_url` are required.

                - In non-custom parameter mode (`default_param_flag: false`):
                does not affect required fields (only `upload_url` needed). If
                `false`, lyrics will be automatically generated.
              example: true
            continue_at:
              type: number
              description: >-
                The timestamp (in seconds) from which to start extending the
                audio.


                This defines where the original audio ends and the AI-generated
                extension begins.
              example: 60
            mv:
              type: string
              description: >-
                AI model version for audio extension.


                - **V5**: Superior musical expression, faster generation.

                - **V4_5PLUS**: V4_5PLUS delivers richer sound, new ways to
                create, max 8 min.

                - **V4_5**: V4_5 enables smarter prompts, faster generations,
                max 8 min.

                - **V4_5ALL**: V4_5ALL enables smarter prompts, faster
                generations, max 8 min.

                - **V4**: V4 improves vocal quality, max 4 min.
              enum:
                - V4
                - V4_5
                - V4_5ALL
                - V4_5PLUS
                - V5
              example: V5
            prompt:
              type: string
              description: >-
                Description or lyrics for the extended audio.


                Required when `default_param_flag` is `true` and `instrumental`
                is `false`. The prompt will be used strictly as lyrics.


                When `default_param_flag` is `false`, lyrics will be
                automatically generated based on the prompt.


                Character limits by model:

                - **V4**: Maximum 3000 characters

                - **V4_5 & V4_5PLUS**: Maximum 5000 characters

                - **V4_5ALL**: Maximum 5000 characters

                - **V5**: Maximum 5000 characters
              maxLength: 5000
              example: Extend the music with more relaxing notes
            style:
              type: string
              description: >-
                Music style specification defining genre, mood, or artistic
                direction.


                Required when `default_param_flag` is `true`.


                Character limits by model:

                - **V4**: Maximum 200 characters

                - **V4_5 & V4_5PLUS**: Maximum 1000 characters

                - **V4_5ALL**: Maximum 1000 characters

                - **V5**: Maximum 1000 characters
              maxLength: 1000
              example: Classical
            title:
              type: string
              description: |-
                Track title displayed in player and used for file naming.

                Character limits by model:
                - **V4**: Maximum 80 characters
                - **V4_5 & V4_5PLUS**: Maximum 100 characters
                - **V4_5ALL**: Maximum 80 characters
                - **V5**: Maximum 100 characters
              maxLength: 100
              example: Peaceful Piano Extended
            negative_tags:
              type: string
              description: >-
                Music styles or characteristics to exclude from generation.


                Specify unwanted genres, moods, or instruments to avoid in the
                output.
              example: Heavy Metal, Fast Drums
            vocal_gender:
              type: string
              description: >-
                Preferred vocal gender for the generated music.


                - `m`: Male vocals

                - `f`: Female vocals


                Only effective when `instrumental` is `false`.


                **Note**: This parameter increases the probability but cannot
                guarantee the specified gender.
              enum:
                - m
                - f
              example: f
            style_weight:
              type: number
              description: >-
                Controls how strongly the specified style influences the
                generation.


                Range: 0-1, up to 2 decimals.


                Higher values result in stronger adherence to the specified
                style.
              minimum: 0
              maximum: 1
              example: 0.65
            weirdness_constraint:
              type: number
              description: >-
                Controls the level of experimental creativity and unconventional
                elements.


                Range: 0-1, up to 2 decimals.


                - Lower values: More conventional music

                - Higher values: More experimental and unique outputs
              minimum: 0
              maximum: 1
              example: 0.65
            audio_weight:
              type: number
              description: >-
                Balances audio characteristics against other generation factors.


                Range: 0-1, up to 2 decimals.


                Adjusts the emphasis on audio quality and sonic features in the
                final output.
              minimum: 0
              maximum: 1
              example: 0.65
            persona_id:
              type: string
              description: >-
                Persona ID to apply to the generated music.


                Use this to apply a specific persona style to your music
                generation.


                How to generate persona_id, visit
                [generate-persona](/api-manual/music-series/generate-persona).
              example: persona_123
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: HTTP status code
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1757165031-uyujaw3d
              description: Unique task identifier for status tracking
            status:
              type: string
              enum:
                - not_started
              example: not_started
              description: Initial task status
            created_time:
              type: string
              format: date-time
              example: '2025-11-12T10:30:00'
              description: ISO 8601 timestamp when the task was created
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API endpoints require Bearer Token authentication


        Get your API Key:


        Visit the [API Key Management
        Page](https://vidgo.ai/apis/dashboard/api-key) to get your API Key


        Add it to the request header:


        ```

        Authorization: Bearer VIDGO_API_KEY

        ```

````