You want your app to produce music: a full track with vocals, or an instrumental bed, generated from a text brief. Suno is the model people reach for, because it returns complete songs rather than loops. The hard part is wiring it in cleanly: an account and budget separate from the rest of your AI stack, and an async job format you have to learn on its own.

This post shows how to generate songs with Suno through AI Generate, an OpenAI-compatible aggregator. Your request is routed to the upstream provider and the result comes back through one API key and one credit pool that also covers chat, image and video. We did not build Suno and we do not claim to be the cheapest way to reach it. There is a margin on top of upstream cost, stated plainly. What you get is one surface and one bill instead of several.

What can you generate with Suno?

  • Full songs with vocals. Give it a style brief and it writes, arranges and performs a complete track.
  • Custom lyrics. Supply your own words and let the model handle melody, arrangement and the vocal performance.
  • Instrumentals. Ask for no vocals when you need a background bed for video, a game loop or a podcast intro.

Generation is asynchronous and usually returns more than one take per request, so you can pick the better result.

How do I call the Suno API?

Music uses the same jobs surface as the other media models. You POST a model slug and an input object and receive a taskId straight away. Auth is a Bearer token starting with sk-aig-, created on the register page.

1. Create a song

curl https://aimarcusimage.eu/api/v1/jobs/createTask \
  -H "Authorization: Bearer sk-aig-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno",
    "input": {
      "prompt": "Upbeat synthwave, driving bass, warm retro pads",
      "instrumental": false
    }
  }'
{ "taskId": "9b1c2d3e4f5061728394a5b6c7d8e9f0" }

2. Generate with custom lyrics

Turn on custom mode and pass your lyrics plus a style and a title. The model handles melody, harmony and the vocal take.

curl https://aimarcusimage.eu/api/v1/jobs/createTask \
  -H "Authorization: Bearer sk-aig-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno",
    "input": {
      "customMode": true,
      "title": "Midnight City",
      "style": "indie pop ballad",
      "prompt": "[Verse 1]\nWaking up to a city that never sleeps\n[Chorus]\nWe run until the morning light"
    }
  }'

3. Poll for the audio URL

import time, requests

BASE = "https://aimarcusimage.eu/api/v1"
HEAD = {"Authorization": "Bearer sk-aig-..."}

def create_song(prompt, instrumental=False):
    r = requests.post(f"{BASE}/jobs/createTask", headers=HEAD, json={
        "model": "suno",
        "input": {"prompt": prompt, "instrumental": instrumental},
    })
    r.raise_for_status()
    return r.json()["taskId"]

def wait_for_song(task_id, every=5, timeout=300):
    deadline = time.time() + timeout
    while time.time() < deadline:
        r = requests.get(f"{BASE}/jobs/recordInfo",
                         headers=HEAD, params={"taskId": task_id})
        r.raise_for_status()
        data = r.json()
        state = data.get("state") or data.get("status")
        if state in ("success", "completed"):
            return data
        if state in ("failed", "error"):
            raise RuntimeError(data)
        time.sleep(every)
    raise TimeoutError(task_id)

tid = create_song("Lo-fi hip hop, mellow piano, rainy night")
result = wait_for_song(tid)
print(result)

A completed record carries one or more audio URLs (Suno typically returns variations) along with a duration per track. The exact field names are shaped by the upstream provider, so read defensively: confirm the completion state, then walk the results array for the audio link. Store the full record the first time so you can map fields once.

Webhook instead of polling

For a service rather than a script, add a callback URL to the task and receive a push when the song is ready:

{
  "model": "suno",
  "input": { "prompt": "Cinematic orchestral build, hopeful, strings and brass" },
  "callBackUrl": "https://your-app.example/webhooks/suno"
}

Verify the signature, find the job by its taskId, then download and rehost the audio. Keep a slow poll as a fallback for any missed callback.

Where this is useful

  • Video and shorts. Generate a fitting instrumental per clip instead of reusing one stock track.
  • Games. Produce themed loops for levels, menus and events.
  • Personalised media. Birthday songs, greetings and named tracks from user input.
  • Prototyping. Mock up a jingle or theme before committing a composer's time.

For spoken narration, a dedicated text-to-speech model is faster and cheaper than a music model; reach for Suno when you actually want music.

What this costs / how pricing works

You pay per call from a prepaid balance. No subscription, no monthly minimum. Top up from $10, credits never expire, and the same pool covers music, chat, image and video. New accounts get free trial credits once the email is verified, enough to generate a handful of songs and judge the fit. Suno is billed per generation; the per-call price for each variant is on the model page and the playground shows it before you spend. As an aggregator we add a margin over upstream cost, so a single-model app may be cheaper direct. The trade is one key and one bill across everything you build.

When to use this vs going direct

SituationBetter fit
Suno is the only model you will ever callDirect provider
You also call chat, image or video modelsAI Generate (one key, one bill)
You want a music bed alongside generated video in one flowAI Generate
You want one prepaid budget and spend capsAI Generate

FAQ

Is this the official Suno API?

No. AI Generate is an aggregator that routes your request to the upstream provider and returns the same output, with one key and one credit pool shared across every model.

Can I use my own lyrics?

Yes. Enable custom mode and pass your lyrics in the prompt with a style and title. The model writes melody and arrangement and performs the vocal.

How long does a song take to generate?

Usually under a minute or two. It is asynchronous, so poll on a 5-second interval or use a webhook rather than blocking a request.

Can I generate instrumentals only?

Yes. Set instrumental to true and the model returns a track without vocals, which is ideal for video beds and game loops.

Request details are in the documentation, variants and pricing are on the Suno page, browse everything else in the model catalogue, and create a key on the register page.