Create Music: POST /create-music

Turn a text prompt into a complete original song, with vocals, melody and full arrangement, delivered as a finished MP3 rather than a loop or preview. One call costs $0.50 in USDC on Base.

What it is for

Describe the genre, mood, instrumentation and tempo, supply your own lyrics, ask for an instrumental, or pin a style tag. The discovery document names soundtracks under video, release-ready artist tracks, podcast and game themes, and demo sketches as uses.

At a glance

EndpointPOST https://app.suedeai.ai/create-music
Price$0.50, amount 500000 USDC base units
Paymentx402 exact on eip155:8453 to 0x10FF767043A1723E0BB5B9207bC37D3442cC9E4F, or a Skyfire token
Paid response202 Accepted with a job envelope; save pollUrl when returned
PollGET https://app.suedeai.ai/api/songs/{songId}, free
IdentifiersOpenAPI operationId, A2A skill and MCP tool: create_music

Request body

FieldTypeRequiredDescription
promptstringYesThe song you want: genre, mood, instruments and any specific vibe. Examples from the schema: "Upbeat 80s synthwave with driving bass and neon atmosphere", "A melancholic acoustic guitar ballad about rain".
stylestringNoA style or genre tag, such as Hip Hop, Ambient or Rock.
custom_modebooleanNotrue to sing the lyrics you supply in lyrics.
lyricsstringWhen custom_mode is trueYour lyrics.
make_instrumentalbooleanNotrue for a track without vocals.
vocal_genderstringNom or f.
tagsstringNoComma-separated keywords to tag the generated file.
asyncModebooleanNoSwitches asynchronous mode on, never off. Paid calls are already asynchronous.

Example: your own lyrics

First send the request without PAYMENT-SIGNATURE to get the 402 challenge (amount 500000, priceUsd $0.50), sign it as shown in the quickstart, then send:

curl -i -X POST https://app.suedeai.ai/create-music \
  -H 'Content-Type: application/json' \
  -H "PAYMENT-SIGNATURE: $PAYMENT" \
  -H 'X-Idempotency-Key: rain-ballad-0001' \
  -d '{
    "prompt": "A melancholic acoustic guitar ballad about rain",
    "style": "Ambient",
    "custom_mode": true,
    "lyrics": "Your lyrics here",
    "vocal_gender": "f"
  }'

For a track without vocals, drop custom_mode and lyrics and send "make_instrumental": true.

Response to a paid call: 202 Accepted

FieldDescription
statusprocessing or queued.
shareUrlThe browser share URL the track will have once the job completes.
songIdThe id of the song row, and the {songId} in pollUrl. It can be null when the job is queued before that row exists.
pollUrlThe absolute URL of GET /api/songs/{songId}. No further payment.

With ?async=false the call blocks and answers 200 with shareUrl (a public page to listen to and download the track), title and imageUrl (cover art). Renders take minutes and payment clients time out in about 30 seconds, so the default asynchronous mode suits most callers.

Polling: GET /api/songs/{songId}

Music returns the song row, not the jobId and status shape the video and image polls use. Read model_version:

  • pending: the track is queued or rendering. Poll again.
  • failed: generation failed. This is final; stop polling.
  • Any version label, such as v4.5: the track is ready and audio_url is the finished MP3.

Until the track is ready, audio_url holds the placeholder cover-image URL the row was created with. It is a reachable image, not audio, so a present audio_url does not mean the track is finished.

FieldDescription
idThe songId you polled.
model_versionThe job state, as above.
audio_urlThe finished MP3 once ready; a placeholder image URL before that.
title, prompt, genreTrack title, the prompt it was generated from, and the style label from the request.
image_urlCover art URL.
durationLength in seconds; 0 until the render finishes.
share_idPublic share identifier for the listener page.
is_publictrue for x402 and Skyfire paid jobs, which are created public so the buyer can fetch them.
created_atCreation time, ISO 8601.

An unknown songId answers 404 with {"error":"Song not found"}. A 404 means no accessible song row was found for that lookup, not that the track is still rendering.

Choose the right request mode

For generated vocals, describe the song rather than supplying a lyrics field. Start with genre, mood, instrumentation and structure. For a podcast opener, for example, ask for a restrained intro, a recognizable motif, and space for speech. Treat tempo, structure and length in the brief as creative direction, not timing guarantees; cut the delivered audio to picture after review.

For supplied lyrics, use custom_mode: true and put the intended words in lyrics. Keep arrangement instructions in prompt. Use text you are authorized to transmit, and do not send confidential lyrics or client information: paid tracks are created public and the song record can include the prompt.

For an instrumental, omit custom_mode, lyrics and vocal_gender. Use one clear direction rather than mixing instrumental and vocal instructions:

{
  "prompt": "Quiet documentary underscore. Felt piano, soft strings, no percussion, sparse texture under spoken narration.",
  "style": "Ambient",
  "make_instrumental": true
}

For original generated vocals:

{
  "prompt": "Mid-tempo indie folk song with a close vocal, brushed drums and acoustic guitar; restrained verses and a wider final chorus.",
  "style": "Indie Folk"
}

Use the published request schema for automation. The SDK can send other values in its convenience methods; an argument being transmitted does not mean the server guarantees an exact duration, file size, or arrangement.

