Build an app with the Gemini API

Project IDX smooths your way to an AI app with the Gemini API through one click of a button. Start using the latest generative AI models from Google in your app with a template that includes all the Gemini API plumbing you need. Plug in your API key and get going.

Build a new app with the Gemini API pre-loaded

Access the IDX Gemini API template from the templates dashboard and build with the power of AI.

Image of the Gemini API template options in IDX

  1. Open the IDX template for the Gemini API from the IDX template dashboard.
  2. Select the language and framework for your environment. The Gemini API template in IDX is available in JavaScript (with Vite) and Python (notebook or web app with Flask), with more languages and frameworks coming soon.
  3. (Optional) If you want to add the LangChain framework to your app, select the Use LangChain option.
  4. When your workspace loads, open the main.js or main.py file and update the API_KEY variable with your Gemini API key from Google AI Studio.
  5. Test the base app in the web preview panel to watch the Gemini API in action, and modify your new Gemini API app accordingly.

Add the Gemini API to an existing app

You can also add the Gemini API to your existing app directly from IDX.

  1. Open Project IDX.

  2. Click the IDX icon from the navigation pane to open the IDX panel.

  3. Expand the Google Integrations section and click Add Gemini API.

  4. Follow the prompts to authenticate your account and add a Gemini API key to your app.