REST API · Live

Song Generation API vs Udio

Comparing song generation API vs Udio: Udio is a consumer subscription app with no public developer endpoint. PixelAPI is a pay-per-call REST API — POST your lyrics and a style prompt, get back an MP3 in seconds. $0.028 per song. No subscription, no seat limits, 300 free credits to start, no credit card required.

$0.028 / song MP3 output 300 free credits No credit card Up to 120 s Instrumental mode Multi-language
Get an API key (free) Quick start See pricing API docs

Quick start — one API call

Sign up, copy your key from the dashboard, and POST your song request. For short durations the MP3 is often returned inline. For longer tracks, poll until status=completed and download from output_url.

curl -X POST https://api.pixelapi.dev/v1/song/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "upbeat indie pop, acoustic guitar, warm vocals",
    "lyrics": "[Verse]\nSunshine through the window pane\nEverything is new again\n[Chorus]\nSing it out, we are alive",
    "duration": 60,
    "language": "en"
  }'
# Response: {"generation_id": "uuid", "status": "processing", ...}

# Poll until completed
curl https://api.pixelapi.dev/v1/song/UUID \
  -H "Authorization: Bearer YOUR_API_KEY"
# Response: {"status": "completed", "output_url": "https://..."}
pip install pixelapi
---
from pixelapi import PixelAPI

client = PixelAPI(api_key="YOUR_API_KEY")
result = client.generate_song(
    prompt="upbeat indie pop, acoustic guitar, warm vocals",
    lyrics="[Verse]\nSunshine through the window pane\n[Chorus]\nSing it out, we are alive",
    duration=60,
    language="en",
)
result.save("my_song.mp3")  # saves the MP3
npm install pixelapi
---
import { PixelAPI } from "pixelapi";

const client = new PixelAPI({ apiKey: process.env.PIXELAPI_KEY });
const result = await client.generateSong({
  prompt: "upbeat indie pop, acoustic guitar, warm vocals",
  lyrics: "[Verse]\nSunshine through the window pane\n[Chorus]\nSing it out, we are alive",
  duration: 60,
  language: "en",
});
await result.save("my_song.mp3"); // saves the MP3
composer require pixelapi/pixelapi
---
<?php
use PixelAPI\Client;

$client = new Client(getenv("PIXELAPI_KEY"));
$result = $client->generateSong([
    "prompt"   => "upbeat indie pop, acoustic guitar, warm vocals",
    "lyrics"   => "[Verse]\nSunshine through the window pane",
    "duration" => 60,
    "language" => "en",
]);
file_put_contents("my_song.mp3", $result->getBody());
gem install pixelapi
---
require "pixelapi"

client = PixelAPI::Client.new(api_key: ENV["PIXELAPI_KEY"])
result = client.generate_song(
  prompt:   "upbeat indie pop, acoustic guitar, warm vocals",
  lyrics:   "[Verse]\nSunshine through the window pane",
  duration: 60,
  language: "en"
)
File.binwrite("my_song.mp3", result.body)
go get github.com/pixelapi/pixelapi-go
---
import "github.com/pixelapi/pixelapi-go"

client := pixelapi.New("YOUR_API_KEY")
result, err := client.GenerateSong(pixelapi.SongRequest{
    Prompt:   "upbeat indie pop, acoustic guitar, warm vocals",
    Lyrics:   "[Verse]\nSunshine through the window pane",
    Duration: 60,
    Language: "en",
})
if err != nil { panic(err) }
result.Save("my_song.mp3")

For instrumental tracks (no vocals), use POST /v1/audio/generate with just a prompt field — no lyrics needed.

Song Generation API vs Udio: pricing comparison

ProviderFree tierPer-song costDeveloper APIOutput
PixelAPI 300 credits, no card $0.028 ✓ Pay-per-call REST MP3 · up to 120 s
Suno Free tier (web only) ~$0.40/song via downloads (Pro $8/mo ÷ 20 songs) No public API MP3 (web download)
Udio See udio.com/pricing See udio.com/pricing No public API MP3 (web download)
Soundraw — Subscription from $5.99/mo Enterprise only (contact sales) MP3 · WAV (higher tiers)

