Music API

AI Music Generation API

Create full tracks, instrumentals, and stems with Suno and Udio through one API.

14 music models · full tracks with vocals · pay per second
14
Music models
25%
Below official
60s
Median render

Playground

live
Model
Vocals
instrumental
Mode
text_to_music
Est. cost
$0.13 / track $0.17 / track
Examples

Listen to AI-Generated Tracks

Cinematic Orchestral — Epic

  • Orchestral
  • Trailer
  • Heroic
3:24 Suno v4

Lo-Fi Study Loop

  • Lo-fi
  • Chill
  • Instrumental
2:48 Suno v4

Synthwave Night Drive

  • Synthwave
  • Retro
  • Driving
4:02 Udio 2

Acoustic Folk Sunrise

  • Folk
  • Acoustic
  • Warm
3:10 Udio 2

Everything the music endpoint can do

Text to Music

Describe genre, mood, and tempo and get a finished track — with or without vocals.

Extend Music

Continue an existing track to a target length while keeping key, tempo, and arrangement.

Separate Stems

Split a render into vocals, drums, bass, and other for mixing or re-scoring.

Generate Lyrics

Draft structured lyrics with verse and chorus markers, then feed them straight into a vocal render.

Music models on one key

Producer/fuzz-0.8

Producer

$0.13 / track

Suno/suno-v4

Suno

$0.17 / track

View all 14 music models
Quickstart

Generate a track

import json
import os
import requests

response = requests.post(
    "https://runapi.ai/api/v1/producer/text_to_music",
    headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
    json=json.loads("{\"model\":\"fuzz-0.8\",\"vocal_mode\":\"instrumental\",\"prompt\":\"Soft piano with gentle percussion.\"}")
)
response.raise_for_status()
print(response.json())
How it works

Four Steps to Your First Generation

  1. Get Your API Key

    One key for all music generation models.

  2. Describe Your Track

    Write a prompt with genre, mood, tempo, and instrumentation details.

  3. Generate

    POST to /api/v1/producer/text_to_music. Choose from the available music models.

  4. Stream or Download

    Get your generated track as MP3/WAV. Stems separation available.

Why Developers Choose RunAPI

One Key, All Models

Stop juggling API keys. One integration gives you access to 230+ models across all providers.

15-25% Cost Savings

Our volume agreements with providers mean lower prices than going direct. No markup on top.

Automatic Failover

If a provider goes down, we route to the next best option. Your app stays up.

OpenAI-Compatible

Drop-in replacement for OpenAI SDK. Change one line of code to access any model.

Real-Time Billing

Pay only for what you use. Per-request pricing with no minimums. Track costs per model, per project.

Data Privacy

Our Privacy Policy explains how request data and generated content are processed and retained.

What teams build with it

Background Music

Score product videos and demos with cleared, generated tracks instead of a stock library.

Podcasts

Generate intros, stingers, and bed music that match a show's tone across every episode.

Video Soundtracks

Pair with the video endpoint: generate the clip, then score it to the exact runtime.

Game Audio

Produce looping ambience per level or biome, and re-render on a theme change.

RunAPI vs alternatives

Feature RunAPI Suno Direct Replicate
Music models 14 Unavailable Unavailable
Pricing $0.13 / track Unavailable Unavailable
Stems separation Yes Unavailable Unavailable
Unified billing Yes Unavailable Unavailable
MCP server Yes Unavailable Unavailable
Provider failover Yes Unavailable Unavailable

Music API questions

How is music billed?

Per second of rendered audio. A 30-second track on Suno lands near a dollar, and failed renders are never charged.

Can I get vocals?

Yes. Leave instrumental false and pass lyrics, or let the model write them with the lyrics endpoint first.

Can I get separate stems?

Yes. Use task_type separate_stems on a finished render to get vocals, drums, bass, and other as files.

How long can a track be?

Up to 4 minutes in one call on Suno and Udio. Longer pieces are built by extending an existing render.

Can I use the output commercially?

That depends on the model provider's license, which the catalog links per model. RunAPI adds no extra restriction.

How long does a render take?

Roughly 40-90 seconds for a 30-second track. Use a webhook rather than polling the task.

Score your product with generated music

Suno and Udio behind one key, billed per second. Start free, no credit card required.