---
title: RunAPI Music API - AI Music Generation API | RunAPI
description: Create full tracks, instrumentals, and stems through one AI music generation API.
url: https://runapi.ai/music.md
canonical: https://runapi.ai/music
locale: en
site: RunAPI
image: https://runapi.ai/assets/opengraph-f702f2b1.png
alternates:
  en: https://runapi.ai/music
  zh-CN: https://runapi.ai/zh-CN/music
  es: https://runapi.ai/es/music
  ja: https://runapi.ai/ja/music
  de: https://runapi.ai/de/music
  fr: https://runapi.ai/fr/music
  pt-BR: https://runapi.ai/pt-BR/music
  ko: https://runapi.ai/ko/music
  it: https://runapi.ai/it/music
  nl: https://runapi.ai/nl/music
  pl: https://runapi.ai/pl/music
  tr: https://runapi.ai/tr/music
  zh-TW: https://runapi.ai/zh-TW/music
  zh-HK: https://runapi.ai/zh-HK/music
  ar: https://runapi.ai/ar/music
  x-default: https://runapi.ai/music
---

> HTML version: https://runapi.ai/music
> Site index for agents: https://runapi.ai/llms.txt


# AI Music Generation API

Create full tracks, instrumentals, and stems through one AI music generation API.

- [Get API Key](https://runapi.ai/login)
- [Browse Models](https://runapi.ai/models.md)

14 music models · full tracks with vocals · pay per second

## Playground

Available models: Producer/fuzz-0.8 ($0.13 / track), Suno/suno-v4 ($0.17 / track)

## 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

| Model | Provider | Price |
| --- | --- | --- |
| Producer/fuzz-0.8 | Producer | $0.13 / track |
| Suno/suno-v4 | Suno | $0.17 / track |


[View all 14 music models](https://runapi.ai/models.md)


## Quickstart

### Generate a track

#### curl

```bash
curl https://runapi.ai/api/v1/producer/text_to_music \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"fuzz-0.8","vocal_mode":"instrumental","prompt":"Soft piano with gentle percussion."}'
```

#### Python

```python
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())
```

#### Node.js

```javascript
const response = await fetch("https://runapi.ai/api/v1/producer/text_to_music", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.RUNAPI_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"model":"fuzz-0.8","vocal_mode":"instrumental","prompt":"Soft piano with gentle percussion."})
});
console.log(await response.json());
```

#### Go

```go
package main

import (
    "io"
    "net/http"
    "os"
    "strings"
)

func main() {
    payload := strings.NewReader("{\"model\":\"fuzz-0.8\",\"vocal_mode\":\"instrumental\",\"prompt\":\"Soft piano with gentle percussion.\"}")
    request, err := http.NewRequest("POST", "https://runapi.ai/api/v1/producer/text_to_music", payload)
    if err != nil { panic(err) }
    request.Header.Set("Authorization", "Bearer "+os.Getenv("RUNAPI_API_KEY"))
    request.Header.Set("Content-Type", "application/json")
    response, err := http.DefaultClient.Do(request)
    if err != nil { panic(err) }
    defer response.Body.Close()
    io.Copy(os.Stdout, response.Body)
}
```

#### Response

```json
{
  "id": "tsk_example",
  "status": "processing"
}
```


## Four Steps to Your First Generation

**How it works**

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.


### Explore

## More AI APIs

- [Video API](https://runapi.ai/models?modality=video) - Generate, edit, and upscale video with 80 models [Learn more](https://runapi.ai/models?modality=video)
- [Image API](https://runapi.ai/models?modality=image) - Create and transform images with 49 models [Learn more](https://runapi.ai/models?modality=image)
- [Audio API](https://runapi.ai/models?modality=audio_music) - Create speech and sound with 31 models [Learn more](https://runapi.ai/models?modality=audio_music)
- [LLM API](https://runapi.ai/models?modality=text) - Chat completions with 66 language models [Learn more](https://runapi.ai/models?modality=text)



## 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.

- [Get API Key](https://runapi.ai/login)
- [Read the Docs](https://runapi.ai/docs/guides)


---

## More from RunAPI

- [Home](https://runapi.ai/.md)
### Product
- [Model Catalog](https://runapi.ai/models.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Providers](https://runapi.ai/models#all-models)
### Developers
- [Documentation](https://runapi.ai/docs/guides)
- [SDKs](https://runapi.ai/sdk.md)
- [CLI](https://runapi.ai/cli.md)
- [MCP Server](https://runapi.ai/mcp.md)
### Guides
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Cursor API Setup](https://runapi.ai/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/openrouter-alternative.md)
### Company
- [Enterprise](https://runapi.ai/contact.md)
- [Contact](https://runapi.ai/contact.md)
### Legal
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  }
]
```
