Ableton Live Extensions and External APIs: HTTP, Keys, Errors
Published Nov 20, 2026 · guide
Call web services from an Ableton Live Extension: HTTP with timeouts, API keys in the storage directory, and failure handling that leaves the Set intact.
What the runtime gives you to work with
Extensions built with Ableton's Extensions SDK run on Node.js, with the full Node APIs, including fs and networking. In practice an extension can call a web API, download a file or talk to a local server the same way any Node script can. You don't need a bridge or a helper app.
Three constraints shape how you design that connection:
- One run per invocation. The user right-clicks a clip, track or clip slot and picks your command. The extension runs once and stops. Nothing keeps running in the background, so you can't poll a service or hold a socket open between clicks.
- Project data, not audio. Extensions read and edit tracks, clips, MIDI notes, devices, parameters and tempo. They don't stream real-time audio or MIDI. A service can return notes, names or settings for the Set, but it can't sit in the signal path. That remains Max for Live territory.
- A per-extension storage directory. Each extension gets its own directory for config and credentials. That is where an API key belongs.
The runtime needs Node.js v24 LTS or later on macOS or Windows. Users need Live 12 Suite, beta 12.4.5 or later, from the Ableton beta program.
Making the HTTP call
A networked command usually runs in this order:
- Resolve the handle the command received, for example
context.getObjectFromHandle(handle, MidiClip). - Read what the service needs: the clip's
notes(pitch, startTime, duration, velocity, muted, probability, with times in beats) and maybecontext.application.song.tempo. - Send the request and wait for the response.
- Check the response.
- Only then write to the Set.
Keeping step 5 last is the most important design choice in this guide. More on that below.
The request itself is plain Node. Node's built-in fetch with a timeout signal is enough for most REST APIs:
async function callService(url, payload, apiKey, timeoutMs = 20000) {
const res = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`
},
body: JSON.stringify(payload),
signal: AbortSignal.timeout(timeoutMs)
});
if (!res.ok) {
const detail = await res.text().catch(() => "");
const err = new Error(`Service returned ${res.status}`);
err.status = res.status;
err.detail = detail.slice(0, 300);
throw err;
}
return res.json();
}The header format depends on the service, so check its documentation. The timeout is the part people skip. Without it, a stalled connection leaves the user looking at a frozen command. Twenty seconds suits most APIs. Generative services can need longer, so make the timeout a config value.
Remote calls take seconds, so give the user some feedback. The SDK provides progress dialogs through withinProgressDialog. Wrap the request in one so the user can see the command is still working. The exact signature is in the TypeDoc API reference, and our walkthrough of progress dialogs and modal web views covers the patterns.
Keeping credentials in the storage directory
Each extension has its own storage directory for config and credentials. How your code gets that directory's path isn't covered here. Look it up in the SDK documentation rather than guessing a location on disk. Once you have the path, reading and writing is ordinary fs:
import { readFile, writeFile, mkdir } from "node:fs/promises";
import path from "node:path";
async function loadConfig(storageDir) {
try {
const raw = await readFile(path.join(storageDir, "config.json"), "utf8");
return JSON.parse(raw);
} catch (e) {
if (e.code === "ENOENT") return {};
throw e;
}
}
async function saveConfig(storageDir, config) {
await mkdir(storageDir, { recursive: true });
await writeFile(path.join(storageDir, "config.json"), JSON.stringify(config, null, 2));
}Rules for keys
- Never bundle a key.
extensions-cli packageturns your project into a.ablxarchive that anyone can download and unzip. A key in the entry file or inmanifest.jsonis effectively public. - Ask on first run. If the config has no key, open a modal web view with
showModalDialogand ask for one. Save it to the storage directory, then continue with the original command. - Make the key replaceable. Register a second command, such as "Set API key…", on the same context-menu scope. Users rotate keys, and a rejected key (see below) should send them straight there.
- Keep secrets out of logs and error messages. In the snippet above, the error keeps a short excerpt of the response body and never includes the request headers.
Say in your README exactly where the key is stored and what is sent to the service. Users read that before trusting a networked extension. Our safety checklist lists the questions they will ask.
Failure handling that leaves the Set alone
Network calls fail in ordinary ways: Wi-Fi drops in the middle of a gig, a key expires, a rate limit kicks in, a model returns garbage. None of these should leave the Set half-edited. Fetch everything first, check it, then write to the Set in one pass.
| Failure | How it shows up | What the extension should do |
|---|---|---|
| No connection | fetch throws before a response arrives | Say the service couldn't be reached. Don't change the Set. |
| Timeout | The abort signal fires | Report the timeout and mention the config value that controls it. |
| Key rejected | Typically HTTP 401 or 403 | Point the user to "Set API key…". Don't retry. |
| Rate limited | Typically HTTP 429 | Ask the user to wait and run the command again. |
| Server error | HTTP 5xx | Retry once at most, then report the error. |
| Malformed result | JSON parses but the data doesn't make sense | Reject the whole result. Don't write partial data. |
The status codes are conventions. Check the service's own docs for what it actually returns.
Check the result before writing
If a service returns MIDI, treat it as untrusted input. Before writing, confirm that every note has a pitch from 0 to 127, a duration above zero, a velocity in range and a start time inside the clip. Remember that times are in beats, not seconds. If a service thinks in seconds, convert using song.tempo. If anything fails the check, discard the whole response and show a message. A clean "nothing changed" is better than a clip with half its notes replaced.
Retries in a one-shot model
Because the extension stops after each run, long exponential backoff doesn't fit. The user is waiting, and the next attempt is just another right-click. One quick retry on a 5xx or a dropped connection is reasonable. After that, report the error and let the user decide.
Working with no background process
Since nothing keeps running between invocations, the storage directory is your only memory. It works well for:
- Caching. Store slow-changing data, such as a list of available models or presets, with a timestamp. Refresh it when it's stale rather than on every click.
- Last-used settings. Pre-fill the modal dialog with the previous prompt, key or style.
- Offline fallbacks. If the service is down, a cached result can sometimes still be used. Say clearly that it came from the cache.
Jobs that take minutes on the server are awkward in this model. One workable pattern is to submit the job, save its ID in the storage directory, and add a "Fetch result" command the user runs later. Whether a single invocation has a maximum run time isn't stated in the facts we have. Check the docs before relying on long waits.
Extensions already doing this
Two listings on the marketplace show what networked extensions look like from the user's side:
- the-fnk — Ableton MCP adds an "Ask Claude…" action to Session clip slots. You type an instruction in plain language and Claude generates or edits MIDI in the slot. It is MIT-licensed with source on GitHub, so you can read how it handles the request and the credentials it needs instead of guessing.
- Yoink ♡ works on audio tracks. Paste a link from YouTube, TikTok, SoundCloud or another site yt-dlp supports, trim the section on a waveform, and it lands in your Set as a WAV. It fetches remote media rather than calling a JSON API, but the same rules apply: handle bad links and dropped downloads clearly. The source is public.
For more, browse the Integrations and Generative & creative categories.
Before you publish
- Search the bundled entry file and
manifest.jsonfor anything that looks like a key. - Test with Wi-Fi off, with an invalid key and with a very short timeout. The Set should be unchanged after each test.
- Write in the README which service you call, what data leaves the machine (note pitches, tempo, clip names), and where credentials are stored.
- Set
minimumApiVersionin the manifest to the API version you actually tested against. - Run
extensions-cli package, then install the.ablxon a clean machine via Settings → Extensions, as a user would.
When it's ready, submit it to liveextensions.dev so producers can download it, rate it and leave feedback.