How to Deploy a Google AI Studio Website for Free
There are two free ways to deploy a Google AI Studio app, depending on whether it calls Gemini. An app that calls Gemini needs a server to hold your API key, and one that reads Google Workspace data or runs multiplayer needs its server too, so publish it from AI Studio to Cloud Run, which eligible accounts can do on Google Cloud's no-cost Starter Tier for up to two apps. An app that runs entirely in the browser skips Cloud Run: export the code or sync it to GitHub, run npm run build and upload the build folder to a static host such as Statpio, where it goes live on a free address with a contact form and visitor statistics.
Disclosure: this guide is published by Statpio, one of the tools compared. We link every competitor fact to its official source. Google's features below were checked in the AI Studio and Google Cloud documentation on 9 November 2026.
What does Google AI Studio build, and does it need a server?
AI Studio's Build mode makes web apps in two parts: "a web frontend (React is the default)" and "a Node.js runtime that allows for secure API calls, database connections, and npm package usage" (Build apps in Google AI Studio). For an app that uses Gemini, AI Studio stores your GEMINI_API_KEY as a server-side secret, and API keys "are never included in client-side code". Apps built before 14 May 2026 are moved to that server-side approach the next time you change their Gemini features.
So the server decides where the app can live:
| Your app | Needs its server? | Where it can run |
|---|---|---|
| Calls Gemini: chat, image generation, summaries | Yes: the API key stays on the server | AI Studio's Publish (Cloud Run), or another host that runs Node.js with GEMINI_API_KEY set |
| Reads Gmail, Sheets, Calendar or other Workspace data | Yes: AI Studio "generates the server-side code to call the API" | Cloud Run |
| Multiplayer or live collaboration | Yes: "The server manages the state" | Cloud Run |
| Runs entirely in the browser, with no Gemini calls: a website, a landing page, a calculator | No | Any static host, Statpio included |
Source: Google AI Studio Build mode and full-stack apps documentation, as of November 2026.
How do I publish from AI Studio to Cloud Run for free?
AI Studio's own Publish button puts the whole app, server included, on "a managed, scalable Cloud Run service with a shareable URL" (Publish your app in Google AI Studio). As of November 2026 there are two ways to use it:
- The Starter Tier "lets eligible accounts publish up to 2 full-stack apps without setting up a Google Cloud project or billing account" (Deploy from Google AI Studio). Google calls it "a no-cost, Google-managed project"; if a service reaches its no-cost quota, "usage pauses until the quota resets or you upgrade your project" (Starter Tier overview). Click Publish, then Get started, Continue, Continue with free URL and Publish your app; the app gets a free
ai.studioaddress. - A paid Google Cloud project "requires a Google Cloud project linked to your AI Studio account with Cloud Billing enabled". It's the route for more than two apps, higher quotas and custom domains.
If the Publish option won't go through on the free route, check eligibility: Google Workspace accounts, accounts with "an active or prior paid Google Cloud billing account" accounts without enough activity history and accounts outside a supported territory don't qualify, and AI Studio's support team "can't override Starter Tier eligibility". Google's answer then is to attach a billing account. With two apps already on the Starter Tier, unpublish one or upgrade to a paid project first.
Two more things to know before you choose Cloud Run. The published app "will use your API key for all users' Gemini API calls", so your visitors' use counts toward your quota. And custom domains need a paid project. From AI Studio's Publish panel you can, as of November 2026, connect only a domain bought through AI Studio, from $12.00 a year plus Cloud DNS fees ("Only domains purchased in Google AI Studio within the same Google Cloud project appear under Use a domain I own", with other registrars planned for later: Custom domains in Google AI Studio); a domain you already own elsewhere can be mapped to the app's Cloud Run service in the Google Cloud console instead, which takes more setup. For an app that calls Gemini, Cloud Run is still the right home: Statpio and other static hosts can't run its server.
Can I deploy an AI Studio app without Cloud Run?
Yes, in two cases:
- The app runs entirely in the browser. Its build is plain HTML, CSS and JavaScript that any static host serves, with no Cloud Run, no billing account and no API key.
- You run the server somewhere else. Google says you can download the app and host it elsewhere if you "set the
GEMINI_API_KEYenvironment variable in your hosting environment". That has to be a host that runs Node.js server code, not a static host.
What you shouldn't do is make a Gemini app "work" on a static host by moving the key into the browser code. Google's rule is "Never expose keys client-side in production": "Keys compiled in client-side code can be extracted by users" (Using Gemini API keys). In a Vite project, any variable prefixed VITE_ is "exposed in client-side source code after Vite bundling" (Vite), so anyone could copy the key and spend your quota.
Not sure which kind of app you have? Search the app's own files for @google/genai, Google's JavaScript SDK (older apps may use @google/generative-ai): if they import it, the app calls Gemini. You can also ask the agent in Build mode: "Does this app call the Gemini API or need server-side code at runtime? If not, make it a client-only React app that builds to static files." And build the static copy without your Gemini key set anywhere in the project, such as in a .env or .env.local file, so it can't end up in the files you upload.
How do I export the code from Google AI Studio?
- Download a ZIP: Google's docs say to "Export the generated code as a ZIP file and import it into your code editor".
- Sync to GitHub: in Settings, open the GitHub tab "to create a new GitHub repository from your app or link to an existing one". You can then push changes from AI Studio "with AI-generated commit messages" and pull edits made elsewhere back in.
The GitHub route is worth it if you'll keep editing in AI Studio: connect the same repository to your host and every change goes live without a manual upload.
How do I host the static build on Statpio?
- Unzip the download or clone the repository, then run
npm installandnpm run buildin the project folder. - Find the folder the build wrote, with an
index.htmlinside: in a Vite project it'sdist/. Try the pages and buttons once with a local preview (npm run previewin a Vite project) to check that nothing still depends on the server. - Create a free Statpio account, verify your email, click New website and give it a name. It gets an address such as
my-app.onstatpio.com, with HTTPS. - Select everything inside the build folder and ZIP it, so
index.htmlis at the top. Open Deployments and drop the ZIP on Drop your website ZIP here. From a terminal,npx statpio deploy ./dist --key <website API key>does the same, with a key from the website's Integrations → API Keys tab. - If the app has routes such as
/about, check Settings → General → SPA Mode. Statpio turns it on when a deploy looks like a single-page app, and it servesindex.htmlfor those routes so they don't 404 on refresh.
On Solo Pro and up you can deploy from GitHub instead: open Integrations → GitHub Actions, install the Statpio GitHub App, pick the repository AI Studio syncs to and its branch, keep Build Command as npm run build and set Output Directory to the build folder. Statpio commits a GitHub Actions workflow, so each change AI Studio pushes is built and goes live. The publish your website guide shows each screen, and our guide to deploying a React or Vite app for free covers the build in more depth. Built with Lovable, Bolt or v0 instead? See how to deploy a Bolt, v0 or older Lovable site on your own domain.
How do I add a contact form and visitor statistics?
Statpio captures plain HTML forms on every plan, including forms React draws after the page loads. A form is captured when it uses method="POST" with no action, gives every field a name, and has no onSubmit handler, preventDefault() or fetch() of its own. Ask the agent in AI Studio before you export: "Change the contact form to a plain HTML form with method="POST" and no action attribute. Remove the onSubmit handler and any fetch or preventDefault code. Give every input a name attribute. Keep the design."
Statpio adds a visible Cloudflare Turnstile check and a hidden honeypot itself, and messages arrive under Forms & Leads, with browser notifications for new ones. Free Forever includes 250 submissions per website a month and Solo Pro 10,000. Test on the live address: capture happens on Statpio's servers, so a copy running on your computer records nothing.
Visitor statistics need nothing at all. A small cookieless script on every page shows visitors, sources, pages, countries and devices on every plan, and route changes in a single-page app count as pageviews; Solo Pro adds campaigns, goals and funnels. Check whether the rules where you and your visitors are require consent, since the script keeps a visit ID in sessionStorage.
How do I use my own domain?
On Statpio, a domain from any registrar works with Solo Pro ($9/month, 5 domains included). On the website's Custom Domains page, type the domain and click Connect Domain, then create the two CNAME records it shows at your registrar: www pointing to cname.onstatpio.com, and _acme-challenge.www pointing to the validation value from the dashboard. SSL is issued automatically, and the bare domain is served through www, so forward it there at your registrar. On Free Forever, the site keeps its free onstatpio.com address.
Can I deploy an AI Studio app to Vercel or GitHub Pages instead?
- GitHub Pages is "a static site hosting service" (GitHub docs), so the same rule applies: only a build that runs in the browser. It's free for public repositories on GitHub Free, but GitHub says it is "not intended for or allowed to be used as a free web-hosting service to run your online business" (GitHub Pages limits).
- Vercel runs back-end code as Vercel Functions. It deploys some Node.js servers, such as Express, "with zero configuration", though there "express.static() will be ignored and will not serve static assets" (Express on Vercel), and for a plain Vite project its docs suggest adding Nitro "to add a comprehensive backend" (Vite on Vercel). So an AI Studio server may need changes to run there, and AI Studio's publishing docs cover Cloud Run only. Vercel's free Hobby plan "is for personal, non-commercial use" (Vercel pricing).
Ready to put it online?
If your AI Studio app builds to a folder with an index.html and doesn't use its server, start free on Statpio: upload the ZIP, test the routes and the form on your free address, and add your domain when you're ready. If it uses its server, for Gemini calls or anything else, publish it from AI Studio to Cloud Run.
Frequently asked questions
Can I deploy a Google AI Studio app for free?
Yes, in two ways. AI Studio's Publish button puts the app on Cloud Run, and Google's Starter Tier lets eligible accounts publish up to two full-stack apps without a billing account, as of November 2026. An app that runs entirely in the browser (no Gemini calls, Workspace data, multiplayer or other server code) can also be built and uploaded to a static host: Statpio's Free Forever plan hosts 1 website on a free onstatpio.com address, with form capture and visitor statistics.
How do I export code from Google AI Studio?
Export the generated code as a ZIP file from Build mode, or open Settings, then the GitHub tab, to create a new GitHub repository from your app or link an existing one. With GitHub, you push changes from AI Studio with AI-generated commit messages, and a host connected to that repository can deploy every push.
Can I deploy a Google AI Studio app without Cloud Run?
Yes, if the app runs entirely in the browser: run npm run build and upload the build folder to any static host. An app that calls Gemini needs its server, which holds your GEMINI_API_KEY. Google says a downloaded app can run elsewhere if that environment variable is set on the host, which means a host that runs Node.js server code.
Can I put my Gemini API key in the front-end code?
No. Google's API key guide says never to expose keys client-side in production, because keys compiled into client-side code can be extracted by users. In a Vite project, any VITE_ variable ends up in the public JavaScript. Keep Gemini calls on a server, such as the Cloud Run service AI Studio publishes.
Can I use my own domain with a Google AI Studio app?
On AI Studio's own hosting, custom domains need a paid Google Cloud project. As of November 2026, AI Studio's Publish panel connects only domains bought through AI Studio; a domain from another registrar has to be mapped to the app's Cloud Run service in the Google Cloud console. If you host the static build on Statpio, a domain from any registrar works with Solo Pro at $9/month, using two CNAME records.
Keep reading
Related articles
Deploy a React or Vite App for Free, With a Domain and Form
How to deploy a hand-built React or Vite app for free: build it, upload the dist folder or deploy from the command line or GitHub, stop 404s on refresh, connect your own domain and add a contact form that needs no backend.
Read nextHow to Publish a Claude Artifact as a Real Website
Claude shares an artifact as a link to a page Anthropic hosts. To put it on a website of your own, export the HTML or let Claude publish it through the Statpio connector, then add a form that works and visitor statistics.
Read nextHow to Build a Website with Claude, ChatGPT or Cursor
Connect Statpio to your AI assistant once, then describe your business: it builds the site, uses your own photos and publishes it with a contact form.
Read next
Deploy an Older Lovable, Bolt or v0 Site on Your Own Domain
Built with Bolt.new, v0, Cursor or Claude, or a Lovable project made before 13 May 2026? Find out what kind of app you have, build it, upload it and connect your own domain.
Read next