The Sona API.

Render music, loops, sound effects, voice and remixes, replace part of a clip, split stems, clean up audio, change a voice, voice a dialogue or score a video from your own scripts, apps and AI agents, with the same 80 models and the same tokens as the plugin. One personal key, one JSON API, an MCP server with 8 tools, an OpenAPI 3.1 document.

1. Get a key

In Sona, open Account → Developers and create a key. It starts with sona_live_ and is shown once: keep it secret, like a password.

2. Render

POST a model and a prompt. The render starts at once and its tokens are charged; a failed or cancelled render is refunded.

3. Download

Poll the render until it completes, then download its output URL right away: files live about an hour, Sona keeps no copy.

Quickstart

Base URL https://sona.audio/api/v1. Every request sends Authorization: Bearer sona_live_…. Bodies and answers are JSON.

curl
export SONA_API_KEY=sona_live_…   # Account → Developers in Sona

# 1. Pick a model
curl https://sona.audio/api/v1/models

# 2. Start a render (charged in tokens; the same Idempotency-Key is never charged twice)
curl https://sona.audio/api/v1/generations \
  -H "Authorization: Bearer $SONA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: door-creak-001" \
  -d '{"model":"elevenlabs-sfx","values":{"prompt":"heavy wooden door creaks open in a stone hall","duration":4}}'

# 3. Poll until status is "completed", then download output.url (it expires in about an hour)
curl https://sona.audio/api/v1/generations/<id> -H "Authorization: Bearer $SONA_API_KEY"
JavaScript (Node 18+)
const SONA = 'https://sona.audio/api/v1'
const headers = { authorization: `Bearer ${process.env.SONA_API_KEY}`, 'content-type': 'application/json' }

const res = await fetch(`${SONA}/generations`, {
  method: 'POST',
  headers: { ...headers, 'idempotency-key': crypto.randomUUID() },
  body: JSON.stringify({ model: 'elevenlabs-sfx', values: { prompt: 'heavy wooden door creaks open in a stone hall', duration: 4 } }),
})
if (!res.ok) throw new Error((await res.json()).error.message)
let { generation, tokens_charged } = await res.json()

while (generation.status === 'queued' || generation.status === 'processing') {
  await new Promise((r) => setTimeout(r, 3000))
  ;({ generation } = await (await fetch(`${SONA}/generations/${generation.id}`, { headers })).json())
}
if (generation.status === 'failed') throw new Error(generation.error.message) // tokens were refunded

const audio = Buffer.from(await (await fetch(generation.output.url)).arrayBuffer())
await (await import('node:fs/promises')).writeFile(`${generation.filename ?? generation.id}.${generation.output.format ?? 'wav'}`, audio)

Endpoints

  • GET /api/v1/models

    The live catalog: each model’s values (concepts) with ranges and defaults, extra controls, categories and cost in tokens. Works without a key.

  • POST /api/v1/generations

    Start a render with a model and Sona’s values. Returns the render and the tokens charged. "dry_run": true prices it without rendering.

  • GET /api/v1/generations/{id}

    Status, output URL and format, suggested file name, tokens charged and timings. A stems render also lists every part in output.files. Poll it until the render settles.

  • GET /api/v1/generations

    Your renders, newest first. limit (≤ 100), status, before (use next_before), source=api.

  • POST /api/v1/generations/{id}/cancel

    Stop a queued or processing render. Its tokens are refunded.

  • GET /api/v1/account

    Token balance, whether the account is on welcome tokens, the key in use and its limits.

A render is queued or processing, then completed (with output.url, output.format and filename) or failed (with error.message and refunded: true). Send an Idempotency-Key header with every POST /generations: a retry with the same key returns the first render and is never charged twice. Instead of model you may send category (music, remix-edit, sound-effects, voice) to use its default model, its first featured one. The old ids text-to-audio and text-to-loop (now music) and audio-to-audio (now remix-edit) are still accepted for one release.

Values

Every model speaks Sona’s values; each maps them onto its own parameters. GET /models lists the ones a model understands in concepts, with its range and default. Model-specific controls go in extras, by name.

