Back to Suno Model

Generate Music

Generate original music using AI. Supports both inspiration mode (text description) and custom mode (lyrics, style, title).

Endpoint Overview

POST/api/v1/audio/music

Two Generation Modes:

  • Inspiration Mode: Use gpt_description_prompt to generate music from a text description. The model will automatically write lyrics and pick a style.
  • Custom Mode: Use prompt, style, and title for detailed control over the exact song output.

Credits: 5–12 credits per generation depending on the model tier.

Parameters

Common Parameters

ParâmetroTipoObrigatórioDescrição
modelstringOpcionalAI model to use. Options: suno-v3-5, suno-v4-0, suno-v4-0-vip, suno-v4-0-pro, suno-v4-5, suno-v5-0. (Padrão: suno-v3-5)
make_instrumentalbooleanOpcionalGenerate instrumental music without vocals. (Padrão: false)
callback_urlstringOpcionalOptional webhook URL to receive real-time results via POST.

Inspiration Mode

Generate music from a text description.

ParâmetroTipoObrigatórioDescrição
gpt_description_promptstringObrigatórioText description of the music you want to generate. Max length: 400 chars.

Custom Mode

Generate music with custom lyrics, style, and title.

ParâmetroTipoObrigatórioDescrição
promptstringObrigatórioCustom lyrics or detailed prompt. Max length: 3000 chars (5000 chars for v4-5).
stylestringOpcionalMusical style/genre. Max length: 200 chars (1000 chars for v4-5/v5-0).
titlestringOpcionalSong title. Max length: 80 characters.
tagsstringOpcionalNegative tags to avoid in generation.

Example Request

cURL (Custom Mode)

bash
curl -X POST "https://apiin.one/api/v1/audio/music" \
  -H "Authorization: Bearer aio_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-v4-5",
    "prompt": "Verse 1: Walking down the street, feeling so free\nChorus: Summer dreams are calling me",
    "style": "pop, upbeat, electronic, 120 bpm",
    "title": "Summer Dreams",
    "make_instrumental": false
  }'

Example Response

This API returns a task ID immediately. You must poll the Feed endpoint to get the final audio URLs.

json
{
  "task_id": "gen123abc456def789ksv",
  "status": "pending",
  "model": "suno-v4-5",
  "created_at": "2026-02-24T12:00:00Z"
}

Error Handling

Status CodeTipoObrigatórioDescrição
400invalid_requestOpcionalInvalid parameters, missing required fields, or validation error.
401authentication_errorOpcionalInvalid or missing API key.
402insufficient_creditsOpcionalInsufficient balance to perform generation.