How to download a Google AI Studio app as a ZIP or to GitHub
If you built an app in Google AI Studio's Build mode, its code belongs to you, and AI Studio has two ways to get it out: download it as a ZIP file, or connect it to a GitHub repository. This guide covers both, and what you need to run the code somewhere else.
This is about apps made in Build mode. If you want to save a chat instead, see how to export Google AI Studio conversations.
#Download the app as a ZIP
- Open your app in AI Studio's Build mode.
- At the top of the preview pane, next to Preview, click the Code button (it shows as
<>). The pane switches to a file explorer and the code. - Click Export at the top right of the pane.
- Choose Download as .zip file.
- Extract the ZIP and open the folder in your code editor.
The file explorer in step 2 is also a quick way to check you have the version you want before downloading. What you get is an ordinary web project: an app built in Build mode typically has a package.json, an index.html, a src folder and a vite.config.ts. Its package.json lists the commands to install and run it; for a Vite project like this that is usually npm install and then npm run dev.
The ZIP is a snapshot. Changes you make in AI Studio afterwards are not in it, so download again, or use GitHub (below) if you will keep working in both places.
#Connect the app to GitHub
GitHub is the better route if you want to keep editing the app in AI Studio and in your own editor.
- In your app, open Settings (the gear at the top right of AI Studio), then the GitHub tab.
- Create a new repository from the app, or link an existing one.
According to Google's documentation, the connection works both ways:
- Push: changes you make by prompting in AI Studio can be pushed to the repository, with commit messages written for you.
- Pull: changes made outside AI Studio, in your own editor or from a teammate's pull request, can be pulled back in.
- Conflicts: if the same file changed in both places, a Resolve conflicts dialog shows the two versions side by side and you pick which to keep, file by file.
The same tab shows the sync status. AI Studio has no real-time collaborative editing, so a shared GitHub repository is also how Google suggests working on an app with someone else.
#Bring code into AI Studio
The other direction works too. In Build mode, open the Add files menu (the + icon in the prompt box) and choose Import from GitHub.
#Running the code outside AI Studio
The app calls the Gemini API from its server-side code, so it needs an API key wherever it runs. Google's documentation says to set it as the GEMINI_API_KEY environment variable in your hosting environment, and that the key is kept on the server rather than included in the code that reaches users' browsers.
If you would rather not host it yourself, AI Studio can deploy the app to Google Cloud Run, which gives it a public address. Two things to know before you do:
- Every user's Gemini requests use your API key.
- Cloud Run pricing may apply depending on use, and so may the cost of paid models.
Apps that use the microphone, camera or similar features declare those permissions in the project's metadata.json file.
#Questions
#Is my API key inside the ZIP?
Google's documentation says keys are kept server-side and not included in client code. When you run the app somewhere else, you provide the key yourself through GEMINI_API_KEY.
#Can I download an app and keep editing it in AI Studio?
Yes, but the ZIP will not follow your later changes. Use the GitHub connection if you want both copies to stay in step.
#Can I download a chat the same way?
No. Chats have no download button in AI Studio. AI Studio Exporter is a free, open source Chrome extension that exports a chat to Markdown, JSON or text, with its attachments. It does not export Build mode apps: for those, use the ZIP or GitHub as above.
#Where is Google's own documentation?
Build apps in Google AI Studio on Google's developer site. The download steps above were checked in AI Studio on 23 October 2026; the screens can change, so check there if a button has moved.