prompt · Prompt
Text. What to hear; for songs, the style. Required unless the model works from input audio, a video or a script.
lyrics · Lyrics
Text. Sung words, for models with vocals.
duration · Duration
Seconds, within the model’s min and max.
vocals · Vocals
true or false.
loop · Loop
true for a seamless loop.
bpm · BPM
Tempo, 20 to 300.
reference_audio · Audio
Public http(s) URL of an audio file to transform.
reference_image · Image
Public http(s) URL of an image that sets the mood.
change · Change
0 to 1: how much the input audio is transformed.
negative · Avoid
Text: what to avoid.
quality · Quality
"draft", "standard" or "high".
adherence · Prompt strength
0 to 1: prompt strength. 0.5 is the model default.
seed · Lock variation
Integer for repeatable variations; omit or null for random.
region · Region
[start, end] in seconds of the input audio: the part to regenerate (Replace models).
reference_video · Video
Public http(s) URL of a video to score or add sound to.
script · Script
Dialogue text, one turn per line: "Name: what they say". Voices per name go in extras.speaker_voices.

Modules

Modules are models too: pick one by id, or by category and let the default answer. What changes is the values they need. prompt is optional for models that work from audio, a video or a script; Replace takes a region in seconds; Dialogue a script; From Video a reference_video URL. A stems render returns every part in output.files.

ModuleWhereValuesDefault model
ReplaceRemix & Edit → Replaceregionpromptreference_audiostable-audio-3-replace
ExtendRemix & Edit → Extendpromptreference_audiostable-audio-3-extend
RemixRemix & Edit → Remixpromptreference_audiostable-audio-3-remix
StemsRemix & Edit → Stemsreference_audio→ output.filesdemucs
Clean UpRemix & Edit → Clean Upreference_audiodeepfilternet3
Voice ChangeVoice → Voice Changereference_audioelevenlabs-voice-changer
DialogueVoice → Dialoguescriptelevenlabs-dialogue
From VideoMusic → From Video, Sound Effects → From Videoreference_videoprompt (optional)sonilo-video-music
SpeechVoice → Speechpromptelevenlabs-v4
Replace seconds 8 to 12
POST /api/v1/generations
{
  "model": "stable-audio-3-replace",
  "values": {
    "reference_audio": "https://example.com/take.wav",
    "region": [
      8,
      12
    ],
    "prompt": "big tom fill"
  }
}
Split into stems (no prompt)
POST /api/v1/generations
{
  "model": "demucs",
  "values": {
    "reference_audio": "https://example.com/song.mp3"
  }
}
Dialogue (one line per turn)
POST /api/v1/generations
{
  "model": "elevenlabs-dialogue",
  "values": {
    "script": "Ana: Did you hear that?\nLeo: Stay behind me."
  }
}
Music or sound for a video
POST /api/v1/generations
{
  "model": "sonilo-video-music",
  "values": {
    "reference_video": "https://example.com/clip.mp4"
  }
}

Pricing in tokens

The API spends the tokens of the account that owns the key, at the plugin’s prices: no subscription, no extra fee. New accounts start with 30 free tokens; packs start at $2 for 150 tokens and never expire. Exact cost for any request: send it with "dry_run": true.

