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:

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:

  1. Resolve the handle the command received, for example context.getObjectFromHandle(handle, MidiClip).
  2. Read what the service needs: the clip's notes (pitch, startTime, duration, velocity, muted, probability, with times in beats) and maybe context.application.song.tempo.
  3. Send the request and wait for the response.
  4. Check the response.
  5. 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

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.

FailureHow it shows upWhat the extension should do
No connectionfetch throws before a response arrivesSay the service couldn't be reached. Don't change the Set.
TimeoutThe abort signal firesReport the timeout and mention the config value that controls it.
Key rejectedTypically HTTP 401 or 403Point the user to "Set API key…". Don't retry.
Rate limitedTypically HTTP 429Ask the user to wait and run the command again.
Server errorHTTP 5xxRetry once at most, then report the error.
Malformed resultJSON parses but the data doesn't make senseReject 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:

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:

For more, browse the Integrations and Generative & creative categories.

Before you publish

When it's ready, submit it to liveextensions.dev so producers can download it, rate it and leave feedback.

Browse all extensions → · Submit yours →