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

# Sound Effect Generation

> Generate royalty-free sound effects from a text prompt or video source.



## OpenAPI

````yaml POST /v1/audio/sfx-generation
openapi: 3.0.1
info:
  title: FineVoice API
  description: >-
    This is the documentation for the FineVoice API. If you have any questions
    or need assistance, please contact support@finevoice.ai.
  version: v1
servers:
  - url: https://apis.finevoice.ai
    description: FineVoice API Gateway
security:
  - BearerAuth: []
paths:
  /v1/audio/sfx-generation:
    post:
      tags:
        - Audio
      summary: Sound Effect Generation
      description: >-
        Generate royalty-free sound effects from a text prompt or a source
        video/image.
      operationId: SfxGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SoundEffectGenerationRequest'
      responses:
        '200':
          description: >-
            Task accepted. Returns a taskId for async polling or the result URL
            directly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioTaskResponse'
        '401':
          description: Unauthorized — invalid or missing API key.
        '422':
          description: Validation error — check request body fields.
components:
  schemas:
    SoundEffectGenerationRequest:
      type: object
      description: The sound effect generation request payload.
      properties:
        prompt:
          type: string
          description: The prompt describing the desired sound effect.
          example: Thunderstorm with heavy rain and distant thunder
        negative_prompt:
          type: string
          description: The negative prompt describing sounds to avoid.
          example: music, voices
        sourceUrl:
          type: string
          description: >-
            Source video or image URL for generating contextual sound effects.
            If provided, `sourceType` is required.
        sourceType:
          type: string
          description: >-
            The source media type. Supported: `image`, `video`. Required when
            `sourceUrl` is provided.
          example: video
        duration:
          type: number
          format: float
          description: Requested output duration in seconds. Maximum is 30 seconds.
          example: 5
        useAsync:
          type: boolean
          description: Set to `true` to process asynchronously.
          example: true
    AudioTaskResponse:
      type: object
      description: Standard response for audio processing tasks.
      properties:
        status:
          type: integer
          format: int32
          description: HTTP-style status code (200 for success, 202 for in-progress).
        url:
          type: string
          description: Download URL of the generated audio file (available when completed).
        taskId:
          type: string
          description: Task identifier for async polling. Use with GET /v1/task/{task_id}.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        error:
          $ref: '#/components/schemas/ApiError'
        urls:
          type: array
          items:
            type: string
          description: Multiple output URLs (e.g. for separation stems).
        service:
          type: string
        port:
          type: string
        timestamp:
          type: string
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token (API key). Format: `Bearer {your_api_key}`'

````