ModelIdMakesDefault render
ACE-Stepace-stepMusic≈ 2 tokens · Light
Lyria 3lyria-3Music≈ 6 tokens · Standard
CassetteAI Musiccassette-musicMusic≈ 3 tokens · Light
Minimax Music 2.6minimax-music-2.6Music≈ 20 tokens · Standard
ElevenLabs SFXelevenlabs-sfxSound Effects≈ 2 tokens · Light
CassetteAI SFXcassette-sfxSound Effects≈ 2 tokens · Light
Stable Audio 3 Loopsstable-audio-3-loopsMusic≈ 3 tokens · Light
Stable Audio 3 Remixstable-audio-3-remixRemix & Edit≈ 4 tokens · Light
Stable Audio 3 Remix HQstable-audio-3-remix-hqRemix & Edit≈ 6 tokens · Standard
Lyria 3.5lyria-3.5Music≈ 13 tokens · Standard
ElevenLabs Music 2.5elevenlabs-music-2.5Music≈ 78 tokens · Powerful
Lyria 3 Prolyria-3-proMusic≈ 11 tokens · Standard
Sonilo Musicsonilo-musicMusic≈ 10 tokens · Standard
Minimax Music 3minimax-music-3Music≈ 8 tokens · Standard
ACE-Step Auto Lyricsace-step-promptMusic≈ 1 tokens · Light
Stable Audio 3 HQstable-audio-3-hqMusic≈ 5 tokens · Light
Mureka Instrumentalmureka-instrumentalMusic≈ 20 tokens · Standard
Mirelo SFXmirelo-sfxSound Effects≈ 10 tokens · Standard
Sonilo SFXsonilo-sfxSound Effects≈ 2 tokens · Light
Stable Audio 3 SFXstable-audio-3-sfxSound Effects≈ 3 tokens · Light
Stable Audio 3 SFX Remixstable-audio-3-sfx-remixRemix & Edit≈ 4 tokens · Light
Stable Audio 2.5stable-audio-2.5Music, Sound Effects≈ 26 tokens · Powerful
Stable Audio 3 HQ Basestable-audio-3-hq-baseMusic≈ 7 tokens · Standard
Stable Audio 3 Basestable-audio-3-baseMusic≈ 4 tokens · Light
Stable Audio 3 SFX Basestable-audio-3-sfx-baseSound Effects≈ 4 tokens · Light
Mureka Songmureka-songMusic≈ 65 tokens · Powerful
Seed Audio 1.5seed-audio-1.5Music, Sound Effects, Voice≈ 59 tokens · Powerful
Stable Audio 2.5 Remixstable-audio-2.5-remixRemix & Edit≈ 26 tokens · Powerful
Stable Audio 3 Remix HQ Basestable-audio-3-remix-hq-baseRemix & Edit≈ 7 tokens · Standard
Stable Audio 3 Remix Basestable-audio-3-remix-baseRemix & Edit≈ 5 tokens · Light
Stable Audio 3 SFX Remix Basestable-audio-3-sfx-remix-baseRemix & Edit≈ 5 tokens · Light
Stable Audio 3 Extend HQstable-audio-3-extend-hqRemix & Edit≈ 6 tokens · Standard
Stable Audio 3 Extendstable-audio-3-extendRemix & Edit≈ 4 tokens · Light
Stable Audio 3 SFX Extendstable-audio-3-sfx-extendRemix & Edit≈ 4 tokens · Light
Stable Audio 3 Extend HQ Basestable-audio-3-extend-hq-baseRemix & Edit≈ 8 tokens · Standard
Stable Audio 3 Extend Basestable-audio-3-extend-baseRemix & Edit≈ 5 tokens · Light
Stable Audio 3 SFX Extend Basestable-audio-3-sfx-extend-baseRemix & Edit≈ 5 tokens · Light
ACE-Step Extendace-step-extendRemix & Edit≈ 7 tokens · Standard
ElevenLabs v4elevenlabs-v4Voice≈ 4 tokens · Light
ElevenLabs v4 Turboelevenlabs-v4-turboVoice≈ 2 tokens · Light
Gemini 3.8 Flash TTSgemini-3.8-flash-ttsVoice≈ 2 tokens · Light
Gemini 3.8 Flash Lite TTSgemini-3.8-flash-lite-ttsVoice≈ 2 tokens · Light
Seed TTS 3seed-tts-3Voice≈ 1 tokens · Light
ChatterboxchatterboxVoice≈ 1 tokens · Light
Chatterbox Multilingualchatterbox-multilingualVoice≈ 1 tokens · Light
Chatterbox HDchatterbox-hdVoice≈ 2 tokens · Light
HeyGen Voiceheygen-voiceVoice≈ 2 tokens · Light
HeyGen Voice Turboheygen-voice-turboVoice≈ 1 tokens · Light
Qwen3 TTSqwen3-ttsVoice≈ 4 tokens · Light
Qwen3 TTS Miniqwen3-tts-miniVoice≈ 3 tokens · Light
Orpheus TTSorpheus-ttsVoice≈ 2 tokens · Light
Inworld TTSinworld-ttsVoice≈ 1 tokens · Light
Grok TTSgrok-ttsVoice≈ 1 tokens · Light
Kling TTSkling-ttsVoice≈ 1 tokens · Light
Mureka Speechmureka-speechVoice≈ 22 tokens · Standard
IndexTTS 2index-tts-2Voice≈ 32 tokens · Powerful
Stable Audio 3 Replacestable-audio-3-replaceRemix & Edit≈ 4 tokens · Light
Stable Audio 3 Replace HQstable-audio-3-replace-hqRemix & Edit≈ 6 tokens · Standard
Stable Audio 3 SFX Replacestable-audio-3-sfx-replaceRemix & Edit≈ 4 tokens · Light
Stable Audio 3 Replace Basestable-audio-3-replace-baseRemix & Edit≈ 5 tokens · Light
Stable Audio 3 Replace HQ Basestable-audio-3-replace-hq-baseRemix & Edit≈ 7 tokens · Standard
Stable Audio 3 SFX Replace Basestable-audio-3-sfx-replace-baseRemix & Edit≈ 5 tokens · Light
Stable Audio 2.5 Replacestable-audio-2.5-replaceRemix & Edit≈ 26 tokens · Powerful
ACE-Step Replaceace-step-replaceRemix & Edit≈ 7 tokens · Standard
Demucs StemsdemucsRemix & Edit≈ 22 tokens · Standard
Seed Audio Stemsseed-audio-1.5-stemsRemix & Edit≈ 26 tokens · Powerful
DeepFilterNet 3deepfilternet3Remix & Edit≈ 32 tokens · Powerful
ElevenLabs Voice Isolatorelevenlabs-isolationRemix & Edit≈ 52 tokens · Powerful
VEED Clean Audioveed-clean-audioRemix & Edit≈ 7 tokens · Standard
ElevenLabs Voice Changerelevenlabs-voice-changerVoice≈ 78 tokens · Powerful
Chatterbox Voice Changechatterbox-voice-changeVoice≈ 4 tokens · Light
Chatterbox HD Voice Changechatterbox-hd-voice-changeVoice≈ 6 tokens · Standard
ElevenLabs Dialogueelevenlabs-dialogueVoice≈ 4 tokens · Light
VibeVoicevibevoiceVoice≈ 11 tokens · Standard
VibeVoice 7Bvibevoice-7bVoice≈ 11 tokens · Standard
VibeVoice Minivibevoice-miniVoice≈ 6 tokens · Standard
Sonilo Video to Musicsonilo-video-musicMusic≈ 18 tokens · Standard
Sonilo Video to SFXsonilo-video-sfxSound Effects≈ 141 tokens · Ultra
Mirelo Video to SFXmirelo-video-sfxSound Effects≈ 10 tokens · Standard
Kling Video to Audiokling-video-audioSound Effects≈ 5 tokens · Light

