AI music API
Published November 2026
One HTTP API for music your code controls: send notes, or direct a band generator, and every part comes back played on its own stem.
A free account has 120 credits a month. The catalog, a quote and the OpenAPI document need no key.
One request, one job
Make a key at Settings → API keys and send it as X-API-Key (or Authorization: Bearer):
export DOO_API_KEY=dsk_live_...
Every job is one POST with a kind and its input. This one plays three notes on a cello:
curl -s -X POST https://api.doseedo.com/api/jobs \
-H "X-API-Key: $DOO_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cello-phrase-v1' \
-d '{
"kind": "render_midi",
"input": {
"instrument": "cello",
"bpm": 72,
"notes": [
{ "pitch": 48, "start_beats": 0, "duration_beats": 2 },
{ "pitch": 55, "start_beats": 2, "duration_beats": 2 },
{ "pitch": 52, "start_beats": 4, "duration_beats": 4 }
]
}
}'
The reply is the job, "status": "queued", with an estimate of its credits and its time. Long-poll it until it finishes:
curl -s "https://api.doseedo.com/api/jobs/$JOB_ID?wait=50" -H "X-API-Key: $DOO_API_KEY"
The finished job, trimmed to its shape. This is the reply to the call above, run on November 16, 2026: queued to finished in 15 seconds, for 10 credits.
{
"object": "job",
"kind": "render_midi",
"status": "succeeded",
"output": {
"duration": 8.67,
"seed": 2141978659,
"takes": [
{ "url": "https://api.doseedo.com/api/files/…/take1.wav", "rank": 1, "score": 0.6223 },
{ "url": "https://api.doseedo.com/api/files/…/take2.wav", "rank": 2, "score": 0.5845 },
{ "url": "https://api.doseedo.com/api/files/…/take3.wav", "rank": 3, "score": 0.559 }
]
},
"artifacts": [
{ "name": "files_0", "type": "audio", "url": "…/take1.wav", "expires_at": "2026-11-17T21:00:00.000Z" }
]
}
Result links are pre-signed: download them with a plain GET and no header. They last 24 hours, and a result link is accepted as the audio_url of a later job.
The same call in Python and JavaScript
There is nothing to install: it is JSON over HTTPS. In Python, with requests:
import os, requests
API = "https://api.doseedo.com"
H = {"X-API-Key": os.environ["DOO_API_KEY"]}
def run(kind, input, key=None):
"""Submit a job and long-poll it to the end. Returns the finished job."""
r = requests.post(f"{API}/api/jobs", json={"kind": kind, "input": input},
headers={**H, **({"Idempotency-Key": key} if key else {})})
job = r.json()
if r.status_code >= 400:
raise SystemExit(job["error"])
while job["status"] in ("queued", "running"):
job = requests.get(f"{API}/api/jobs/{job['id']}", headers=H, params={"wait": 50}).json()
if job["status"] != "succeeded":
raise SystemExit(job["error"])
return job
job = run("render_midi", {
"instrument": "cello",
"bpm": 72,
"notes": [
{"pitch": 48, "start_beats": 0, "duration_beats": 2},
{"pitch": 55, "start_beats": 2, "duration_beats": 2},
{"pitch": 52, "start_beats": 4, "duration_beats": 4},
],
}, key="cello-phrase-v1")
best = job["output"]["takes"][0]["url"] # takes are ranked, best first
open("cello.wav", "wb").write(requests.get(best).content)
In JavaScript, with the fetch built into Node 18 and later:
const API = "https://api.doseedo.com";
const H = { "X-API-Key": process.env.DOO_API_KEY, "Content-Type": "application/json" };
async function run(kind, input, key) {
const r = await fetch(`${API}/api/jobs`, {
method: "POST",
headers: key ? { ...H, "Idempotency-Key": key } : H,
body: JSON.stringify({ kind, input }),
});
let job = await r.json();
if (!r.ok) throw new Error(job.error.message);
while (job.status === "queued" || job.status === "running") {
job = await (await fetch(`${API}/api/jobs/${job.id}?wait=50`, { headers: H })).json();
}
if (job.status !== "succeeded") throw new Error(job.error.message);
return job;
}
const job = await run("render_midi", {
"instrument": "cello",
"bpm": 72,
"notes": [
{ "pitch": 48, "start_beats": 0, "duration_beats": 2 },
{ "pitch": 55, "start_beats": 2, "duration_beats": 2 },
{ "pitch": 52, "start_beats": 4, "duration_beats": 4 }
]
}, "cello-phrase-v1");
console.log(job.output.takes[0].url); // takes are ranked, best first
Call the API from your server, not from a web page on another site: the key is a secret, and the API does not answer browsers on other origins.
What your code controls
- The notes. Each one is a pitch, a start and a length in beats, and a velocity. Up to 4,096 notes a part and 600 seconds a render; or send a Standard MIDI File or a MusicXML score. The notes are played as given.
- The player. One of 100+ AI instruments by id, a preset of its sound, a recording whose tone it should copy, or an instrument you trained from your own recording.
- Time. A tempo or a tempo map, the time signature and the key.
- Takes. Ask for one to four takes of a part in one call, at no extra credits. They come back ranked, best first, and a
seedcomes back with them. - One region. Re-render a span of beats inside a take you already have, and the rest of the take is kept.
- A band instead of notes. Name a band generator and give it a length in bars or seconds, a key and a seed, and it writes every part in its genre. Then direct it in seconds: how loud the band is at each moment, the moments it lands together, and who rests where. The notes it wrote can be read back, free, before anything is rendered.
- The parts, kept apart. Every part is its own render and its own file, so your code can mute, swap, re-balance or re-render one without touching the rest.
A band generator, by id. This one writes a town theme for a game, sixteen bars that are written to loop:
curl -s -X POST https://api.doseedo.com/api/jobs \
-H "X-API-Key: $DOO_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: town-theme-v1' \
-d '{
"kind": "render_score",
"input": {
"bpm": 96,
"generator": { "id": "game_town", "bars": 16, "seed": 7 }
}
}'
Run on November 16, 2026: it wrote six parts (flute, harp, pizzicato violins, violas and cellos, and basses), every part passed its check against its notes, and the six stems and a mix came back 77 seconds after the submit, for 20 credits. GET https://api.doseedo.com/api/generate/generators lists the generators, with no key. One more job mixes a piece as a loop, with every part as a layer: the game page plays one.
The jobs
| kind | In | Out | From | Usually takes |
|---|---|---|---|---|
render_midi | One part: notes or a MIDI file, and an instrument | That part played, as ranked takes | 10 credits per 30 s | 45 s to 3 min |
render_score | A whole score: parts, a file, or a band generator | Every part as its own stem, and a mix | 10 credits per 30 s for each group of up to six parts | 60 s to 6 min |
generate_loop | A drum generator, bars, tempo, a seed | A drum loop that repeats seamlessly, and its MIDI | 10 credits per 30 s | 3 to 20 s |
generate_sound | A description | A sound effect, foley or an ambience | 10 credits per 30 s | 15 to 60 s |
mix | Stems, or the id of a render | A mixed and mastered WAV, and what was done | No credits | 15 s to 2 min |
separate_stems | A mixed recording | Its stems, and each stem's notes as MIDI | 20 credits | 60 s to 4 min |
transcribe | A recording of one instrument | Its notes as MIDI | No credits | 10 to 60 s |
spot_video | A video | A cue sheet: cuts, scenes, dialogue, cues with timecodes | No credits | 20 s to 10 min |
score_to_picture | A video and mixed cues | The scored video, a printmaster and an M&E | No credits | 15 s to 5 min |
There are 29 kinds in all, among them covers, custom instruments, DAW sessions and DAW project conversion. GET https://api.doseedo.com/api/jobs/kinds returns each with its input schema, its price and its typical time, and the OpenAPI document describes the whole surface. Neither needs a key.
Built for a pipeline
- Exactly once. Send an
Idempotency-Keyand a retried submit returns the same job instead of a second render. The same key with a different body is refused (409). - Long-poll.
GET /api/jobs/{id}?wait=50holds for up to 50 seconds and answers the moment the job changes. - Events.
GET /api/jobs/{id}/eventsstreams each state change as Server-Sent Events. - Webhooks. Pass
"webhook": {"url": "https://…"}on the submit and the finished job is POSTed to you, signed the Standard Webhooks way (webhook-id,webhook-timestamp,webhook-signature: v1,…, HMAC-SHA256 with thewhsec_secret the submit returned). - A price first.
POST /api/jobs/quotewith the same body returns the estimate and how it was counted, with no key and no spend. - Cancel.
POST /api/jobs/{id}/cancel. A render that has not started is stopped and refunded. - Errors that say what to do. One envelope:
type,code,message,retryableand, for a bad field,paramwith a suggestion. Out of credits is a 429 withtype: "insufficient_credits"and is not retryable; a rate limit is a 429 withretryable: trueand aRetry-After.
What people build on it
- MIDI to audio. A notation app, a composing model or a game tool that writes notes and needs them played.
- A soundtrack for a video. A video tool that watches a cut, renders music for its cues and lays the mix back on the picture.
- Stem separation. A practice app, a remix tool or a transcription service that needs a mix taken apart.
- Music for a game. A theme that loops with no join, exactly its bars long, and every part as its own layer to fade in and out.
What it costs
One credit pool pays for every job. A free account has 120 credits a month; Pro is $12 a month with 2,000, plus one-time extra usage (500 credits for $5). The quote endpoint prices a call before you make it, a refused call spends nothing, and a failed job is refunded.
On a free account a render of several parts comes back as its mix: each part as its own stem comes with Pro. A one-part render, a separation and every analysis job are the same on every plan.
Limits
- Jobs are asynchronous. Nothing streams audio as it is made: a short part takes seconds, a score of many parts a minute or more.
- Server to server. Call the API from your server, not from a web page on another site: the key is a secret, and the API does not answer browsers on other origins.
- A performance, not a playback. The instrument models are trained on real recordings, and a take can miss or change a note. That is why takes come back ranked, and why a part of a score comes back with a check of whether it played its notes.
- No client library to install. The API is plain JSON over HTTPS, and the samples on these pages are complete.
- Twenty jobs at a time on one account, by default.
The same jobs for an AI agent, and from a terminal
Every job here is also a tool on a hosted MCP server, https://api.doseedo.com/mcp, so an assistant such as Claude or ChatGPT can call them with no code of yours: see the MCP server. And npm install -g @doseedo/cli puts the same jobs in a terminal as doo.
An AI music API
AI music API, music generation API, music API for developers and AI instrument API name the same thing here: one HTTP API where your code sends notes, or directs a band generator, and gets every part back played as audio.
Start with one call
Make a key, send three notes, and hear them played. A free account has 120 credits a month.
Get an API key →FAQ
Is there an AI music API with a free tier?
Yes. A free Doseedo account has 120 credits a month, the same pool the website uses; a 30-second render of one part is 10 credits. The job catalog, a quote and the OpenAPI document need no key.
Does it generate music from a text prompt?
It can make a short sketch from a prompt, but that is not what the API is for. Its point is control: you send the notes, or direct a band generator by genre, length, key and seed, and each part is played and returned on its own.
Do I get stems?
Yes. Every part is rendered on its own and returned as its own file. On a free account a render of several parts comes back as its mix; each part as its own stem comes with Pro.
Is it real time?
No. Every job is asynchronous: you submit, then long-poll, stream events or wait for a webhook. A short part takes seconds and a score of many parts a minute or more.
Can I use the audio commercially?
You own what you make, to the extent the law allows, on every plan including the free one (Terms §6.3).
Is there an SDK?
There is no client library to install: it is JSON over HTTPS, with an OpenAPI 3.1 document to generate a client from. The same jobs are also MCP tools for an AI agent, and a command-line tool on npm.
The music API · music your code controls
- MIDI to audio APIyour notes, played
- Video soundtrack APIspot, render, lay on the picture
- Stem separation APIa mix in, stems and MIDI out
- Game music generatorseamless loops, in layers
- The MCP serverthe same jobs for an AI agent
- Every toolthe reference
- Planscredits a month