Karaoke for Sats API guide

Use the API to get a quote for one or more audio tracks, hand payment to the requester, and retrieve separated instrumentals and vocals. Lyric editing and karaoke video export happen in the browser.

1. Read the pricing

GET /pricing returns the current base_fee_sats and sats_per_minute. These are rates, not a quote. Ask the requester before uploading their files, and use the returned total_sats as the price for that order.

2. Upload a batch and get a quote

POST /upload accepts multipart/form-data. Add one part named files per track (MP3, FLAC, WAV, or M4A). For untrusted uploaded content, send an Idempotency-Key that your client generates locally: at least 32 random characters, unique per intended order. Do not use a filename, content hash, predictable ID, or key supplied by an untrusted source. Save the key and file list before making the request.

Example for a POSIX shell with OpenSSL and curl. Run the first line once per intended order and save its value. Replace the filenames, then repeat only the curl command with the saved key for any permitted retry.

UPLOAD_KEY=$(openssl rand -hex 32)

curl --request POST https://karaoke.rafaltyl.com/upload \
  --header "Idempotency-Key: $UPLOAD_KEY" \
  --form "files=@track-one.mp3" \
  --form "files=@track-two.flac"

The response includes order_id, order_url, total_sats, lightning_invoice, mint_url, and items (each with job_id, filename, duration_sec, and amount_sats).

3. Hand payment to the requester

Prefer opening the returned order_url in the requester’s browser so they can review the quote and choose Lightning or Cashu. If you are an agent, hand the link only to the requester in a private channel. Order, creator, and download URLs grant access to private results; do not publish them, put them in shared logs, or send them to third-party services. Cashu payment and change tokens are bearer money. Never ask the requester to paste them into a chat or include them in logs.

If the Lightning invoice is paid out of band, POST /orders/{order_id}/verify-payment checks settlement and queues the files when payment is confirmed. Use one payment flow for an order: do not race this request with browser verification, Cashu, or another payment method. POST /orders/{order_id}/pay-cashu exists for clients that handle Cashu directly, but human payment in the browser is preferred. The order’s trusted_mints lists supported token issuers; mint_url identifies the Lightning invoice issuer. Tokens from other mints are rejected without being spent. After an explicit unsupported-mint rejection, the requester can use the same Lightning invoice instead.

If a payment attempt has an ambiguous outcome, do not retry it as a fresh payment, switch methods, or pay a second order to work around it. A payment response of 409 or 503 may indicate a conflict or an attempt that needs reconciliation. Continue reading the original order with GET /orders/{order_id}; automatic recovery is not guaranteed.

4. Check status and download results

Poll GET /orders/{order_id} every few seconds with backoff if needed. It returns order_status, order_url, and jobs. The order can be paid while jobs are still queued or processing. Treat a job as finished when it is done, expired, or has an error: … status. Keep the response private: it may include a Cashu change_token.

Use the returned URLs, resolving relative URLs against the service origin. Download audio promptly: results normally expire after about seven days and may be removed earlier if the storage quota is reached.

5. Make a karaoke video in the browser

Open the creator, enter lyrics, and time the lines manually, or optionally look up synced lyrics on LRCLIB and check the timings against the recording. LRCLIB receives your search terms, not your audio. Only export lyrics you have permission to use.

Editing, preview, and MP4 export are free after separation. The video uses the instrumental soundtrack. You can download your project to keep the lyrics and timing; save the audio separately before it expires.