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

# Generate music

> Generate AI music using Suno models via the RawUGC platform. Supports instrumental and vocal tracks with customizable genre, mood, and style. Each generation costs 3 credits.

The generation is asynchronous — poll `GET /music/{taskId}` to check status and retrieve the audio URL when ready.



## OpenAPI

````yaml /openapi.json post /music/generate
openapi: 3.0.0
info:
  title: RawUGC API
  version: 1.0.0
  description: >-
    Generate AI videos, images, and music, and schedule social media posts
    programmatically.
  contact:
    name: API Support
    email: support@rawugc.com
    url: https://docs.rawugc.com
  license:
    name: Proprietary
servers:
  - url: https://rawugc.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Tasks
    description: >-
      Deprecated. Use typed resource endpoints instead: GET /videos/{videoId},
      GET /images/{imageId}, GET /music/{musicId}.
  - name: Image Generation
    description: >-
      Generate and edit AI images using Nano Banana models. Supports
      text-to-image generation (6 credits) and image-to-image editing (2
      credits).
  - name: Video Generation
    description: Generate and manage AI videos using Sora 2, Kling, and Veo 3 models
  - name: Personas
    description: Manage target audience personas for content plans
  - name: Messaging
    description: Manage brand/positioning messaging for content plans
  - name: Products
    description: Manage products for video generation
  - name: Styles
    description: Manage video creative styles and templates
  - name: Characters
    description: List available AI characters for video generation
  - name: Video Editing
    description: Post-process videos with captions, overlays, and effects
  - name: Upload
    description: Upload video and image files for use in generation requests
  - name: Social Scheduling
    description: Schedule and manage social media posts to TikTok, Instagram, and YouTube
  - name: Social Accounts
    description: Manage connected social media accounts
  - name: Music Generation
    description: >-
      Generate AI music tracks using Suno models with customizable genre, mood,
      and style
  - name: Viral Library
    description: >-
      Browse and search analyzed TikTok videos across the platform. Includes
      AI-powered analysis with hooks, keyframes, performance insights, and
      semantic search via natural language queries.
  - name: Research
    description: >-
      Scrape TikTok videos, analyze any video, and generate content plans. Tools
      for competitive research and content strategy.
paths:
  /music/generate:
    post:
      tags:
        - Music Generation
      summary: Generate music
      description: >-
        Generate AI music using Suno models via the RawUGC platform. Supports
        instrumental and vocal tracks with customizable genre, mood, and style.
        Each generation costs 3 credits.


        The generation is asynchronous — poll `GET /music/{taskId}` to check
        status and retrieve the audio URL when ready.
      operationId: generateMusic
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MusicGenerationRequest'
            examples:
              instrumental:
                summary: Instrumental track
                value:
                  prompt: >-
                    upbeat lo-fi hip hop beat with jazzy piano chords and vinyl
                    crackle
                  model: V5
                  instrumental: true
              custom_mode:
                summary: Custom mode with title and style
                value:
                  prompt: >-
                    A sweeping cinematic theme with rising strings and brass
                    fanfare
                  model: V5
                  instrumental: true
                  title: Dawn of Heroes
                  style: epic orchestral cinematic
              with_vocals:
                summary: Track with vocals
                value:
                  prompt: >-
                    catchy pop song about summer nights, upbeat tempo with synth
                    and guitar
                  model: V5
                  instrumental: false
                  title: Summer Nights
      responses:
        '201':
          description: Music generation initiated successfully
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests per window
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining requests in current window
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix timestamp when the rate limit resets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicGenerationResponse'
              example:
                musicId: mus_jh7a3b9xq2pn4r8k
                model: V5
                status: pending
                creditsUsed: 3
                newBalance: 47
                estimatedCompletionTime: 1-3 minutes
                createdAt: 1740000000000
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    MusicGenerationRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Text description of the music to generate. Include genre, mood,
            instruments, tempo, and style details for best results.
        model:
          type: string
          enum:
            - V3_5
            - V4
            - V4_5
            - V4_5PLUS
            - V4_5ALL
            - V5
          default: V5
          description: Suno model version to use. V5 is the latest and recommended model.
        instrumental:
          type: boolean
          default: true
          description: Generate instrumental-only music (no vocals). Defaults to true.
        title:
          type: string
          maxLength: 200
          description: >-
            Title for the generated track. When provided along with style,
            enables custom mode.
        style:
          type: string
          maxLength: 500
          description: >-
            Music style descriptor for custom mode (e.g., 'lo-fi hip hop', 'epic
            orchestral'). Used with title for custom mode.
    MusicGenerationResponse:
      type: object
      properties:
        musicId:
          type: string
          description: Unique music identifier (mus_xxx format)
        model:
          type: string
          description: Suno model version used for generation
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
          description: Current generation status
        creditsUsed:
          type: number
          description: Number of credits deducted (3 per generation)
        newBalance:
          type: number
          description: Remaining credit balance after deduction
        estimatedCompletionTime:
          type: string
          description: Estimated time until track is ready (human-readable)
        createdAt:
          type: number
          description: Timestamp when generation was initiated (milliseconds since epoch)
    ApiError:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: >-
            URI reference identifying the problem type (e.g.,
            https://api.rawugc.com/errors/validation_error)
        title:
          type: string
          description: Short, human-readable summary of the problem
        status:
          type: number
          description: HTTP status code
        detail:
          type: string
          description: Human-readable explanation of the problem
        instance:
          type: string
          format: uri
          description: URI reference identifying this specific occurrence
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field-specific validation errors
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Use your API key from the RawUGC dashboard. Include as: Authorization:
        Bearer YOUR_API_KEY

````