From payment approval to delivery

  1. Give each intended purchase its own X-Idempotency-Key and retain the original JSON. A changed prompt or intentional new take is a new purchase, not a retry.
  2. Read the current terms from the discovery document and verify the payment challenge before signing. Check network, asset, recipient, amount and resource against your budget and allowlist. Keep the signing key and PAYMENT-SIGNATURE out of URLs, logs and browser code.
  3. Use the default asynchronous mode. Save the response, its pollUrl if present, its songId when available, and the locally recorded payment reference. A 202 confirms acceptance, not audio delivery. Save a valid pollUrl even when songId is absent; never construct a URL ending in null.
  4. Poll without payment. Read model_version first. pending means wait even if audio_url returns HTTP 200. failed is terminal. A nonempty version label and a valid media URL give you a candidate for delivery.
  5. Download the candidate as media, not the shareUrl listener page or the image_url cover. Check successful HTTP status, audio content type and playable, decodable bytes before marking a job delivered. Store the version, duration and your verified output reference in your own records.

If you already received a job reference, resume the existing poll after a restart. If a signed POST timed out and no response was saved, reconcile the payment reference before sending a newly signed purchase. Treat a submit timeout as an unknown job outcome. Use the original key for a permitted replay within the cache window; reconcile payment separately.

Bounded polling in Python

This httpx example takes the saved pollUrl from an accepted request. It performs no paid calls and does not download the file. The three-minute deadline is a client choice, not a service limit. Timeout means the polling worker stopped, not that it canceled the generation.

import time
from urllib.parse import urlsplit

import httpx


def wait_for_song(poll_url: str, max_wait: float = 180) -> str:
    url = urlsplit(poll_url)
    path = url.path.split("/")
    if (url.scheme != "https" or url.netloc != "app.suedeai.ai"
            or len(path) != 4 or path[:3] != ["", "api", "songs"]
            or path[3] in ("", ".", "..") or url.query or url.fragment):
        raise ValueError("Unexpected song polling URL")

    deadline = time.monotonic() + max_wait
    delay = 3.0
    with httpx.Client(follow_redirects=False) as client:
        while (remaining := deadline - time.monotonic()) > 0:
            pause = delay
            try:
                response = client.get(
                    poll_url, timeout=min(10.0, remaining)
                )
            except httpx.TransportError:
                pass  # transient network error; retry only the free GET
            else:
                if response.status_code == 404:
                    raise LookupError("Song not found; check the saved reference")
                if response.status_code in (429, 502, 503, 504):
                    retry_after = response.headers.get("Retry-After", "")
                    if retry_after.isascii() and retry_after.isdecimal():
                        pause = max(pause, int(retry_after))
                else:
                    response.raise_for_status()
                    song = response.json()
                    version = song.get("model_version")
                    if version == "failed":
                        raise RuntimeError("Music generation failed")
                    if version != "pending":
                        audio_url = song.get("audio_url")
                        if isinstance(version, str) and version.strip() and isinstance(audio_url, str):
                            audio = urlsplit(audio_url)
                            if audio.scheme == "https" and audio.hostname:
                                return audio_url
                        raise ValueError("Song result is missing version or audio URL")
            time.sleep(max(0, min(pause, deadline - time.monotonic())))
            delay = min(delay * 1.5, 15.0)

    raise TimeoutError("Still unresolved; save the poll URL and resume later")

Before using the returned URL in a server-side downloader, apply your media-host allowlist and check any redirect destination independently. An HTTPS URL alone does not prove that it serves MP3 audio.

Test the states without paying

Use local fixtures with placeholder values. These examples illustrate fields the poller should act on, not complete API responses or URLs to fetch.

{"id":"example-song","model_version":"pending","audio_url":"https://example.invalid/cover.png"}
{"id":"example-song","model_version":"failed","audio_url":null}
{"id":"example-song","model_version":"v4.5","audio_url":"https://example.invalid/track.mp3"}
  • In the first case assert that no download starts, even if the cover URL says 200.
  • In the second case assert that the poller stops and does not resubmit.
  • In the third case assert that the downloader receives the media URL, not the public share page. Simulate a response with image/png or HTML and require a delivery error.
  • Also test 429 with a numeric Retry-After, a transport timeout, a 404, and a worker restart using an existing poll URL. Do not attach credentials to any poll request.

Troubleshooting and retry decisions

What you seeNext action
First POST returns 402Read the challenge. Authorize only after verifying the current terms. A repeated 402 is a signal to inspect the challenge or payment result, not to sign in a loop.
400, 413 or 422 on POSTCheck the API version, body size and field errors. Fix the request before another authorization; do not retry the same malformed body.
Poll returns 429Honor Retry-After, back off and resume the same GET. Avoid one polling loop per UI tab.
Poll returns 404Check the original reference and whether the app used the right route. Not the pending signal; do not pay again based on this alone.
Accepted, but client deadline passesPersist the original handle and resume later. Distinguish local timeout from a server-side failed status.
Version label present but audio does not playVerify the media response and bytes instead of relying on extension or status alone. Retain the song ID and report a delivery issue without a new purchase.

For transport and payment recovery rules see Errors, rate limits and retries. For signing and budget checks see the x402 quickstart.

Sources

  • app.suedeai.ai/.well-known/x402: description, price, payment requirement and input schema (resource entry last updated 2026-08-30).
  • app.suedeai.ai/openapi.json: operations create_music and create_music_result.
  • Live requests on 2026-10-11: the unpaid 402 challenge and the 404 for an unknown songId.