Build apps in Google AI Studio

This page describes how to use Google AI Studio to quickly build (or "vibe code") and deploy apps that test out the latest capabilities of Gemini like Nano Banana and the Live API. Google AI Studio now supports full-stack runtimes, allowing you to build robust applications with server-side logic, secure secrets management, and npm package support, all through natural language prompting.

Get started

Start vibe coding in Google AI Studio's Build mode. You can start building in a few ways:

  • Start with a prompt: In Build mode, use the input box to enter a description of what you want to build. Select AI Chips to add specific features like image generation or Google Maps data to your prompt. You can even say what you want using the speech-to-text button.
  • "I'm Feeling Lucky" button: If you need a creative spark, use the "I'm Feeling Lucky" button, and Gemini will generate a prompt with a project idea to get you started.
  • Remix a project from the gallery: Open a project from the App Gallery and select Copy App.

Once you run the prompt, you'll see the necessary code and files get generated, with a live preview of your app appearing on the right-hand side.

What is created?

When you run your prompt, AI Studio creates a complete application. By default, it creates a full-stack environment that can include:

  • Client-side: a web frontend (React is the default).
  • Server-side: a Node.js runtime that allows for secure API calls, database connections, and npm package usage.

You can view the code that gets generated by selecting the Code tab in the right-hand preview pane. The Antigravity Agent intelligently manages multiple files across your stack, ensuring that changes are propagated correctly.

The Antigravity Agent

The Antigravity Agent is the main AI functionality within Google Antigravity and now the core components of the agent harness is powering the Build mode experience in Google AI Studio. It goes beyond simple code generation by maintaining context of your entire project, managing multiple files, and understanding complex instructions to build robust, full-stack applications.

Key capabilities include:

  • Context awareness: maintains context of previous prompts and file states.
  • Multi-file management: handles dependencies across multiple files.
  • Verified execution: verifies code updates to reduce hallucinations.

Full-stack capabilities

Google AI Studio unlocks the power of the modern web ecosystem, allowing you to build more than just client-side prototypes.

  • Server-side runtime & npm: use the vast library of npm packages. The agent will automatically identify and install packages as needed for your app (e.g., specific libraries for data visualization or API clients). You can also request specific packages if desired.
  • Secrets management: securely store API keys and secrets in the Settings menu. These are accessible in your server-side code, keeping them safe from client-side exposure.
  • Multiplayer: build real-time collaborative experiences directly within AI Studio. The server-side runtime manages the state and connections required for users to interact together.
  • Firebase integration: automatically provision and set up Firebase, including Firestore database (persistent data storage) and Firebase Authentication (sign-in flows, specifically "Sign in with Google"). The agent handles the entire setup process and even writes the code in your app for these services.

Learn more about developing full-stack apps

Continue building

Once Google AI Studio generates the initial code for your application, you can continue refining it:

Build in Google AI Studio

  • Iterate with Gemini: Use the chat panel in Build mode to ask Gemini to make modifications, add new features, or change the styling.
  • Edit the code directly: Open the Code tab in the preview panel to make live edits.

Develop externally

For more advanced workflows, you can export the code and work in your preferred environment:

  • Download and develop locally: Export the generated code as a ZIP file and import it into your code editor.
  • Push to GitHub: Integrate the code with your existing development and deployment processes by pushing it to a GitHub repository.

Key features

Google AI Studio includes several features to make the building process intuitive and visual:

  • Create and iterate on full stack apps: Create full stack apps with just a prompt and iterate through chat or annotation mode. Annotation mode lets you highlight any part of your app's UI and describe the change you want.
  • Share and deploy your app: You can share your creations with others to collaborate or showcase your work. Then when your app is ready, deploy to Cloud Run.
  • App gallery: The App Gallery provides a visual library of project ideas. You can browse what's possible with Gemini, preview applications instantly, and remix them to make them your own.

Deploy or archive your app

Once your application is ready, you can deploy it:

  • Google Cloud Run: deploy your application as a scalable service. Pricing for Google Cloud Run may apply based on usage.
  • GitHub: export your project to a GitHub repository.

Limitations

This section lists current limitations of build mode in Google AI Studio.

API Key security

  • Client-side: never use real API keys directly in client-side code.
  • Server-side: use the Secrets Management feature to handle sensitive keys securely in the server-side runtime.

Deployment outside Google AI Studio

  • While you can deploy your app to Cloud Run for a public URL, this setup will use your API key for all users' Gemini API calls.
    • JavaScript apps are run client side, so ensure API keys only have minimal access to prevent data leaks or misuse. For example, other File Search Stores from the same project may be accessible to users via this mechanism.
  • Secure external deployment: To run an app securely outside of AI Studio (e.g., after downloading the zip file), you must move the logic that uses the API key to a server-side component to prevent key exposure to end users. This is not needed if you deploy using Cloud Run.
  • Key exposure warning: Simply replacing the placeholder with a real API key in a client-side environment is strongly discouraged, as the key will become visible to any user.

