What an agent can do with Taoyuan
Taoyuan writes a song for one person. Hand it the user's sentence, get the title, lyrics and style first (free), then generate two full versions in about three minutes.
Birthdays, weddings, confessions, anniversaries. Lyrics only use what the user said.
Every generation returns two complete candidates with audio, lyrics and cover art.
Lyrics in Chinese, Cantonese, English or Japanese; instrumental-only works too.
Redo just the 30-second chorus; separate vocals and instrumental, or split into 12 stems.
- 1
compilefreeOne sentence → title, lyrics, style tags. Show it to the user; revise if needed.
- 2
generate1 creditSubmit the spec; get a generation id right away.
- 3
pollfreePoll until finished and read both audioUrls. Or use POST /v1/songs to do it all in one call.
Quick start
Pick your platform. Every option uses the same key: replace ty_live_… with yours.
No key yet? Create one under "API keys" below. New keys come with 3 free generations.
One line in the terminal. Then say "write a birthday song for my mom" and Claude will compile first, then generate.
claude mcp add --transport http taoyuan https://api.musicsforyou.com/mcp --header "Authorization: Bearer ty_live_..."bashTools and endpoints
MCP tool names match the OpenAPI operationIds. Full schemas are in the OpenAPI document.
| Name | Cost | Purpose | REST |
|---|---|---|---|
| compile_music_prompt | free | Sentence → spec (title, style, lyrics, duration). If status=needs_input, call again with clarificationAnswer | POST /v1/prompts/compile |
| revise_generation_prompt | free | Apply a one-line change to a spec | POST /v1/prompts/revise |
| generate_music | 1 credit | Submit spec or rendered fields; returns a generation id; two candidates | POST /v1/generations |
| create_song | 1 credit | One shot: compile + generate + wait, up to 180 s | POST /v1/songs |
| get_generation | free | Poll status; clips[].audioUrl when finished. Supports waitSeconds long-polling | GET /v1/generations/{id} |
| replace_section | 1 credit | Redo only [startS, endS]; at least 10 s, at most half the song | POST /v1/generations/{id}/replace-section |
| separate_stems | see note | Vocals/instrumental: free once per song, unlimited for members; 12 stems: Pro. No credits either way | POST /v1/tracks/{id}/stems |
| list_tracks | free | Your songs, paged | GET /v1/tracks |
| list_presets | free | Scene / genre ids | GET /v1/presets |
| get_credit_balance | free | Available credits and purchase link | GET /v1/me/credits |
Every error is { success: false, code, error }. Branch on code: NEED_TOPUP means no credits; SPEC_INVALID carries diagnostics in details.
API keys
Keys start with ty_live_ and are shown in full only once. Up to 10 per account. New keys come with 3 free generations.
Credits and purchase
API and MCP generations use prepaid credits only, never the Pro monthly allowance. 1 credit = one song (two candidates). Failed generations are refunded.
Rules
Per key: 5 generations or section replacements per minute; 30 compiles or revisions per hour. Over the limit you get 429; retry a little later.
Do not submit lyrics or works you do not have rights to. Prohibited content is screened and rejected without charge.
Songs generated through the API may be used commercially by the key owner.
Questions or suggestions: [email protected]. We reply.