Build an app with the Gemini API

While you can usetheApp Prototyping agentto automatically create a new app prototype with theGemini API, you canalso launch a blank canvas with theGemini Developer API through one click ofa button. Start using the latest generative AI models from Google in yourapp with a template that includes all theGemini API infrastructure youneed. All you need to do is add yourGemini API key and get coding!

Build a new app with theGemini API pre-loaded

Access theFirebase StudioGemini API template from thetemplates dashboard and build with the power of AI.

  1. Open theFirebase Studio template for theGemini API fromtheFirebase Studio template dashboard.
  2. Select the language and framework for your environment. TheGemini API template inFirebase Studio is available in JavaScript (with Vite orGenkit) and Python (notebook or web app with Flask), with more languages and frameworks coming soon.
  3. (Optional) If you want to add theLangChain framework to your app, select theUse LangChain option.
  4. When your workspace loads, open themain.js ormain.py file and update theAPI_KEY variable with yourGemini API key fromGoogle AI Studio.
  5. Test the base app in the web preview panel to watch theGemini API in action, and modify your newGemini API app accordingly.

Add theGemini API to an existing app

You can also add theGemini API to your existing app directly fromFirebase Studio.

  1. OpenFirebase Studio.

  2. Click theFirebase Studio icon from the navigation pane to open theFirebase Studio panel.

  3. Expand theGoogle Integrations section and clickAddGemini API.

  4. Follow the prompts to authenticate your account and add aGemini API keyto your app.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-09-24 UTC.