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

# Sound Generator

> Creates an audio file based on a textual prompt. The generation process is asynchronous and returns a task ID for tracking.



## OpenAPI

````yaml POST /v1/sound_generator
openapi: 3.1.0
info:
  title: Musicgpt API
  version: 1.0.0
  description: API for retrieving conversion details by ID.
servers:
  - url: https://api.musicgpt.com/api/public
    description: Production server
security: []
paths:
  /v1/sound_generator:
    post:
      summary: Generate Sound Based on Given Prompt
      description: >-
        Creates an audio file based on a textual prompt. The generation process
        is asynchronous and returns a task ID for tracking.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: Text prompt guiding the sound generation.
                  example: Generate a soothing ambient soundscape.
                webhook_url:
                  type: string
                  description: Callback URL for async processing results.
                  example: http://your-webhook-url.com/callback
                audio_length:
                  type: integer
                  description: >-
                    Desired duration of generated audio in seconds (beta
                    feature)
                  example: 30
              required:
                - prompt
      responses:
        '200':
          description: Successfully initiated sound generation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  task_id:
                    type: string
                  conversion_id:
                    type: string
                  eta:
                    type: integer
                  credit_estimate:
                    type: number
                    format: float
                  message:
                    type: string
                example:
                  success: true
                  task_id: soundgen789
                  conversion_id: conv456
                  eta: -1
                  credit_estimate: 100.1
                  message: Successfully published to queue
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Prompt is required for sound generation.
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````