Pricing verified from each rival's public pricing page November 2026. Suno and Udio are consumer subscription products with no published pay-per-call API pricing. PixelAPI is the only service in this comparison with a public, pay-per-use developer API.

What you get back

MP3 — industry-standard audio

Every generation returns a standard MP3 file at the requested duration. Compatible with every DAW, video editor, streaming pipeline, and consumer playback app without conversion.

Lyrics + vocals

Pass your own lyrics (up to 2,000 characters) with section tags like [Verse], [Chorus], [Bridge]. The model aligns sung vocals to the structure you specify.

Instrumental tracks

Set instrumental: true and omit lyrics to generate a purely instrumental track — no post-processing required. Duration 10–120 seconds.

Style transfer via reference audio

Pass any public MP3/WAV URL in reference_audio_url. The model generates a new song in the style of the reference — matching its tempo, timbre, and energy — using your own lyrics and prompt.

API features

Multi-language lyrics

English, Hindi, Mandarin, Japanese, Korean, and more. Pass a language code and the model adapts its vocal phrasing to the target language.

Song extension

Pass extend_from with a prior generation_id to continue a song beyond its original duration, up to 120 seconds total.

Song variations

Pass variation_of to generate a fresh take with the same structure and style — useful for A/B testing ad music or exploring arrangement options.

Configurable duration

10–120 seconds per generation. Pass duration to control length. Short jingles at 15 s or full radio-length tracks at 90 s — same price per song.

Style prompt control

The prompt field accepts natural-language style descriptions: genre, mood, instrumentation, tempo, era. Up to 500 characters.

Polling + webhooks

Poll GET /v1/song/{id} for status, or configure a webhook URL to receive a POST when the generation completes. Short tracks often return inline.

Common workflows

The song generation API is the foundation for these production workflows. Each links to a full setup guide:

Content creators

Generate royalty-free background music and intro jingles for YouTube, Reels, and TikTok at scale — without stock music licenses.

Advertising

Create on-brand ad soundtracks matched to campaign briefs. Generate a dozen variations and pick the best — $0.028 each.

Marketing agencies

Programmatic music for client campaigns, social ads, and email video embeds — no licensing headaches.

E-commerce

Product demo videos and category page ambient audio generated from product descriptions. Inject personality at the catalog level.

Social media

Trend-matched background tracks for Reels and Shorts. Generate, preview, and publish — no waiting for a composer.

More use-case guides: all industries →

Integrations & SDKs

Shopify

Auto-generate product video background music on new product upload via Shopify webhook.

Zapier

Trigger song generation from any Zapier event — new form entry, CRM deal, or social post.

Make.com

Drag-and-drop song generation inside Make scenarios. Connect to Google Sheets, Airtable, or Notion.

Webflow

CMS-driven music generation for Webflow sites — generate a unique audio track for each CMS item.

Next.js

Server-side song generation in Next.js API routes. Stream status updates to the client via SSE.

WooCommerce

Product video soundtracks generated automatically when new WooCommerce products are published.

Comparison vs alternatives

vs Suno

Suno is a consumer subscription app ($8–$24/mo). PixelAPI is a pay-per-use API — no subscription, no seat management, $0.028/song.

vs Udio

Udio has no public developer API. PixelAPI exposes a fully documented REST endpoint with SDKs in 5 languages and a free trial.

vs Soundraw

Soundraw is subscription-based with Enterprise-only API access on request. PixelAPI's API is open to everyone from the first sign-up.

vs Aiva

Aiva targets composers with score-driven orchestral music. PixelAPI targets developers who need lyrics-to-song in an HTTP call.

Rate limits & error handling

