KIE.AI
All Model
  • All Model
  • Old Model
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
All Model
  • All Model
  • Old Model
All Model
  • All Model
  • Old Model
Market
File Upload APICommon API
Market
File Upload APICommon API
  1. Music Generation
  • Getting Started with KIE API (Important)
  • Market
  • Image Models
    • Seedream
      • Seedream4.0 - Text to Image
      • Seedream4.0 - Edit
      • Seedream4.5 - Text to Image
      • Seedream4.5 - Edit
      • Seedream5.0 Lite - Text to Image
      • Seedream5.0 Lite - Image to Image
      • Seedream5.0 Pro - Text to Image
      • Seedream5.0 Pro - Image to Image
      • Seedream 5.0 Pro - Layer Decomposition
      • Seedream3.0 - Text to Image
    • Z-image
      • Z-Image
    • Google
      • Google - imagen4-fast
      • Google - imagen4-ultra
      • Google - imagen4
      • Google - Nano Banana Edit
      • Google - Nano Banana
      • Google - Nano Banana Pro
      • Google - Nano Banana 2
      • Google - Nano Banana 2 Lite
    • Flux-2
      • Flux-2 - Pro Image to Image
      • Flux-2 - Pro Text to Image
      • Flux-2 - Image to Image
      • Flux-2 - Text to Image
    • Grok Imagine
      • Grok Imagine Image 2.0 Text To Image
      • Grok Imagine Image 2.0 Segment Map
      • Grok Imagine Image 2.0 Segment Edit
      • Grok Imagine - Text to Image
      • Grok Imagine Image 2.0 Image Edit
      • Grok Imagine - image to image
    • GPT Image
      • GPT Image 2.5 Flare - Text to Image
      • GPT Image 2.5 Flare - Image To Image
      • GPT Image 2.5 Sunburst - Text to Image
      • GPT Image 2.5 Sunburst - Image To Image
      • GPT Image-1.5 - Text to Image
      • GPT Image-1.5 - Image to Image
      • GPT Image-2 - Text to Image
      • GPT Image 2 - Image To Image
    • Topaz
      • Topaz - Image Upscale
    • Recraft
      • Recraft - Remove Background
      • Recraft - Crisp Upscale
    • Ideogram
      • Ideogram - Character Edit
      • Ideogram - Character Remix
      • Ideogram - Character
      • Ideogram V3 Text to Image
      • Ideogram V3 Edit
      • Ideogram V3 Remix
    • Qwen
      • Qwen - Text to Image
      • Qwen - Image to Image
      • Qwen - Image Edit
      • Qwen2 - Image Edit
      • Qwen2 - Text To Image
      • Qwen 2.1 - Text to Image
      • Qwen 2.1 - Image to Image
      • Qwen3 Pro Text to Image
      • Qwen3 Text to Image
      • Qwen3 Pro Image to Image
      • Qwen3 Image to Image
    • Wan
      • Wan 2.7 Image
      • Wan 2.7 Image Pro
    • 4o Image API
      • 4o Image Generation Callbacks
      • Generate 4o Image
    • Flux Kontext API
      • Image Generation or Editing Callbacks
      • Generate or Edit Image
  • Video Models
    • Grok Imagine
      • Grok Imagine Text to Video
      • Grok Imagine Image to Video
      • Grok Imagine - Video Upscale
      • Grok Imagine - Video Extend
      • Grok Imagine Video 1.5 Preview
    • Kling
      • Kling 2.6 Text to Video
      • Kling 2.6 Image to Video
      • Kling - V2.5 Turbo Image to Video Pro
      • Kling - V2.5 Turbo Text to Video Pro
      • Kling AI Avatar Standard
      • Kling AI Avatar Pro
      • Kling V2.1 Master Image to Video
      • Kling V2.1 Master Text to Video
      • Kling V2.1 Pro
      • Kling V2.1 Standard
      • Kling 2.6 motion-control
      • Kling-3.0 motion-control
      • Kling 3.0
      • Kling - V3 Turbo Text to Video
      • Kling - V3 Turbo Image to Video
      • Kling 3.0 Omni Reference To Video
      • Kling 3.0 Omni Transformation
      • Kling 3.0 Omni Image To Video
      • Kling 3.0 Omni Text to Video
    • Bytedance
      • Bytedance Seedance 2.0
      • Bytedance Seedance 2.0 Fast
      • Bytedance Seedance 2.0 Mini
      • Bytedance Seedance 2.5
      • Bytedance Seedance 1.5 Pro
      • Bytedance V1 Pro Fast Image to Video
      • Bytedance V1 Pro Image to Video
      • Bytedance - V1 Pro Text to Video
      • Bytedance - V1 Lite Image to Video
      • Bytedance - V1 Lite Text to Video
    • Hailuo
      • Hailuo 2.3 Pro Image to Video
      • Hailuo 2.3 Standard Image to Video
      • Hailuo Pro Text to Video
      • Hailuo Pro Image to Video
      • Hailuo Standard Text to Video
      • Hailuo Standard Image to Video
    • Wan
      • Wan - 2.2 A14B Image to Video Turbo
      • Wan - 2.2 A14B Speech to Video Turbo
      • Wan - 2.2 A14B Text to Video Turbo
      • Wan - Animate Move
      • Wan - Animate Replace
      • Wan 2.6 - Image to Video
      • Wan 2.6 - Text to Video
      • Wan 2.6 - Video to Video
      • Wan - 2.6-flash-image-to-video
      • Wan - 2-6-flash-video-to-video
      • Wan 2.5 - Image to Video
      • Wan 2.5 - Text to Video
      • Wan 2.7 - Text to Video
      • Wan 2.7 - Image to Video
      • Wan 2.7 - Video Edit
      • Wan 2.7 - Reference to Video
      • Wan 3.0 - Video
      • Wan 3.0 - Video Prime
    • Topaz
      • Topaz - Video Upscale
    • Infinitalk
      • Infinitalk - From Audio
    • PixVerse
      • PixVerse V6 Text-to-Video
      • PixVerse V6 Image-to-Video
      • PixVerse V6 First & Last Frame Transition
      • PixVerse V6 Video Extension
      • PixVerse V6 Fusion / Reference-to-Video
    • MiniMax H3
      • MiniMax H3 Text-to-Video
      • MiniMax H3 Image-to-Video
      • MiniMax H3 Reference-to-Video
    • Runway API
      • AI Video Generation Callbacks
      • AI Video Extension Callbacks
      • Aleph
        • Aleph Video Generation Callbacks
        • Generate Aleph Video
      • Generate AI Video
      • Extend AI Video
    • HappyHorse
      • HappyHorse - text-to-video
      • HappyHorse - image-to-video
      • HappyHorse - reference-to-video
      • HappyHorse - video-edit
      • HappyHorse-1-1 image-to-video
      • HappyHorse-1-1 text-to-video
      • HappyHorse-1-1 reference-to-video
    • Gemini Omni
      • Gemini Omni 1.1 Flash
      • Gemini Omni Video
      • Gemini Omni Audio
      • Gemini Omni Character
    • OmniHuman
      • Omnihuman 1.5
      • Omnihuman 1.5 Human Identification
      • OmniHuman 1.5 Subject Detection
    • Volcengine
      • Volcengine video to video lip sync
    • Veo3.1 API
      • Veo3.1 Video Generation Callbacks
      • Get 4K Video Callbacks
      • Generate Veo3.1 Video
      • Get 1080P Video
      • Get 4K Video
      • Extend Veo3.1 Video
  • Music Models
    • ElevenLabs
      • elevenlabs/audio-isolation
      • elevenlabs/text-to-dialogue-v3
      • elevenlabs/text-to-speech-multilingual-v2
      • elevenlabs/text-to-speech-turbo-2-5
    • Gemini
      • Gemini 3.1 Flash Text to speech
      • Gemini 2.5 Pro Text to Speech
    • Suno
      • Music Generation
        • Music Cover Generation Callbacks
        • Music Generation Callbacks
        • Music Extension Callbacks
        • Audio Upload and Cover Callbacks
        • Audio Upload and Extension Callbacks
        • Add Instrumental Callbacks
        • Add Vocals Callbacks
        • Replace Music Section Callbacks
        • Generate Music
          POST
        • Extend Music
          POST
        • Upload And Cover Audio
          POST
        • Upload And Extend Audio
          POST
        • Add Instrumental to Music
          POST
        • Add Vocals to Music
          POST
        • Get Timestamped Lyrics
          POST
        • Boost Music Style
          POST
        • Generate Music Cover
          POST
        • Replace Music Section
          POST
        • Generate Persona
          POST
        • Generate Mashup Music
          POST
        • Recovery Audio
          POST
      • WAV Conversion
        • Convert to WAV Callbacks
        • Convert to WAV Format
      • Music Video Generation
        • Music Video Generation Callbacks
        • Create Music Video
      • Lyrics Generation
        • Lyrics Generation Callbacks
        • Generate Lyrics
      • voice
        • Suno Voice Generation Callback
        • Suno Voice Validation Phrase Callback
        • Suno Voice Generate Verification Phrase API
        • Suno Voice Create Custom Voice API
        • Suno Voice Regenerate Verification Phrase
        • Suno Voice Check Availability API
      • Vocal Removal
        • Audio Separation Callbacks
        • MIDI Generation Callbacks
        • Vocal & Instrument Stem Separation
        • Generate MIDI from Audio
      • Sounds Generation
        • Generate sounds
  • Chat Models
    • GPT
      • GPT 5.2
      • GPT 5.4 (response)
      • GPT 5.5 (response)
      • GPT 5.6 Luna
      • Gpt 6 Astra
      • GPT 6 Luna
      • GPT 6 Sol
      • GPT 5.6 Terra
      • GPT 5.6 Sol
    • Claude
      • Claude Code + kie.ai Integration Guide
      • Claude Opus 4.7
      • Claude Opus 4.8
      • Claude Fable 5
      • Claude Sonnet 5
      • Claude Haiku 4.5
      • Claude Opus 4.5
      • Claude Opus 4.6
      • Claude Opus 5
      • Claude Sonnet 4.5
      • Claude Sonnet 4.6
    • Codex
      • GPT Codex
    • Gemini
      • Gemini 2.5 Pro (openai)
      • Gemini 3 Pro (openai)
      • Gemini 3.1 Pro (openai)
      • Gemini 3.5 Flash
      • Gemini 3.5 Flash (openai)
      • Gemini 3.6 Flash
      • Gemini 3.6 Flash (openai)
      • Gemini 3.7 Flash
      • Gemini 3.7 Flash (openai)
      • Gemini 3.8 Flash
      • Gemini 3.8 Flash (openai)
    • Grok
      • Grok 4.7
      • Grok 4.3
      • Grok 4.5
      • Grok 4.6
    • Deepseek
      • DeepSeek V4.1 Flash
    • Kimi
      • Kimi K3
  • Get Task Details
    GET
  1. Music Generation