Rate limits

  • 120 GET requests per minute per key.
  • 20 POST requests (renders, cancels) per minute per key.
  • 4 renders in flight per key.
  • 10 keys per account.
  • Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a 429 adds Retry-After.

Keys and safety

  • A key can spend its account’s tokens. Keep it on your server or in your agent’s secrets, never in a web page.
  • Sona stores only a hash of each key. Revoke a key in Account → Developers and its next request gets 401.
  • The API is server-to-server: browsers are not allowed to call it (no CORS), except /api/v1/openapi.json.
  • Output URLs are temporary: download each file as soon as its render completes.

Errors

Every error has the same shape: {"error": {"code", "message", "status", "request_id"}}. Branch on code; show message to people.

StatusCodeMeaning
401missing_api_keyNo Authorization: Bearer sona_live_… header.
401invalid_api_keyThe key is unknown or was revoked.
400invalid_requestThe body or a query parameter is malformed; details lists the fields.
400unknown_modelNo live model has that id. List them with GET /models.
400invalid_inputThe values do not fit the model (range, missing prompt…); errors lists them.
402insufficient_tokensThe account balance is lower than the render costs; required and balance say by how much.
404not_foundNo generation with that id on this account.
409not_cancellableThe render already completed.
429rate_limitedToo many requests for this key in the current minute. Wait Retry-After seconds.
429too_many_active_rendersThis key already has the maximum number of renders in flight. Wait for one to finish.
429trial_capacityRenders on free welcome tokens are full for today. Buy a token pack to keep going.
502provider_errorThe model failed to start. Nothing was charged (tokens are refunded).
500server_errorSomething failed on our side. Retry with the same Idempotency-Key.

Agents

AI agents can use Sona the way a person does: pick a category, describe the sound, check the cost, wait, save the file. Connect an MCP client to Sona’s MCP server, use the TypeScript SDK, or point the agent at /api/v1/openapi.json and /llms.txt. The same API key, rate limits and token prices apply everywhere.

MCP server · 8 tools

Remote MCP over Streamable HTTP at https://sona.audio/api/mcp, authenticated with your API key as Authorization: Bearer sona_live_…. Keep the key in an environment variable, never in a file you commit.

Claude Code
export SONA_API_KEY=sona_live_…
claude mcp add --transport http sona https://sona.audio/api/mcp \
  --header "Authorization: Bearer $SONA_API_KEY"
