Bring‑your‑own‑key playground with open CORS

The playground is a bring‑your‑own‑key interface that leverages the open CORS policy of the Gemini API.


Simon Willison announced a “bring‑your‑own‑key” playground that leverages the open CORS policy of the Gemini API, letting users run text‑to‑speech (TTS) directly from their browser without a backend server.

What the playground does, in plain terms

A typical web app that talks to an external AI service needs a server‑side component to keep the API key secret. That server receives the request from the browser, adds the key, forwards it to the AI service, and then returns the result. The new Gemini playground sidesteps that step. Because the Gemini API’s Cross‑Origin Resource Sharing (CORS) settings are open, a browser can send a request straight to the API, provided it includes a valid API key. The playground is simply a web page that asks you to paste your Gemini key, then lets you type or upload text and hear the generated speech instantly.

In practice, you open the page, paste the key you received when you signed up for Gemini, type the sentence you want spoken, hit “run,” and the browser contacts the Gemini endpoint, receives the audio payload, and plays it back. No server code, no hidden proxy, no extra configuration.

Who can actually use it and why it matters

The tool is for anyone who already possesses a Gemini API key and wants to experiment with TTS without writing any code or setting up a server. If you have a key, you can start testing voice output immediately, which is useful for quick demos, prototyping voice‑enabled features, or simply hearing how a particular prompt sounds. For developers, it removes the friction of building a temporary backend just to try out the service. For non‑developers who already hold a key—perhaps because they manage a product that uses Gemini—it offers a low‑effort way to explore the capabilities.

If you do not have a Gemini API key, the playground cannot be used, because the key is required to authenticate each request. The interface does not provide a way to obtain a key, nor does it hide the key from the browser; you must manage the secret yourself.

Availability

The playground is shipping now; it is not a concept under discussion. You can open the page in any modern browser and start using it immediately, assuming you have a valid key.

I vibe coded this bring-your-own-key playground interface with GPT-6 Astra, taking advantage of the open CORS policy of the underlying Gemini API.

Limits you should be aware of

  • Key management – Because the key lives in the browser, it is exposed to anyone who can view the page’s source or network traffic. This is fine for personal experimentation but may be unsuitable for production or shared environments.
  • Cost transparency – The announcement does not disclose how much using the Gemini API for TTS will cost, so you need to check Gemini’s pricing separately.
  • Reliance on open CORS – The playground works only because the Gemini API currently allows cross‑origin requests. If Google changes that policy, the browser‑only approach would stop working until the playground is updated.
  • Feature scope – The interface is focused on TTS; it does not expose other Gemini capabilities such as text generation or image creation.

In short, the bring‑your‑own‑key playground offers a straightforward, instantly usable way to try Gemini’s text‑to‑speech service from a browser, provided you already have an API key and are comfortable handling that key in a client‑side context.

productsautomationdeveloper