Generate Music

POST
/api/v1/jobs/createTask
Document updated
If you have already completed the integration process previously, you can still access the old version document at: Old version address (https://docs.kie.ai/old-model/suno-api/generate-music)
Generate music with or without lyrics using AI models.

Usage Guide#

This endpoint creates music based on your text prompt
Multiple variations will be generated for each request
You can control detail level with custom mode and instrumental settings

Parameter Details#

Always required: custom_mode, instrumental, model
In Custom Mode (custom_mode: true):
title is required, maximum 80 characters
prompt is optional; when provided, it is used strictly as lyrics and sung in the generated track. If lyrics is also provided, lyrics takes priority
At least one of style, lyrics, or negative_tags must be provided; generation is rejected if all are empty
If instrumental: true: generate instrumental music (no vocals)
If instrumental: false: use lyrics as lyrics (fall back to prompt if lyrics is not provided)
Optional: duration, negative_tags, vocal_gender, style_weight, weirdness_constraint, audio_weight, variety, persona_id, persona_model
Character limits by model:
V4: prompt 3000 characters, style 200 characters
V4_5, V4_5PLUS, V4_5ALL, V5, V5_5: prompt 5000 characters, style 1000 characters
V6, V6_MINI, V6_WILD: style 1000 characters; lyrics 5000 characters
title length limit: 80 characters (all models)
In Non-custom Mode (custom_mode: false):
prompt is optional; it serves as the core idea, and lyrics are generated automatically (not a strict match), maximum 3000 characters
lyrics can be used as a lyrics attachment together with prompt
At least one of image_urls, video_urls, audio_urls, style, or lyrics must be provided; generation is rejected if all are empty
image_urls, video_urls, and audio_urls are only valid in this mode
Do not pass parameters that are only effective in custom mode: duration, vocal_gender, style_weight, weirdness_constraint, audio_weight, variety
Total attachments must not exceed 10: style + lyrics + image_urls + video_urls + audio_urls

Optional Parameters#

prompt (string): Description of the desired audio content. Optional. Used as lyrics in custom mode; used as the core idea in non-custom mode (maximum 3000 characters).
lyrics (string): Lyrics content. Optional. V6 maximum 5000 characters. In custom mode, takes priority over prompt as lyrics; in non-custom mode, can be used as a lyrics attachment together with prompt.
image_urls (array): Image references. Only effective when custom_mode is false. Up to 5 images, each no more than 10 MB. Supported formats: jpeg, png, webp, bmp.
video_urls (array): Video references. Only effective when custom_mode is false. Up to 1 file, each no more than 100 MB, duration no more than 241 seconds. Supported formats: mp4, mov, webm.
audio_urls (array): Audio references. Only effective when custom_mode is false. Duration must be between 6 seconds and 30 minutes; each file no more than 500 MB.
style (string): Music style specification. See character limits in Parameter Details above.
negative_tags (string): Music styles or traits to exclude from the generated audio. Optional.
vocal_gender (string): Vocal gender preference. m for male, f for female. Only effective when custom_mode is true. In practice, this only increases probability and cannot guarantee the instruction is followed.
style_weight (number): Strength of adherence to the specified style. Range 0–1, up to 2 decimal places. Only effective when custom_mode is true.
weirdness_constraint (number): Creative/experimental deviation. Range 0–1, up to 2 decimal places. Only effective when custom_mode is true.
audio_weight (number): Relative weight of audio features. Range 0–1, up to 2 decimal places. Only effective when custom_mode is true. Not supported when there are no vocals.
variety (number): Diversity of generated results. Integer from 0–4, default 1. Only effective when custom_mode is true. 0 off (exact style), 1 normal (default, balanced), 2 high (distinct styles), 3 extra (bold exploration), 4 max (maximum variation).
persona_id (string): Persona ID or Voice ID. Optional. To generate a Persona ID, see Generate Persona.
persona_model (string): Persona model, style_persona or voice_persona. Only available for V5 (Discontinued), V5.5 (Discontinued), V6, V6_MINI, and V6_WILD.
duration (number): Audio duration in seconds. Range 10–360, default 20. Only valid when custom_mode is true and the model is V5_5, V6, V6_MINI, or V6_WILD. Do not pass it otherwise.

Developer Notes#

Recommendation for new users: Start with custom_mode: false for simpler usage
Generated files are retained for 14 days
Callback process has three stages: text (text generation), first (first track complete), complete (all tracks complete)

Callbacks

audioGenerated

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Request successful
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.kie.ai/api/v1/jobs/createTask' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "ai-music-api/generate",
  "callBackUrl": "https://api.example.com/callback",
  "input": {
    "prompt": "A calm and relaxing piano track with soft melodies",
    "custom_mode": true,
    "instrumental": true,
    "model": "V4",
    "style": "Classical",
    "title": "Peaceful Piano Meditation",
    "negative_tags": "Heavy Metal, Upbeat Drums",
    "vocal_gender": "m",
    "style_weight": 0.65,
    "weirdness_constraint": 0.65,
    "audio_weight": 0.65,
    "persona_id": "persona_123",
    "persona_model": "style_persona",
    "duration": 20
  }
}'
Response Response Example
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "5c79****be8e"
    }
}
Previous
Replace Music Section Callbacks
Next
Extend Music
Built with