---
title: "Submit a music generation job"
method: POST
path: "/v2/music/generate"
tags: ["Music"]
---

# Submit a music generation job

`POST /v2/music/generate`

## Request

- Base URL: `https://api.apiframe.ai`
- URL: `https://api.apiframe.ai/v2/music/generate`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Creates a music job across Suno, Udio, Producer, Lyria 3, ElevenLabs Music and Mureka. Suno, Udio, Producer, and Mureka always return TWO songs per call — the result is an array.

## Headers

- `Idempotency-Key` string

## Request body

- union: Discriminated by `model`. Covers Suno, Udio, Producer, Lyria 3 (clip + pro), ElevenLabs Music, and Mureka.
  - object
    - `prompt` string, required
    - `model` 'suno', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `sunoParams` object
      - `custom_mode` boolean
      - `instrumental` boolean
      - `model_version` 'V4' | 'V4_5' | 'V4_5ALL' | 'V4_5PLUS' | 'V5' | 'V5_5'
      - `title` string
      - `style` string
      - `negative_tags` string
      - `vocal_gender` 'm' | 'f'
      - `style_weight` number
      - `weirdness_constraint` number
      - `auto_lyrics` boolean
  - object
    - `prompt` string
    - `model` 'udio', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `udioParams` object
      - `lyrics_type` 'generate' | 'user' | 'instrumental'
      - `negative_tags` string
      - `seed` integer
      - `title` string
      - `style` string
      - `model` 'udio32-v1.5' | 'udio32-v1' | 'udio32-v2' | 'udio130-v1.5' | 'udio130-v1'
      - `duration` union
        - 32
        - 65
        - 97
        - 130
      - `lyrics` string
      - `lyrics_prompt` string
      - `manual_mode` boolean
      - `prompt_strength` number
      - `lyrics_strength` number
      - `clarity_strength` number
      - `generation_quality` number
      - `bpm` number
      - `voice` object
        - `name` string
        - `id` string
        - `file` string
        - `song` string
        - `similarity` integer
        - `cropStart` number
      - `style_ref` object
        - `name` string
        - `id` string
        - `file` string
        - `song` string
        - `similarity` integer
        - `cropStart` number
  - object
    - `prompt` string, required
    - `model` 'producer', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `producerParams` object
      - `model_version` 'FUZZ_2_PRO' | 'FUZZ_2' | 'FUZZ_2_RAW' | 'FUZZ_1_1_PRO' | 'FUZZ_1_PRO' | 'FUZZ_1'
      - `lyrics` string
      - `instrumental` boolean
      - `title` string
      - `seed` string
      - `lyrics_strength` number
      - `sound_strength` number
      - `weirdness` number
  - object
    - `prompt` string, required
    - `model` 'lyria-3-clip', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `lyriaParams` object
      - `reference_images` string[]
  - object
    - `prompt` string, required
    - `model` 'lyria-3-pro', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `lyriaParams` object
      - `reference_images` string[]
  - object
    - `prompt` string, required
    - `model` 'elevenlabs-music', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `elevenlabsParams` object
      - `music_length_ms` integer
      - `force_instrumental` boolean
      - `output_format` 'mp3_standard' | 'mp3_high_quality' | 'wav_16khz' | 'wav_22khz' | 'wav_24khz' | 'wav_cd_quality'
  - object
    - `prompt` string, required
    - `model` 'mureka', required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
    - `murekaParams` object
      - `model_version` 'auto' | 'mureka-7.6' | 'mureka-o2' | 'mureka-8' | 'mureka-9'
      - `lyrics` string
      - `instrumental` boolean

## Response `202`

Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.

- JobAccepted: Returned by every successful job submission.
  - `jobId` string, uuid, required
  - `status` 'QUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED', required: Status at the moment the job record was persisted. Almost always `QUEUED`; idempotent replays may return the original status.

## Other responses

- `400`: Request body failed validation.
- `401`: Authentication failed (missing / invalid API key).
- `402`: Team has insufficient credits to run this model.
- `403`: Authenticated but the API key is inactive or lacks permission.
- `429`: Rate limit exceeded. Retry after the `Retry-After` seconds.
- `503`: Service temporarily unavailable (queue / DB outage). Retry with backoff.

---

[API](https://skmtc.dev/apiframe/apis/apiframe-api.md) · [All operations](https://skmtc.dev/apiframe/apis/apiframe-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apiframe/apis/apiframe-api/revisions/ba1a4c26c86a?raw)
