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.
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"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/modelsThe 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/generationsStart a render with a model and Sona’s values. Returns the render and the tokens charged.
"dry_run": trueprices 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/generationsYour renders, newest first.
limit(≤ 100),status,before(usenext_before),source=api.POST /api/v1/generations/{id}/cancelStop a queued or processing render. Its tokens are refunded.
GET /api/v1/accountToken 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.
| Module | Where | Values | Default model |
|---|---|---|---|
| Replace | Remix & Edit → Replace | regionpromptreference_audio | stable-audio-3-replace |
| Extend | Remix & Edit → Extend | promptreference_audio | stable-audio-3-extend |
| Remix | Remix & Edit → Remix | promptreference_audio | stable-audio-3-remix |
| Stems | Remix & Edit → Stems | reference_audio→ output.files | demucs |
| Clean Up | Remix & Edit → Clean Up | reference_audio | deepfilternet3 |
| Voice Change | Voice → Voice Change | reference_audio | elevenlabs-voice-changer |
| Dialogue | Voice → Dialogue | script | elevenlabs-dialogue |
| From Video | Music → From Video, Sound Effects → From Video | reference_videoprompt (optional) | sonilo-video-music |
| Speech | Voice → Speech | prompt | elevenlabs-v4 |
POST /api/v1/generations
{
"model": "stable-audio-3-replace",
"values": {
"reference_audio": "https://example.com/take.wav",
"region": [
8,
12
],
"prompt": "big tom fill"
}
}POST /api/v1/generations
{
"model": "demucs",
"values": {
"reference_audio": "https://example.com/song.mp3"
}
}POST /api/v1/generations
{
"model": "elevenlabs-dialogue",
"values": {
"script": "Ana: Did you hear that?\nLeo: Stay behind me."
}
}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.
| Model | Id | Makes | Default render |
|---|---|---|---|
| ACE-Step | ace-step | Music | ≈ 2 tokens · Light |
| Lyria 3 | lyria-3 | Music | ≈ 6 tokens · Standard |
| CassetteAI Music | cassette-music | Music | ≈ 3 tokens · Light |
| Minimax Music 2.6 | minimax-music-2.6 | Music | ≈ 20 tokens · Standard |
| ElevenLabs SFX | elevenlabs-sfx | Sound Effects | ≈ 2 tokens · Light |
| CassetteAI SFX | cassette-sfx | Sound Effects | ≈ 2 tokens · Light |
| Stable Audio 3 Loops | stable-audio-3-loops | Music | ≈ 3 tokens · Light |
| Stable Audio 3 Remix | stable-audio-3-remix | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 3 Remix HQ | stable-audio-3-remix-hq | Remix & Edit | ≈ 6 tokens · Standard |
| Lyria 3.5 | lyria-3.5 | Music | ≈ 13 tokens · Standard |
| ElevenLabs Music 2.5 | elevenlabs-music-2.5 | Music | ≈ 78 tokens · Powerful |
| Lyria 3 Pro | lyria-3-pro | Music | ≈ 11 tokens · Standard |
| Sonilo Music | sonilo-music | Music | ≈ 10 tokens · Standard |
| Minimax Music 3 | minimax-music-3 | Music | ≈ 8 tokens · Standard |
| ACE-Step Auto Lyrics | ace-step-prompt | Music | ≈ 1 tokens · Light |
| Stable Audio 3 HQ | stable-audio-3-hq | Music | ≈ 5 tokens · Light |
| Mureka Instrumental | mureka-instrumental | Music | ≈ 20 tokens · Standard |
| Mirelo SFX | mirelo-sfx | Sound Effects | ≈ 10 tokens · Standard |
| Sonilo SFX | sonilo-sfx | Sound Effects | ≈ 2 tokens · Light |
| Stable Audio 3 SFX | stable-audio-3-sfx | Sound Effects | ≈ 3 tokens · Light |
| Stable Audio 3 SFX Remix | stable-audio-3-sfx-remix | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 2.5 | stable-audio-2.5 | Music, Sound Effects | ≈ 26 tokens · Powerful |
| Stable Audio 3 HQ Base | stable-audio-3-hq-base | Music | ≈ 7 tokens · Standard |
| Stable Audio 3 Base | stable-audio-3-base | Music | ≈ 4 tokens · Light |
| Stable Audio 3 SFX Base | stable-audio-3-sfx-base | Sound Effects | ≈ 4 tokens · Light |
| Mureka Song | mureka-song | Music | ≈ 65 tokens · Powerful |
| Seed Audio 1.5 | seed-audio-1.5 | Music, Sound Effects, Voice | ≈ 59 tokens · Powerful |
| Stable Audio 2.5 Remix | stable-audio-2.5-remix | Remix & Edit | ≈ 26 tokens · Powerful |
| Stable Audio 3 Remix HQ Base | stable-audio-3-remix-hq-base | Remix & Edit | ≈ 7 tokens · Standard |
| Stable Audio 3 Remix Base | stable-audio-3-remix-base | Remix & Edit | ≈ 5 tokens · Light |
| Stable Audio 3 SFX Remix Base | stable-audio-3-sfx-remix-base | Remix & Edit | ≈ 5 tokens · Light |
| Stable Audio 3 Extend HQ | stable-audio-3-extend-hq | Remix & Edit | ≈ 6 tokens · Standard |
| Stable Audio 3 Extend | stable-audio-3-extend | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 3 SFX Extend | stable-audio-3-sfx-extend | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 3 Extend HQ Base | stable-audio-3-extend-hq-base | Remix & Edit | ≈ 8 tokens · Standard |
| Stable Audio 3 Extend Base | stable-audio-3-extend-base | Remix & Edit | ≈ 5 tokens · Light |
| Stable Audio 3 SFX Extend Base | stable-audio-3-sfx-extend-base | Remix & Edit | ≈ 5 tokens · Light |
| ACE-Step Extend | ace-step-extend | Remix & Edit | ≈ 7 tokens · Standard |
| ElevenLabs v4 | elevenlabs-v4 | Voice | ≈ 4 tokens · Light |
| ElevenLabs v4 Turbo | elevenlabs-v4-turbo | Voice | ≈ 2 tokens · Light |
| Gemini 3.8 Flash TTS | gemini-3.8-flash-tts | Voice | ≈ 2 tokens · Light |
| Gemini 3.8 Flash Lite TTS | gemini-3.8-flash-lite-tts | Voice | ≈ 2 tokens · Light |
| Seed TTS 3 | seed-tts-3 | Voice | ≈ 1 tokens · Light |
| Chatterbox | chatterbox | Voice | ≈ 1 tokens · Light |
| Chatterbox Multilingual | chatterbox-multilingual | Voice | ≈ 1 tokens · Light |
| Chatterbox HD | chatterbox-hd | Voice | ≈ 2 tokens · Light |
| HeyGen Voice | heygen-voice | Voice | ≈ 2 tokens · Light |
| HeyGen Voice Turbo | heygen-voice-turbo | Voice | ≈ 1 tokens · Light |
| Qwen3 TTS | qwen3-tts | Voice | ≈ 4 tokens · Light |
| Qwen3 TTS Mini | qwen3-tts-mini | Voice | ≈ 3 tokens · Light |
| Orpheus TTS | orpheus-tts | Voice | ≈ 2 tokens · Light |
| Inworld TTS | inworld-tts | Voice | ≈ 1 tokens · Light |
| Grok TTS | grok-tts | Voice | ≈ 1 tokens · Light |
| Kling TTS | kling-tts | Voice | ≈ 1 tokens · Light |
| Mureka Speech | mureka-speech | Voice | ≈ 22 tokens · Standard |
| IndexTTS 2 | index-tts-2 | Voice | ≈ 32 tokens · Powerful |
| Stable Audio 3 Replace | stable-audio-3-replace | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 3 Replace HQ | stable-audio-3-replace-hq | Remix & Edit | ≈ 6 tokens · Standard |
| Stable Audio 3 SFX Replace | stable-audio-3-sfx-replace | Remix & Edit | ≈ 4 tokens · Light |
| Stable Audio 3 Replace Base | stable-audio-3-replace-base | Remix & Edit | ≈ 5 tokens · Light |
| Stable Audio 3 Replace HQ Base | stable-audio-3-replace-hq-base | Remix & Edit | ≈ 7 tokens · Standard |
| Stable Audio 3 SFX Replace Base | stable-audio-3-sfx-replace-base | Remix & Edit | ≈ 5 tokens · Light |
| Stable Audio 2.5 Replace | stable-audio-2.5-replace | Remix & Edit | ≈ 26 tokens · Powerful |
| ACE-Step Replace | ace-step-replace | Remix & Edit | ≈ 7 tokens · Standard |
| Demucs Stems | demucs | Remix & Edit | ≈ 22 tokens · Standard |
| Seed Audio Stems | seed-audio-1.5-stems | Remix & Edit | ≈ 26 tokens · Powerful |
| DeepFilterNet 3 | deepfilternet3 | Remix & Edit | ≈ 32 tokens · Powerful |
| ElevenLabs Voice Isolator | elevenlabs-isolation | Remix & Edit | ≈ 52 tokens · Powerful |
| VEED Clean Audio | veed-clean-audio | Remix & Edit | ≈ 7 tokens · Standard |
| ElevenLabs Voice Changer | elevenlabs-voice-changer | Voice | ≈ 78 tokens · Powerful |
| Chatterbox Voice Change | chatterbox-voice-change | Voice | ≈ 4 tokens · Light |
| Chatterbox HD Voice Change | chatterbox-hd-voice-change | Voice | ≈ 6 tokens · Standard |
| ElevenLabs Dialogue | elevenlabs-dialogue | Voice | ≈ 4 tokens · Light |
| VibeVoice | vibevoice | Voice | ≈ 11 tokens · Standard |
| VibeVoice 7B | vibevoice-7b | Voice | ≈ 11 tokens · Standard |
| VibeVoice Mini | vibevoice-mini | Voice | ≈ 6 tokens · Standard |
| Sonilo Video to Music | sonilo-video-music | Music | ≈ 18 tokens · Standard |
| Sonilo Video to SFX | sonilo-video-sfx | Sound Effects | ≈ 141 tokens · Ultra |
| Mirelo Video to SFX | mirelo-video-sfx | Sound Effects | ≈ 10 tokens · Standard |
| Kling Video to Audio | kling-video-audio | Sound 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-RemainingandX-RateLimit-Reset; a 429 addsRetry-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.
| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No Authorization: Bearer sona_live_… header. |
| 401 | invalid_api_key | The key is unknown or was revoked. |
| 400 | invalid_request | The body or a query parameter is malformed; details lists the fields. |
| 400 | unknown_model | No live model has that id. List them with GET /models. |
| 400 | invalid_input | The values do not fit the model (range, missing prompt…); errors lists them. |
| 402 | insufficient_tokens | The account balance is lower than the render costs; required and balance say by how much. |
| 404 | not_found | No generation with that id on this account. |
| 409 | not_cancellable | The render already completed. |
| 429 | rate_limited | Too many requests for this key in the current minute. Wait Retry-After seconds. |
| 429 | too_many_active_renders | This key already has the maximum number of renders in flight. Wait for one to finish. |
| 429 | trial_capacity | Renders on free welcome tokens are full for today. Buy a token pack to keep going. |
| 502 | provider_error | The model failed to start. Nothing was charged (tokens are refunded). |
| 500 | server_error | Something 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.
export SONA_API_KEY=sona_live_…
claude mcp add --transport http sona https://sona.audio/api/mcp \
--header "Authorization: Bearer $SONA_API_KEY"{
"mcpServers": {
"sona": {
"type": "http",
"url": "https://sona.audio/api/mcp",
"headers": {
"Authorization": "Bearer ${SONA_API_KEY}"
}
}
}
}{
"mcpServers": {
"sona": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://sona.audio/api/mcp",
"--header",
"Authorization:${SONA_AUTH}"
],
"env": {
"SONA_AUTH": "Bearer sona_live_…"
}
}
}
}{
"mcpServers": {
"sona": {
"url": "https://sona.audio/api/mcp",
"headers": {
"Authorization": "Bearer ${env:SONA_API_KEY}"
}
}
}
}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-05Use 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_modelsLists 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_modelOne model in full: the values it understands (
concepts: type, min, max, default, required), its extra controls and its cost (cost.tokens_defaultfor a default render,cost.perandcost.tokens_per_unitwhen the price scales with duration). Read it before setting values a model may not support.estimate_costPrices a render without rendering or charging: returns
tokens, the accountbalanceandaffordable. 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_audioStarts rendering a sound effect, loop, song, voice or remix and returns at once with the generation
idandtokens_charged. Then call wait_for_generation with the id.get_generationOne render:
status(queued, processing, completed, failed),output.urlandoutput.formatwhen completed,filename(a suggested file name without extension), tokens charged anderror.messagewhen 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_generationWaits 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 withdone: 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_generationStops a queued or processing render and refunds its tokens. A completed render cannot be cancelled.
get_balanceThe 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.
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:
- 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. - 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. - Before a batch, GET /api/v1/account for the token balance, and price a request with
"dry_run": trueon POST /api/v1/generations. Tell the user what a batch will cost before spending. - Start renders with POST /api/v1/generations and a unique
Idempotency-Keyper intended render, so a retry after a timeout never charges twice. - Poll GET /api/v1/generations/{id} every 3 to 5 seconds until
statusiscompletedorfailed. Downloadoutput.urlright away: it expires about an hour after the render started. Name the file withfilenamewhen present. - Respect 429s: wait
Retry-Afterseconds. Keep at most a few renders in flight per key. Oninsufficient_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