Free trial: 20 requests/minute, 3 concurrent jobs. Starter: 60 req/min, 10 concurrent. Pro: 120 req/min, 20 concurrent. Scale: 300 req/min, 50 concurrent. Full details at pixelapi.dev/docs/parallel-processing.html.

Exceeding the rate limit returns HTTP 429 with a Retry-After header. The recommended strategy is exponential backoff starting at 2 s and doubling up to 30 s. The Python and Node SDKs handle this automatically.

# Python SDK — auto-retries 429 with exponential backoff
from pixelapi import PixelAPI
client = PixelAPI(api_key="...", max_retries=4)
result = client.generate_song(
    prompt="chill lo-fi hip hop",
    lyrics="[Verse]\nLate night study session",
    duration=90,
)  # auto-retries on 429, raises after max_retries exhausted

If a generation fails (bad prompt, content policy), the job is rejected and the 28 credits are automatically refunded — you never pay for a failed result.

Frequently asked questions

What is the difference between PixelAPI's song generation API and Udio?

Udio is a consumer web app with subscription plans — it has no public developer API and no pay-per-call pricing. PixelAPI is a REST API you integrate into your own product: POST lyrics, get an MP3 back. No subscription, no seat limits, no login wall for your users. You pay $0.028 per song and nothing more.

How do I generate a song via API?

POST to https://api.pixelapi.dev/v1/song/generate with an Authorization: Bearer YOUR_KEY header and a JSON body containing prompt, lyrics, and optional duration. The response includes a generation_id. Poll GET /v1/song/{id} until status=completed, then download the MP3 from output_url. See the Quick Start section above for code in 6 languages.

What does the song generation API cost?

$0.028 per song (28 credits × $0.001 per credit). New accounts start with 300 free credits — enough to generate 10 full songs before entering payment details. For comparison, Suno's Pro consumer plan works out to $0.40 per downloadable song ($8/month ÷ 20 download slots).

Can I generate instrumental music (no vocals)?

Yes. Set instrumental: true in the request body and omit the lyrics field entirely. Alternatively, POST to https://api.pixelapi.dev/v1/audio/generate with just a text prompt describing the music — no lyrics field needed. Same price, same MP3 output, same 10–120 s duration range.

What output format is returned?

MP3, accessible via the output_url field in the completed generation response. MP3 is compatible with every DAW (Logic, Ableton, Pro Tools), every video editor (Premiere, DaVinci, CapCut), and every streaming platform. No conversion step required.

What languages are supported for lyrics?

English (en), Hindi (hi), Mandarin Chinese (zh), Japanese (ja), Korean (ko), and additional languages. Set the language field in your request. The model adapts its vocal phrasing and rhythm to the target language automatically.

Can I extend or remix an existing song?

Yes. Use extend_from with a prior generation_id to continue the song from exactly where it ended, up to 120 seconds total. Use variation_of to generate a fresh arrangement of the same style — useful for iterating on ad music or exploring different energy levels for the same track.

Does the API support style transfer from a reference track?

Yes. Pass a public HTTPS URL to any MP3, WAV, M4A, FLAC, or OGG file in the reference_audio_url field. The API generates a new original song in the style of the reference — matching its tempo, instrumentation, and energy — while using your own lyrics and prompt text.

What are the rate limits?

Free trial: 20 requests/minute, 3 concurrent jobs. Starter: 60 req/min, 10 concurrent. Pro: 120 req/min, 20 concurrent. Scale: 300 req/min, 50 concurrent. The Python and Node SDKs handle 429 retry-with-backoff automatically. For higher throughput, email support@pixelapi.dev.

Is there a Python SDK?

Yes — pip install pixelapi. Official SDKs are also available for Node.js (npm install pixelapi), PHP (Composer), Ruby (Gem), and Go (go get). All SDKs handle authentication, polling, 429 retry with backoff, and binary file download automatically.

Start free — 300 credits, no card Read full API docs Compare all plans