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

# Music Generation

> Generate a full music track with vocals and/or instrumentation from lyrics, style description, and reference tracks.



## OpenAPI

````yaml POST /v1/music/musicgen
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/musicgen:
    post:
      tags:
        - Music
      summary: Music Generation by Lyrics
      description: >-
        Generate a full music track with vocals and/or instrumentation from
        lyrics, style description, and reference tracks.
      operationId: MusicGen
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MusicGenerationRequest'
      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:
    MusicGenerationRequest:
      type: object
      description: The music generation request payload.
      properties:
        title:
          type: string
          description: The generated song title.
          example: My AI Song
        style:
          type: string
          description: The target music style.
          example: pop, energetic, upbeat
        audioId:
          type: string
          description: The source audio identifier.
        referVoice:
          type: string
          description: Reference vocal track identifier or URL.
        referInstrumental:
          type: string
          description: Reference instrumental track identifier or URL.
        lyrics:
          type: string
          description: The lyrics content.
          example: |-
            [Verse 1]
            Hello world, this is FineVoice...
        instrumental:
          type: boolean
          description: Whether to generate instrumental-only music.
          example: false
        modelVersion:
          type: string
          description: >-
            Model version. `v3`: optimized for Chinese vocals and traditional
            styles. `r2`: studio recording quality with highly realistic vocals.
          example: v3
          enum:
            - v3
            - r2
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token (API key). Format: `Bearer {your_api_key}`'

````