/skills:setup-api-keyfrom Sonilo Skills
Guides users through connecting to Sonilo via CLI OAuth, remote OAuth MCP plugin, or API key. Checks existing configuration first and only runs setup when needed.
Ships in Sonilo Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Guide the user through connecting to Sonilo. There are several ways in — pick based on what the user is actually doing, not just whichever is listed first:
| Path | Needs an API key? | Best for |
|---|---|---|
A. sonilo login (CLI sign-in, credential shared with the local MCP server) | No — OAuth in the browser | Anyone on a machine with a browser. One sign-in covers the CLI and uvx sonilo-mcp, so the MCP config carries no secret. |
B. Remote OAuth MCP plugin (sonilo-claude-plugin, or this repo's Muse Code plugin) | No — OAuth sign-in | Claude Code and Muse Code users who want nothing running locally. Full tool coverage. |
C. API key (SONILO_API_KEY) | Yes | CI, containers, headless boxes, and anyone who prefers holding a key. Works with every client. |
Choosing:
Do this before changing anything — the answer is often "nothing to do".
There are two transports, and either one is enough. Probe both before concluding that nothing is set up.
sonilo MCP server connected (any Sonilo tool, e.g. text_to_music or get_account_services, available to call)? If so, call the free, read-only get_account_services().sonilo account — the same free, read-only call as above. Exit code 0 means the CLI is installed, signed in, and reaching the API, and the skills can drive it directly. Do not probe with sonilo whoami: it exits 0 even when signed out, so it cannot separate the two states, and on an account with no display name it prints an empty account: line that reads like a broken credential. It is worth running only to show which account is active, never to decide.sonilo login, the key may have expired (90 days) or been revoked — sonilo login again fixes it. Otherwise the key is wrong: continue at Path C.Never print, quote, or echo a key or the contents of the credential file. If you must refer to one, redact it.
sonilo login (no API key, any MCP host)One sign-in, then both the CLI and the local MCP server are authenticated — the
CLI writes a credential to ~/.config/sonilo/credentials.json and
sonilo-mcp (0.16.0 and later) reads it.
npm install -g sonilo-cli # or: pip install sonilo-cli
sonilo login
The CLI prints a one-time code and opens the browser to
platform.sonilo.com. The user signs in to their Sonilo Platform account
(separate from a consumer sonilo.com account), confirms the code matches what
the terminal printed, and approves. On a machine without a browser, add
--no-browser and have them approve the printed URL from another device.
Then add the MCP server with no secret in the config:
claude mcp add sonilo -- uvx sonilo-mcp # Claude Code
codex mcp add sonilo -- uvx sonilo-mcp # Codex
For Claude Desktop, the whole config is:
{
"mcpServers": {
"sonilo": { "command": "uvx", "args": ["sonilo-mcp"], "env": {} }
}
}
Both need the uv package manager (provides uvx): install it with
brew install uv (macOS), pipx install uv / pip install uv, or
winget install --id=astral-sh.uv (Windows) — other methods at
https://docs.astral.sh/uv/getting-started/installation/.
Worth telling the user up front:
cli: <hostname>, that expires after 90 days and is visible and revocable at https://platform.sonilo.com/dashboard/api-keys.sonilo whoami shows which account and source is active; sonilo logout revokes the key server-side and then forgets it locally.SONILO_API_KEY takes precedence over the sign-in. If tools authenticate as an unexpected account, check for that variable first — sonilo whoami says so explicitly when it is set.sonilo login; those users belong on Path C.Validate with get_account_services(), exactly as in Step 0.
claude
/plugin marketplace add sonilo-ai/sonilo-claude-plugin
/plugin install sonilo@sonilo
The first Sonilo tool call opens the browser to sign in to a Sonilo Platform account (platform.sonilo.com — separate from a consumer sonilo.com account) and approve access. Claude Code stores the resulting token per-user in the OS keychain; nothing to copy, paste, or configure. Review or disconnect anytime from /mcp.
This connects to a single hosted endpoint (https://api.sonilo.com/mcp, OAuth 2.1 + PKCE) that carries the same tool set as the local server (Paths A and C): music/SFX from text or video, video-to-video music/SFX, video-to-sound, video-to-video-sound, dubbing, audio ducking, and account/usage. Paths A and C are still the better fit for other MCP hosts, or for users who prefer holding and managing their own key.
Muse Code: the Sonilo skills plugin carries the same hosted server, so installing it is the whole setup:
MUSE_EXPERIMENTAL_PLUGINS=1 muse plugins marketplace add sonilo-skills https://github.com/sonilo-ai/skills
MUSE_EXPERIMENTAL_PLUGINS=1 muse plugins install skills@sonilo-skills
MUSE_EXPERIMENTAL_PLUGINS=1 muse plugins approve skills
approve activates the MCP server (Muse keeps a third-party plugin's server off until then). The first Sonilo tool call asks for the same Sonilo Platform sign-in. If a call reports that the server needs an OAuth sign-in, add "mcp_servers": {"sonilo": {"transport": "streamable_http", "url": "https://api.sonilo.com/mcp"}} to ~/.config/muse/settings.json and run muse mcp login sonilo — Muse Code 1.4.0 only logs in to servers listed there.
Only take this path when Path A does not fit — no browser, a provisioned account, CI, or an explicit preference for holding a key. Tell the user:
Get your Sonilo API key from the dashboard: https://platform.sonilo.com/dashboard/api-keys
(Need an account? Sign up there first — self-serve accounts start with a few free generation runs on most endpoints, no card required.)
Once you have a key (it looks like
sk-...), tell me and I'll connect it — don't paste it directly into this chat if you can avoid it; I'll wire it into the MCP server config instead.
Once the user has a key, connect the sonilo MCP server with it. Prefer the CLI form when the host supports it:
claude mcp add sonilo --env SONILO_API_KEY=sk-... -- uvx sonilo-mcp
For hosts without that CLI (Claude Desktop, Codex), edit the MCP config directly:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"sonilo": {
"command": "uvx",
"args": ["sonilo-mcp"],
"env": { "SONILO_API_KEY": "sk-..." }
}
}
}
Codex (~/.codex/config.toml):
[mcp_servers.sonilo]
command = "uvx"
args = ["sonilo-mcp"]
[mcp_servers.sonilo.env]
SONILO_API_KEY = "sk-..."
Both require the uv package manager (provides uvx) — if not already installed, use brew install uv, pipx install uv / pip install uv, or winget install --id=astral-sh.uv (see https://docs.astral.sh/uv/getting-started/installation/ for other methods). After editing a config file directly, tell the user to restart the host app (Claude Desktop/Codex) — a claude mcp add in Claude Code takes effect on the next session without a restart.
After connecting, call get_account_services():
get_account_services() also shows what free-trial runs remain per service.sonilo login instead, the key behind that sign-in has expired or been revoked: sonilo login again.Not every integration goes through an MCP host. If the user is writing code or scripting from a shell:
pip install sonilo # Python SDK
npm install sonilo # JS/TS SDK
pip install sonilo-cli # Python-distributed CLI
npm install -g sonilo-cli # npm-distributed CLI
Same API key as Path C — get one from https://platform.sonilo.com/dashboard/api-keys and set it as SONILO_API_KEY in the environment (both SDKs and both CLIs read it automatically; no MCP config, claude mcp add, or plugin install involved). Validate with the SDK's own account call (client.account.services() / sonilo.account.services()) or sonilo account on the CLI.
Mention these only if relevant to what the user is trying to do — they all have sane defaults:
| Variable | Default | When to mention it |
|---|---|---|
SONILO_API_URL | https://api.sonilo.com | Only for a non-default deployment. |
SONILO_MCP_BASE_PATH | ~/Desktop | Where generated files are saved by default, and the base for relative input paths. Suggest changing it if the user wants output elsewhere. |
SONILO_MCP_ALLOW_ANY_PATH | false | Set true only if the user needs to read/write files outside SONILO_MCP_BASE_PATH — explain this widens the tool's file-system access before suggesting it. |
TIME_OUT_SECONDS | 600 | The per-request timeout for streamed music, uploads and downloads. Task-based tools (SFX, sound, ducking, async music) poll for at least 45 minutes regardless, because a task can wait that long for upstream capacity. Raise it if the user hits timeouts on long streamed generations — note that get_sfx_task / get_generation_task (see task-recovery) can always recover a timed-out result regardless of this setting. |
claude mcp add path is available.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sonilo-ai/skills --plugin skills13 skills in this plugin
/accountCheck the Sonilo account's available services, rate limits, free-trial allowance, and usage/billing history. Use before calling a paid Sonilo tool to confirm it's available and whether free-trial runs remain, or when the user asks about their Sonilo usage, limits, or billing./audio-duckingDuck a music bed under a voice track using Sonilo — automatically lowers the music wherever the voice speaks and lifts it back in the gaps. Use when mixing a separately-generated or existing music track under narration, dialogue, or a video's own voice track, without manual volume automation./audio-playbackPlay a local audio file through the system's default speakers using Sonilo's MCP server. Use after generating a track with Sonilo (or for any local WAV/MP3/M4A/AAC/OGG/FLAC file) when the user wants to hear it immediately instead of just getting the saved path./auto-dubbingDub a video into one or more other languages using Sonilo, translating and re-voicing the speech into a new video per language. Optionally supply your own target-language script per language, so the dub speaks those lines verbatim instead of the pipeline's own translation, and get a re-timed SRT back per language. Use when a user needs a video localized into another language, not just subtitled. Billed per language; a self-serve account's first single-language call is a free 15-second preview — confirm language count with the user before calling./proofreadTranscribe a video with Sonilo and translate the transcript into editable .srt files — one per target language, plus the detected source language — so the wording can be read and corrected before anything is dubbed. Nothing is spoken and no video is produced; this is the step before dubbing, and the corrected files go back to the dubbing tool as subtitles so the dub speaks exactly the approved lines. Use when the user wants to review, approve or fix the translation before dubbing, wants editable subtitles or a transcript of a video, or wants the dub to say their exact wording. Billed per target language (a transcript-only run counts as one), with 2 free-trial runs on self-serve accounts — confirm the language list with the user before calling./task-recoveryRecover the result of a timed-out Sonilo generation call using its task_id. Use whenever text_to_sfx, video_to_sfx, video_to_video_music, video_to_video_sfx, video_to_sound, video_to_video_sound, audio_ducking, dubbing, proofread, analyze_video, or video_to_music(preserve_speech=true) times out or its call was interrupted — the generation already ran (and was already charged) and its result is still retrievable.Other plugins' skills for the same job