Skip to content

Custom AI BYOK Provider

Slyfti edited this page Jul 5, 2026 · 1 revision

Custom AI Provider (BYOK)

Translatify can translate lyrics with your own AI model instead of Google Translate. "BYOK" means Bring Your Own Key: you supply an OpenAI-compatible endpoint, an API key, and a model name. Translatify sends the whole song's lyrics (with the title and artist as context) to your model for a higher-quality, more natural translation.

⚠️ This feature is experimental. If anything looks off, switch the provider back to Google Translate.


Why use an LLM?

Google Translate handles one line at a time, so it can miss the meaning of lyrics that only make sense in the context of the whole song. An LLM reads all the lyrics together, so it can produce more precise, natural translations that handle idioms, metaphors, wordplay, and keep the tone consistent across verses.

Reading the whole song has a cost: LLM translation is slower and more expensive than Google Translate, since it processes all the lyrics at once for every song.

That said, an AI translation is still inferior to a professional human translation. Treat it as a good automatic result, not a definitive one.


Quick start with Google AI Studio (free)

The easiest free option is Google AI Studio (the Gemini API). It works out of the box with Translatify and has a generous free tier.

1. Get a free API key

  1. Go to aistudio.google.com/apikey.
  2. Sign in with a Google account.
  3. Click Create API key and copy it.

2. Configure Translatify

Open the extension popup and set:

Field Value
Translation Provider Custom AI (OpenAI-compatible)
API Endpoint URL https://generativelanguage.googleapis.com/v1beta/openai
API Key (paste your Google AI Studio key)
Model Name gemini-2.5-flash

Then click Test Connection. Approve the permission prompt when your browser asks for access to the endpoint. A success message means you're ready.

3. Translate

Open a song's lyrics in the Spotify web player and press the translate button. The first translation takes a few seconds while the AI processes the full song.

Tips

  • Turn Thinking Mode off for faster translations.
  • Use gemini-2.5-flash-lite if you want it even lighter/faster.
  • Free-tier limits are roughly 15 requests/minute and 1,500/day — plenty for lyrics.
  • On the free tier, Google may use your prompts to improve its models. That's fine for public song lyrics, but don't use the free tier for anything sensitive.

Settings reference

When you choose Custom AI (OpenAI-compatible), these controls appear:

  • API Endpoint URL — the base URL of your provider. Translatify automatically adds /chat/completions, so enter only the base (e.g. https://api.openai.com/v1).
  • API Key — sent as a Bearer token. Stored locally on your device.
  • Model Name — the model to use. Defaults to gpt-4o-mini if left blank.
  • Thinking Mode — on by default. Turn it off to make translations faster (loses some accuracy).
  • Instant preview — on by default. Shows a quick Google translation immediately while the AI works, then replaces it with the AI result. Turn it off to wait for the AI only.
  • Test Connection — sends a tiny request to verify your endpoint, key, and model.
  • Clear current song cache / Clear all cache — force a fresh translation if you change models or want to retry.

Other providers

Any OpenAI-compatible endpoint works. Enter the base URL (Translatify appends /chat/completions).

Provider API Endpoint URL Example model
Google AI Studio (Gemini) — "free" https://generativelanguage.googleapis.com/v1beta/openai gemini-2.5-flash
OpenAI https://api.openai.com/v1 gpt-4o-mini
OpenRouter https://openrouter.ai/api/v1 openai/gpt-4o-mini
Ollama (local) http://localhost:11434/v1 llama3.1
LM Studio (local) http://localhost:1234/v1 (name of the loaded model)

How it works

  • Translatify collects all visible lyric lines and sends them in one batch to your model, along with the song title and artist for context.
  • The model returns one translated line per input line.
  • Because it processes the whole song, the first translation is slower than Google Translate. Turning off Thinking Mode helps.
  • If the AI request fails, Translatify falls back to Google Translate and shows an error marker on the translate button.

Privacy

  • Your endpoint URL, API key, and model are stored locally in your browser (chrome.storage.local) — never sent to Translatify's developers.
  • ⚠️ If you use a paid provider, ALWAYS set a limit: YOU are responsible for the costs.
  • Translation requests go directly from your browser to the endpoint you configured.
  • Translatify only requests access to the specific endpoint you enter, and only after you approve the browser's permission prompt.

Troubleshooting

"Endpoint returned … instead of JSON" / parse errors Your endpoint URL is probably missing the API path. Make sure it includes the version segment (e.g. .../v1 for OpenAI or .../v1beta/openai for Gemini). Don't add /chat/completions yourself : Translatify adds it.

Connection failed (401 / 403) Check that the API key is correct and active, and that your account has access to the model you entered.

"access to the endpoint was not granted" The browser permission prompt was dismissed. Click Test Connection again and approve it.

Line count mismatch / occasional wrong lines The model didn't return one line per input line. Retry, clear the song cache, or try a different model.

Too slow Turn Thinking Mode off, and prefer a "flash"/"mini"/lite model.

Rate limited (429) You've hit your provider's free-tier limit. Wait a moment and try again, or change endpoint/model.

Clone this wiki locally