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

# Vidu Text-to-Audio

> Generate an audio clip (supports sound effects & BGM) by inputting a text prompt. After submission, query status via `GET /vidu/ent/v2/tasks/{task_id}/creations`.



## OpenAPI

````yaml api-reference/en/zmodelAudio/vidu/vidu-text-to-audio.json POST /vidu/ent/v2/text2audio
openapi: 3.0.1
info:
  title: Vidu Text-to-Audio
  version: 1.0.0
servers:
  - url: https://api.powertokens.ai
security: []
paths:
  /vidu/ent/v2/text2audio:
    post:
      summary: Vidu Text-to-Audio
      description: >-
        Generate an audio clip (supports sound effects & BGM) by inputting a
        text prompt. After submission, query status via `GET
        /vidu/ent/v2/tasks/{task_id}/creations`.
      operationId: viduTextToAudioEn
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToAudioRequest'
            examples:
              basic_audio_generation:
                summary: Basic text-to-audio
                value:
                  model: audio1.0
                  prompt: >-
                    Sound of raindrops falling on windows, accompanied by
                    distant thunder
                  duration: 10
                  seed: 42
              short_sound_effect:
                summary: Short sound effect generation
                value:
                  model: audio1.0
                  prompt: Mobile phone notification ringtone
                  duration: 3
              ambient_background:
                summary: Ambient background sound
                value:
                  model: audio1.0
                  prompt: >-
                    Birdsong in the forest with gentle breeze rustling through
                    leaves
                  duration: 8
                  seed: 123456
      responses:
        '200':
          description: Submission successful, returns an audio task object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextToAudioResponse'
              examples:
                success:
                  value:
                    task_id: your_task_id_here
                    state: created
                    model: audio1.0
                    prompt: Birds chirping in the morning
                    duration: 10
                    seed: 123456789
                    credits: 10
                    created_at: '2025-01-01T15:41:31.968916Z'
      security:
        - BearerAuth: []
components:
  schemas:
    TextToAudioRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - audio1.0
          description: |-
            Audio generation model name.
            - **audio1.0**: Supports generating audio based on text prompts
        prompt:
          type: string
          maxLength: 1500
          description: >-
            Text prompt describing the audio to be generated, with a maximum
            length of 1500 characters.
        duration:
          type: number
          format: float
          default: 10
          minimum: 2
          maximum: 10
          description: |-
            Audio duration in seconds.
            - Default: 10 seconds
            - Range: 2-10 seconds
        seed:
          type: integer
          description: |-
            Random seed.
            - If not provided or set to 0, a random value will be used
            - Fixed value ensures reproducibility
        callback_url:
          type: string
          description: >-
            Callback When creating a task, you need to actively set the
            callback_url with a POST request. When the video generation task
            changes its status, Vidu will send a callback request to this URL,
            containing the latest status of the task. The structure of the
            callback request content will be the same as the return body of the
            GET Generation API.The "status" in the callback response includes
            the following states:- processing: Task is being processed.-
            success: Task is completed (if sending fails, it will retry the
            callback three times).- failed: Task failed (if sending fails, it
            will retry the callback three times).Vidu uses a callback signature
            algorithm for verification, check out the details here: Callback
            Signature
    TextToAudioResponse:
      type: object
      properties:
        task_id:
          type: string
          description: Vidu generated Task ID
        state:
          type: string
          enum:
            - created
            - queueing
            - processing
            - success
            - failed
          description: |-
            Task state:
            - created: Task created successfully
            - queueing: Task in queue
            - processing: Task is being processed
            - success: Generation successful
            - failed: Task failed
        model:
          type: string
          description: Model parameter used
        prompt:
          type: string
          description: Prompt text used
        duration:
          type: integer
          description: Audio duration
        seed:
          type: integer
          description: Random seed used
        credits:
          type: integer
          description: The credits used for this call
        created_at:
          type: string
          description: Task creation timestamp (ISO8601 format)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````