{"slug": "my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists", "title": "My music API refused 145 songs for naming an artist. A third of those artists were ordinary words", "summary": "A developer running a multilingual AI song generator found that a third-party music API's artist-name filter rejected 145 of roughly 4,500 generations, and that many of the flagged \"artist names\" were ordinary words in other languages — Slovak and Czech \"rytmus\" (rhythm), Italian \"melodico\" (melodic) and Spanish \"latino\" among them. The developer traced the false positives to the filter stripping accents and transliterating Cyrillic to ASCII before matching against its name list, and recommends replacing known false positives in user text before submission.", "body_md": "I run a small AI song generator. People describe a song, or paste their own lyrics plus a style line (\"acoustic guitar, warm female vocals\"), and a third-party music generation API turns that into a track. Most of my users don't write in English: the biggest groups are Ukrainian, Slovak, Polish and Czech, and the site runs in 24 languages.\n\nThe API has one rule that shows up in my error logs again and again: no artist names. You can ask for \"80s synth pop\", not for a song \"like\" a named band. Fair enough. The trouble is what the filter thinks an artist name is.\n\nLast week a quality check flagged six paid generations in four days that had failed with an artist-name refusal. Five of them were the same word: **rytmus**. In Slovak and Czech that just means *rhythm*. One user wrote \"acoustic guitar, rytmus\", got refused three times in a row, then changed it to \"rhythm\" and got the song. Another wrote \"a slower rhythm, strong bass, r&b\" in Slovak, was refused twice, and never generated again.\n\nSo I went back through every refusal in the database.\n\nFrom May 2024 to mid-November 2026 the site sent about 4,500 generations. 145 came back refused for an artist name.\n\n| Period | Generations | Refused for artist name | \n|---|---|---|\n| May–Sep 2024 | 3,644 | 138 (3.8 %) | \n| Oct 2024–Nov 2025 | 259 | 0 | \n| Dec 2025–Nov 2026 | 637 | 7 (1.1 %) | \n\nThe quiet middle period had little traffic, so I won't read much into the zero. The 2024 refusals were mostly on the free-text song description (112), the rest on the style tags (26). All 7 recent ones were on the style tags.\n\nThen I read the 145 names the filter reported, and sorted them by hand.\n\nThese are words that the filter reported as an artist name, with what they mean in the language the user wrote in:\n\n| Reported \"artist\" | Language | Meaning | Times | \n|---|---|---|---|\n| melodico | Italian | melodic | 9 | \n| latino | Spanish | Latin (as in Latin pop) | 6 | \n| rytmus | Slovak / Czech | rhythm | 5 | \n| pesado | Portuguese | heavy | 3 | \n| wiatr | Polish | wind | 2 | \n| epica | Portuguese (épica) | epic | 2 | \n| sin miedo | Spanish | without fear | 2 | \n| bebe | Portuguese (bebê) | baby | 2 | \n| salvador | Portuguese | saviour (in a hymn) | 2 | \n| gato | Portuguese | cat | 1 | \n| letto | Italian | bed | 1 | \n| catedral | Portuguese | cathedral | 1 | \n| havasi | Turkish (havası) | tune, air | 1 | \n| devochka | Russian (девочка) | little girl | 1 | \n| nhac thieu nhi | Vietnamese (nhạc thiếu nhi) | children's music | 1 | \n| tage | German | days | 1 | \n| trunks | English | an elephant's trunks, in a zoo song | 1 | \n\nPlus a handful of single cases like *roadtrip*, *menor* (minor), *rico* (rich), *libera* (sets free), *vedo* (I see), *levante* (rise).\n\nMost of these are genre and mood words, which is exactly what the API asks you to write instead of artist names. \"Pop rock melodico italiano\" is a textbook style description. It was refused nine times.\n\nLook at the right-hand spelling in the table. The user wrote *épica*, *bebê*, *Havası*, *девочка*, *Nhạc thiếu nhi*. The refusal reported *epica*, *bebe*, *havasi*, *devochka*, *nhac thieu nhi*.\n\nSo the filter strips accents (Vietnamese tone marks included) and transliterates Cyrillic into plain Latin letters, and only then compares against its list of names. That is why it catches so much outside English: once every word is folded to ASCII, a lot of common words in other languages land on a band or a stage name somewhere. A Russian rap prompt that mentioned a well-known American rapper in the genitive case came back as *rossa*: folded and transliterated, inflection included.\n\nTwo practical consequences for anyone sending user text to a filtered API:\n\nThree small things, in order of how often they help.\n\n**1. Replace known false positives before submitting.** A short, explicit list, only words that have actually been refused. It is applied to the style line in the generate route:\n\n``` js\nconst FALSE_ARTIST_WORDS: Record<string, string> = {\n  rytmus: \"rhythm\", // sk/cs; 5 refusals in Nov 2026\n};\n\nconst escapeRe = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n// \\b doesn't know č or š, so use Unicode letter boundaries\nconst wordRe = (word: string) =>\n  new RegExp(`(?<![\\\\p{L}\\\\p{N}])${escapeRe(word)}(?![\\\\p{L}\\\\p{N}])`, \"giu\");\n\nexport function replaceFalseArtistWords(style: string): string {\n  let out = style;\n  for (const [word, repl] of Object.entries(FALSE_ARTIST_WORDS)) {\n    out = out.replace(wordRe(word), repl);\n  }\n  return out;\n}\n```\n\nThe `\\b` detail matters. In JavaScript, `\\b` only understands ASCII word characters, so it sees a word boundary between `č` and the next letter, and `\\brytmus\\b` can match the tail of a longer word. The lookarounds with `\\p{L}` (any letter, needs the `u` flag) fix that.\n\nThe list starts with one word on purpose. Replacing a word changes what the user asked for, so each entry has to be a confirmed refusal with an obvious English equivalent. *melodico → melodic* and *pesado → heavy* are the next candidates from the table above.\n\n**2. Retry once without the name.** The refusal arrives in the provider's async callback. The generate route now keeps the submitted parameters on the job row, so the callback can strip the reported word from the style line and resubmit:\n\n``` js\nconst artist = artistFromRefusal(refusal.msg);   // \"rytmus\", \"bon jovi\", ...\nconst style = stripArtist(req.style, artist);    // also tidies leftover commas and slashes\nif (!style || style === req.style || retries.length >= 2) return false; // fall back to fail + refund\n// resubmit with the same params and the new style; the song stays \"processing\"\n```\n\nRules I set: only for the style field in custom mode, at most two retries per song (one prompt named two bands), never when stripping leaves the style empty, and the user is not charged again. If the retry can't run, the old path applies: the song fails and the credit goes back.\n\nI deliberately do **not** retry refusals on the free-text description. Removing a word from \"a song for my wife ___ for our anniversary\" can remove the one word the song is about.\n\nAn honest gap: going through the old rows for this post showed the provider has changed the wording of this error at least twice. In 2024 it was `moderation_failure; Tags contained artist name: X` or `Song Description contained artist name: X`. Since December 2025 it is `Your tags contain artist name X - we don't reference specific artists`. My parser only knows the current one. If the wording changes again, the retry silently stops working and everything falls back to fail-and-refund. Accepting all three formats, plus an alert when a refusal arrives that the parser can't read, is the next change. The retry has also not fired in production yet, so I can't report its success rate.\n\n**3. Tell the user what happened, in their language.** Before, a refused song just showed up as failed, at best with the provider's raw English message. Now the owner sees, on the song page and in their song list, a sentence like:\n\nThe music AI doesn't accept artist names in \"Music Style Tag\" (\"rytmus\"). Describe the sound with genres and moods instead, e.g. \"pop rock, warm male vocals\".\n\nIt uses the same label as the form field in each of the 24 languages, so people know which box to edit. For the real artist requests, which are the majority, this is the fix that matters. Most of those users weren't trying to copy anyone; they used a famous name as shorthand for a sound, because that's how people describe music to each other.\n\nThe site, if you want to see the form these style lines go into: [AISong.Fun](https://aisong.fun/?utm_source=devto&utm_medium=article).", "url": "https://wpnews.pro/news/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists", "canonical_source": "https://dev.to/anders_lee_28dbcc2fd8e034/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists-were-ordinary-words-3g8g", "published_at": "2026-11-24 01:05:01+00:00", "updated_at": "2026-11-24 01:13:05.726494+00:00", "lang": "en", "topics": ["ai-tools", "generative-ai", "artificial-intelligence"], "entities": ["rytmus", "melodico", "latino"], "also_reported_by": [], "takeaway": "Accent-stripping and Cyrillic transliteration in an artist-name filter caused 145 false refusals out of ~4,500 generations, with genre words like \"melodico\" (9 times) and \"rytmus\" (5 times) flagged as artists.", "recommendation": {"advice": "Maintain an explicit list of words your API has actually refused and substitute them before submitting user text, since ASCII-folding makes common non-English words collide with artist names.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists", "markdown": "https://wpnews.pro/news/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists.md", "text": "https://wpnews.pro/news/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists.txt", "jsonld": "https://wpnews.pro/news/my-music-api-refused-145-songs-for-naming-an-artist-a-third-of-those-artists.jsonld"}}