AI Video APIAI Video API


Suno

AI music generation powered by Suno. Generate high-quality songs with lyrics, instrumentals, and custom styles. Each generation produces multiple audio tracks.

Models

Model NameDescription
suno-v5_5Suno V5.5 - Tailored custom models for personalized taste
suno-v5Suno V5 - Superior expression, faster generation

Pricing

Flat rate per generation:

ModelCreditsPrice
suno-v5_524 credits$0.12
suno-v524 credits$0.12

Each generation produces multiple audio tracks.

Create Task

curl -X POST https://api.aivideoapi.ai/v1/music/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-v5_5",
    "input": {
      "prompt": "A calm and relaxing piano track with soft melodies",
      "custom_mode": false,
      "instrumental": true
    }
  }'

Request Body

FieldTypeRequiredDescription
modelstringYessuno-v5_5 or suno-v5
inputobjectYesGeneration parameters, see below
callback_urlstringNoURL to receive task completion/failure notifications

Input Object

The input parameters depend on whether custom mode is enabled.

Non-Custom Mode (Simple)

FieldTypeRequiredDescription
promptstringYesAudio content description (max 500 characters)
custom_modebooleanNoSet to false or omit. Default false
instrumentalbooleanNoGenerate without vocals if true. Default false

Custom Mode

FieldTypeRequiredDescription
promptstringConditionalLyrics text (max 3000 characters). Required when instrumental is false
custom_modebooleanYesMust be true
instrumentalbooleanNoGenerate without vocals if true. Default false
titlestringYesTrack title (max 80 characters)
stylestringYesGenre/mood specification (max 200 characters)
negative_tagsstringNoStyles to exclude (max 200 characters)
vocal_genderstringNoVocal preference: m (male) or f (female)
persona_idstringNoCustom persona style ID
style_weightnumberNoStyle adherence strength (0-1)
weirdness_constraintnumberNoCreative deviation control (0-1)
audio_weightnumberNoAudio feature balance (0-1)

Example: Simple Generation

curl -X POST https://api.aivideoapi.ai/v1/music/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-v5",
    "input": {
      "prompt": "An upbeat electronic dance track with heavy bass drops"
    }
  }'

Example: Custom Instrumental

curl -X POST https://api.aivideoapi.ai/v1/music/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-v5_5",
    "input": {
      "custom_mode": true,
      "instrumental": true,
      "title": "Peaceful Piano Meditation",
      "style": "Classical, Ambient, Piano",
      "negative_tags": "Heavy Metal, Drums"
    }
  }'

Example: Custom Song with Lyrics

curl -X POST https://api.aivideoapi.ai/v1/music/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-v5_5",
    "callback_url": "https://your-server.com/webhook",
    "input": {
      "custom_mode": true,
      "instrumental": false,
      "title": "Summer Nights",
      "style": "Pop, Indie",
      "vocal_gender": "f",
      "prompt": "[Verse]\nWalking down the empty street\nCity lights beneath my feet\nEvery star is shining bright\nLost inside the summer night\n\n[Chorus]\nSummer nights, we come alive\nDancing under neon skies"
    }
  }'

Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

Query Task

curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
  -H "Authorization: Bearer sk-your-api-key"

Status transitions: pending -> processing -> completed or failed.

Completed

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "completed",
  "model": "suno-v5_5",
  "created_at": 1775383908,
  "completed_at": 1775384028,
  "output": {
    "urls": [
      "https://file.aivideoapi.ai/audio/2026/04/05/track1.mp3",
      "https://file.aivideoapi.ai/audio/2026/04/05/track2.mp3"
    ],
    "metadata": {
      "tracks": [
        {
          "id": "track-uuid-1",
          "title": "Summer Nights",
          "tags": "pop, indie",
          "duration": 198.44,
          "image_url": "https://example.com/cover1.jpeg",
          "prompt": "[Verse]\nWalking down the empty street..."
        },
        {
          "id": "track-uuid-2",
          "title": "Summer Nights",
          "tags": "pop, indie",
          "duration": 201.12,
          "image_url": "https://example.com/cover2.jpeg",
          "prompt": "[Verse]\nWalking down the empty street..."
        }
      ]
    }
  }
}

Audio URLs are valid for 24 hours. Each generation typically produces 2 track variations.

Failed

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "failed",
  "model": "suno-v5_5",
  "created_at": 1775383908,
  "error": {
    "code": "upstream_error",
    "message": "Music generation failed"
  }
}

When a task fails, pre-charged credits are automatically refunded.

Callback

Pass callback_url when creating the task. The system will automatically send a POST request to your URL when the task completes or fails. The format matches the query task response.


Error Codes

When a request fails, the API returns a JSON error response:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

Error Reference

HTTP StatusCodeTypeDescription
400invalid_requestinvalid_request_errorMissing or invalid parameters
401invalid_api_keyauthentication_errorAPI key is invalid, disabled, or deleted
402insufficient_creditsbilling_errorCredit balance too low, please top up
403ip_not_allowedpermission_errorRequest IP not in the key's allowlist
404model_not_foundinvalid_request_errorModel does not exist or is inactive
404task_not_foundinvalid_request_errorTask ID does not exist
429rate_limit_exceededrate_limit_errorToo many requests, please slow down
429spend_limit_exceededbilling_errorKey spend limit reached (hourly/daily/total)
500internal_errorapi_errorUnexpected server error
503upstream_errorupstream_errorUpstream AI provider returned an error

Common Scenarios

invalid_request (400)

Returned when required fields are missing or invalid.

{
  "error": {
    "code": "invalid_request",
    "message": "'model' is required.",
    "type": "invalid_request_error"
  }
}

insufficient_credits (402)

Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.

invalid_api_key (401)

Possible causes:

  • The key does not start with sk-
  • The key has been disabled or deleted
  • The user account has been banned

upstream_error (503)

The upstream AI provider returned an error. This may happen when:

  • The input contains sensitive or prohibited content
  • The provider is temporarily unavailable
  • The request parameters are not supported by the provider

Credits are automatically refunded when a task fails due to upstream errors.