Claude Code, per project (.mcp.json)
{
  "mcpServers": {
    "sona": {
      "type": "http",
      "url": "https://sona.audio/api/mcp",
      "headers": {
        "Authorization": "Bearer ${SONA_API_KEY}"
      }
    }
  }
}
Claude Desktop (claude_desktop_config.json)
{
  "mcpServers": {
    "sona": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://sona.audio/api/mcp",
        "--header",
        "Authorization:${SONA_AUTH}"
      ],
      "env": {
        "SONA_AUTH": "Bearer sona_live_…"
      }
    }
  }
}
Cursor (~/.cursor/mcp.json)
{
  "mcpServers": {
    "sona": {
      "url": "https://sona.audio/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SONA_API_KEY}"
      }
    }
  }
}
Any MCP client
Transport: Streamable HTTP (stateless, JSON responses)
URL:       https://sona.audio/api/mcp
Header:    Authorization: Bearer sona_live_…
Protocol:  2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05
Example prompt
Use the Sona tools to make the sounds for this scene: a creaking wooden door, footsteps on gravel, and a 30-second calm ambient music bed. Pick the right category for each, write specific prompts, tell me the total cost in tokens before rendering, then wait for each render and download every file into ./audio using its suggested filename.
  • list_models

    Lists the live audio models you can render with: id, name, description, categories, the values each understands (concepts, with type, range and default), extra controls and cost in tokens.

  • get_model

    One model in full: the values it understands (concepts: type, min, max, default, required), its extra controls and its cost (cost.tokens_default for a default render, cost.per and cost.tokens_per_unit when the price scales with duration). Read it before setting values a model may not support.

  • estimate_cost

    Prices a render without rendering or charging: returns tokens, the account balance and affordable. Takes exactly what generate_audio takes. Costs are in Sona tokens, charged from the account that owns the API key when a render starts; a failed or cancelled render is refunded. Use it before a batch and tell the user the total before spending.

  • generate_audio

    Starts rendering a sound effect, loop, song, voice or remix and returns at once with the generation id and tokens_charged. Then call wait_for_generation with the id.

  • get_generation

    One render: status (queued, processing, completed, failed), output.url and output.format when completed, filename (a suggested file name without extension), tokens charged and error.message when failed (failed renders are refunded). Output URLs expire about 1 hour after the render started and Sona keeps no copy: download the file as soon as the render completes.

  • wait_for_generation

    Waits server-side (up to 50 s, timeout_seconds) until the render completes or fails, then returns it like get_generation. If it is still running when the wait ends, it returns the current status with done: false: call it again. Most sound effects finish in seconds; long songs can take a few minutes. Output URLs expire about 1 hour after the render started and Sona keeps no copy: download the file as soon as the render completes.

  • cancel_generation

    Stops a queued or processing render and refunds its tokens. A completed render cannot be cancelled.

  • get_balance

    The account’s Sona token balance, whether it is still on free welcome tokens (trial), and the key’s rate limits. When the balance is too low, tell the user to buy a token pack in Sona; never try to work around it.

TypeScript SDK

@sona/sdk is a tiny client with no dependencies: models.list/get, generations.create/estimate/get/list/cancel/waitFor and account.get, fully typed, with automatic retries on 429 that honour Retry-After. Renders get an idempotency key, so a retry is never charged twice.

TypeScript
import { writeFile } from 'node:fs/promises'
import { Sona } from '@sona/sdk'

const sona = new Sona({ apiKey: process.env.SONA_API_KEY })

const request = { category: 'music', values: { prompt: 'heavy wooden door creaks open in a stone hall', duration: 4 } }
const { tokens, affordable } = await sona.generations.estimate(request)
if (!affordable) throw new Error(`Needs ${tokens} tokens`)

const { generation } = await sona.generations.create(request)
const done = await sona.generations.waitFor(generation.id) // throws if it fails (tokens refunded)
const audio = await (await fetch(done.output!.url)).arrayBuffer() // the URL expires in ~1 hour
await writeFile(`${done.filename ?? done.id}.${done.output!.format ?? 'wav'}`, Buffer.from(audio))

Agent skill and steps

Give your agent /agents/sona-skill.md: a short skill file on choosing a category, writing prompts, checking cost, waiting and downloading. Without MCP, a good agent follows these steps:

  1. Read the OpenAPI document at /api/v1/openapi.json, or GET /api/v1/models for the live catalog: each model lists the values it understands (concepts), their ranges and its cost in tokens.
  2. Ask the user for a Sona API key (Sona → Account → Developers) and send it as Authorization: Bearer sona_live_…. Never print or store the key in logs or files you share.
  3. Before a batch, GET /api/v1/account for the token balance, and price a request with "dry_run": true on POST /api/v1/generations. Tell the user what a batch will cost before spending.
  4. Start renders with POST /api/v1/generations and a unique Idempotency-Key per intended render, so a retry after a timeout never charges twice.
  5. Poll GET /api/v1/generations/{id} every 3 to 5 seconds until status is completed or failed. Download output.url right away: it expires about an hour after the render started. Name the file with filename when present.
  6. Respect 429s: wait Retry-After seconds. Keep at most a few renders in flight per key. On insufficient_tokens, stop and tell the user to buy a pack in Sona.

One sentence away.

Windows 10 or later, 64-bit macOS 10.14 or later, Apple Silicon and Intel