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
| Endpoint | POST https://app.suedeai.ai/create-music |
|---|---|
| Price | $0.50, amount 500000 USDC base units |
| Payment | x402 exact on eip155:8453 to 0x10FF767043A1723E0BB5B9207bC37D3442cC9E4F, or a Skyfire token |
| Paid response | 202 Accepted with a job envelope; save pollUrl when returned |
| Poll | GET https://app.suedeai.ai/api/songs/{songId}, free |
| Identifiers | OpenAPI operationId, A2A skill and MCP tool: create_music |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The 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". |
style | string | No | A style or genre tag, such as Hip Hop, Ambient or Rock. |
custom_mode | boolean | No | true to sing the lyrics you supply in lyrics. |
lyrics | string | When custom_mode is true | Your lyrics. |
make_instrumental | boolean | No | true for a track without vocals. |
vocal_gender | string | No | m or f. |
tags | string | No | Comma-separated keywords to tag the generated file. |
asyncMode | boolean | No | Switches 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
| Field | Description |
|---|---|
status | processing or queued. |
shareUrl | The browser share URL the track will have once the job completes. |
songId | The id of the song row, and the {songId} in pollUrl. It can be null when the job is queued before that row exists. |
pollUrl | The 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 andaudio_urlis 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.
| Field | Description |
|---|---|
id | The songId you polled. |
model_version | The job state, as above. |
audio_url | The finished MP3 once ready; a placeholder image URL before that. |
title, prompt, genre | Track title, the prompt it was generated from, and the style label from the request. |
image_url | Cover art URL. |
duration | Length in seconds; 0 until the render finishes. |
share_id | Public share identifier for the listener page. |
is_public | true for x402 and Skyfire paid jobs, which are created public so the buyer can fetch them. |
created_at | Creation 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
- Give each intended purchase its own
X-Idempotency-Keyand retain the original JSON. A changed prompt or intentional new take is a new purchase, not a retry. - 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-SIGNATUREout of URLs, logs and browser code. - Use the default asynchronous mode. Save the response, its
pollUrlif present, itssongIdwhen available, and the locally recorded payment reference. A202confirms acceptance, not audio delivery. Save a validpollUrleven whensongIdis absent; never construct a URL ending innull. - Poll without payment. Read
model_versionfirst.pendingmeans wait even ifaudio_urlreturns HTTP 200.failedis terminal. A nonempty version label and a valid media URL give you a candidate for delivery. - Download the candidate as media, not the
shareUrllistener page or theimage_urlcover. 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/pngor HTML and require a delivery error. - Also test
429with a numericRetry-After, a transport timeout, a404, and a worker restart using an existing poll URL. Do not attach credentials to any poll request.
Troubleshooting and retry decisions
| What you see | Next action |
|---|---|
First POST returns 402 | Read 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 POST | Check the API version, body size and field errors. Fix the request before another authorization; do not retry the same malformed body. |
Poll returns 429 | Honor Retry-After, back off and resume the same GET. Avoid one polling loop per UI tab. |
Poll returns 404 | Check 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 passes | Persist the original handle and resume later. Distinguish local timeout from a server-side failed status. |
| Version label present but audio does not play | Verify 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_musicandcreate_music_result. - Live requests on 2026-10-11: the unpaid 402 challenge and the 404 for an unknown
songId.