Error when sharing apps

If you share your app and your end user runs into a 403 Access Restricted error when using the shared URL, it may be due to one of the following:

  • Browser extensions: privacy extensions like Privacy Badger may be blocking the app. Disable the extension to avoid the error.
  • Build issues: there may be issues with the current code. Prompt the agent to "fix any build issues with the current code" and then reshare the URL.

FAQ

What is Build in AI Studio?

AI Studio Build is a platform designed to take you from a simple prompt to a production-ready, AI-powered application using Gemini. Describe what you want to build with a prompt, and Gemini will generate an app for you. You can also explore our gallery to see what's possible with the Gemini API, and remix apps to make them your own.

Why does Build call Gemini API from client-side code?

Normally it is best practice to call Gemini API from the server-side, so as not to expose your API key. But AI Studio has a Gemini API proxy for client-side calls, which attaches the API key without exposing it in the code. For now we generate calls client-side to make use of this proxy, as it simplifies the code and lets you share your app with others without having to provide an API key.

Is my API key exposed when sharing apps?

Don't use a real API key in your app. Use a placeholder value instead. process.env.GEMINI_API_KEY is set to a placeholder value that you can use. When another user uses your app, AI Studio proxies the calls to the Gemini API, replacing the placeholder value with the user's (not your) API key. Do not use a real API key in your app, as the code is visible to anyone who can view your app.

Who can see my apps?

By default your app is private. You can share your app with other users to let them use it. Users you share your app with can see its code and fork it for their own purposes. If you share your app with edit permission, the other users can edit the code of your app.

Can I run apps outside of AI Studio?

You can deploy your app to Cloud Run from AI Studio, which will give your app a public URL. It's deployed along with a proxy server that will keep your API key private, however the deployed app will use your API key for all users' Gemini API calls. You can also download your app as a zip file. If you replace the placeholder value with a real API key, it should still work. But you should not deploy your app like this, as any user will be able to see the API key. To make an app run securely outside of AI Studio requires moving some logic server-side, so the API key is no longer exposed.

Can I develop apps locally with my own tools and then share them here?

This functionality is not yet available. We're excited to support more use-cases for apps in the future. Please consider giving us feedback if you have anything specific in mind.

How can I use a database or other storage with my apps?

AI Studio apps are standard apps running in a Cloud Run container. You can use any storage solution that you can connect to over a network, so long as there is not a firewall preventing access from a dynamic IP range.

We are working on adding direct support for storage in the future, which you will be able to configure directly within AI Studio.

To ensure that viewers are aware of an app’s usage of their webcam or other devices, we require an extra acknowledgement before the app can access these Navigator APIs. App creators can add these permission requests to their app’s metadata.json file. For example:

{
  "name": "My app",
  "requestFramePermissions": [
    "microphone",
    "camera",
    "display-capture",
    "geolocation",
    "bluetooth",
    "clipboard-read",
    "serial",
    "usb"
  ]
}

Supported values for requestFramePermissions are a subset of the standard policy-controlled features.

How can I use GitHub with my apps?

AI Studio's GitHub integration allows you to create a repository for your work and commit your latest changes. We do not currently support pulling remote changes.

Can I give other users edit access to my app?

This is not yet supported, but is coming soon.

Why was my app flagged for policy violation?

We have systems that automatically review apps to ensure they comply with our policies. If we find that an app violates our policies, the app will be removed from AI Studio. Policy violations can include, but are not limited to, the following:

  • Apps that contain malware, phishing, or impersonation
  • Apps that display or distribute content that violates child sexual abuse imagery policy
  • Apps that display or distribute content that violates harassment policy
  • Apps that display or distribute content that violates hate speech policy
  • Apps that display or distribute content that violates human trafficking policy
  • Apps that display or distribute content that violates sexually explicit content policy
  • Apps that display or distribute content that violates violence and gore policy
  • Apps that display or distribute content that violates harmful or dangerous policy

If your app has been flagged for a policy violation, and you believe it in error, you can submit an appeal. Repeated violations of our policies may result in the termination of your access to AI Studio.

What are my responsibilities as an app developer?

As a reminder, as the owner of your application, you are responsible for its behavior and all data it handles. This includes:

  • Legal Compliance and Third Party Rights: Ensuring your app complies with all applicable laws and regulations and does not violate the rights of others, including intellectual property and privacy rights.
  • Content Monitoring: Compliance with additional terms may apply to other services used by your app. For example, Google Cloud Terms of Service, applicable to Firestore, require customers hosting third-party content to publish policies defining what content is prohibited (e.g., illegal content) and monitor for presence of that illegal content.
  • Safe Implementation: Implementing the necessary safeguards and moderation tools to prevent your application from being misused.

Be aware of the use restrictions in the Terms of Service.

The Gemini API Additional Terms of Service apply to use of apps featured in the app gallery in AI Studio, unless otherwise noted.

What's next