# CassetteAI Music Generator API

> CassetteAI Music Generator creates instrumental music from a text prompt as 44.1 kHz stereo audio, from 10 seconds to 3 minutes long. A 30-second sample is ready in about 2 seconds.

Source: https://www.sandbase.ai/models/cassetteai/music-generator
API reference: https://www.sandbase.ai/models/cassetteai/music-generator#api

## Facts

- Provider: CassetteAI
- Type: Audio model
- Model ID: `cassetteai/music-generator`
- Price: From $0.01 per run
- Capabilities: text to music
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "cassetteai/music-generator",
  "prompt": "Smooth chill hip-hop beat with mellow piano melodies, deep bass, and soft drums, perfect for a night drive. Key: D Minor, Tempo: 90 BPM.",
  "duration": 30
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call CassetteAI Music Generator through SandBase?

Create a SandBase API key, then send requests with the model ID "cassetteai/music-generator" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate CassetteAI account?

No. One SandBase API key and balance gives you access to CassetteAI Music Generator and the other models in the catalog; you do not need to sign up with CassetteAI separately.

## README

### CassetteAI Music Generator

CassetteAI Music Generator creates 44.1 kHz stereo music from a prompt, 10 seconds to 3 minutes long, in seconds.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `prompt` | string, required | — | Music description. |
| `duration` | integer 10–180 | 30 | Length in seconds; sets the price. |

#### Billing

$0.02 per minute of generated music, prorated by `duration`.

| Length | Price |
|---|---|
| 30 s (default) | $0.01 |
| 1 min | $0.02 |
| 3 min | $0.06 |

Failed runs are not charged.

#### Prompting

- Name genre, instruments, mood, key and tempo (BPM).

#### Also on SandBase

Related: `cassetteai/sound-effects-generator`.
