> ## 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.

# Background Music Generation

> Generate a royalty-free background music track from a text prompt, with control over style, duration, and model version.



## OpenAPI

````yaml POST /v1/music/musicgenbyprompt
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/music/musicgenbyprompt:
    post:
      tags:
        - Music
      summary: Music Generation by Prompt
      description: >-
        Generate a royalty-free music track from a text prompt, with control
        over style, duration, and model version.
      operationId: MusicGenByPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MusicGenerationByPromptRequest'
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized — invalid or missing API key.
        '422':
          description: Validation error — check request body fields.
components:
  schemas:
    MusicGenerationByPromptRequest:
      type: object
      description: The prompt-based music generation request payload.
      properties:
        prompt:
          type: string
          description: The generation prompt describing the desired music.
          example: Upbeat electronic dance music with heavy bass and synth leads
        instrumental:
          type: boolean
          description: Whether to generate instrumental-only music (no vocals).
          example: true
        duration:
          type: integer
          format: int32
          description: The target duration in seconds.
          example: 30
        continuation:
          type: boolean
          description: Whether this generation continues a previous clip.
        title:
          type: string
          description: The generated song title.
        modelVersion:
          type: string
          description: The model version to use.
        audioId:
          type: string
          description: Source audio identifier for continuation or reference.
        prompt_type:
          type: string
          description: The prompt input type.
        input_audio:
          type: string
          description: Optional input audio reference URL.
        thumbnail_url:
          type: string
          description: The thumbnail image URL.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token (API key). Format: `Bearer {your_api_key}`'

````