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

# Lyrics Generator

> This endpoint takes a natural language prompt (e.g., a theme, vibe, or idea) and generates original lyrics based on it. If the prompt has been used before, a variation may be returned. It also estimates the credit cost of generation.



## OpenAPI

````yaml GET /v1/prompt_to_lyrics
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/prompt_to_lyrics:
    get:
      summary: Convert Prompt to Lyrics
      description: >-
        This endpoint takes a natural language prompt (e.g., a theme, vibe, or
        idea) and generates original lyrics based on it. If the prompt has been
        used before, a variation may be returned. It also estimates the credit
        cost of generation.
      parameters:
        - name: prompt
          in: query
          required: true
          description: The theme or idea you'd like lyrics generated for.
          schema:
            type: string
            minLength: 1
            maxLength: 1000
            example: A hopeful song about starting over
      responses:
        '200':
          description: Lyrics generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  task_id:
                    type: string
                  message:
                    type: string
                  lyrics:
                    type: string
                  credit_estimate:
                    type: integer
                example:
                  success: true
                  task_id: task-lyrics-2345
                  message: Lyrics generated successfully
                  lyrics: |
                    Under the silver moonlight we sway...
                    ...
                  credit_estimate: 10
        '400':
          description: Invalid prompt input
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Prompt must be between 1 and 1000 characters.
        '500':
          description: Internal server error during lyrics generation
          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

````