Creare un'app con l'API Gemini
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Anche se puoi utilizzare App Prototyping agent
per creare automaticamente un nuovo prototipo di app con Gemini API, puoi
anche avviare un canvas vuoto con l'API DeveloperGemini con un solo clic di
un pulsante. Inizia a utilizzare i modelli di AI generativa più recenti di Google nella tua app con un modello che include tutta l'infrastruttura Gemini API di cui hai bisogno. Devi solo aggiungere la tua
chiave Gemini API e iniziare a programmare.
Crea una nuova app con Gemini API precaricato
Accedi al modello Firebase Studio Gemini API dalla dashboard dei modelli e crea con la potenza dell'AI.
- Apri il modello Firebase Studio per Gemini API dalla
dashboard del modello Firebase Studio.
- Seleziona la lingua e il framework per il tuo ambiente. Il modello
Gemini API
in Firebase Studio è disponibile in JavaScript (con Vite o
Genkit) e Python (notebook o app web con Flask), con altre
lingue e framework in arrivo.
- (Facoltativo) Se vuoi aggiungere il framework
LangChain
alla tua app, seleziona l'opzione Usa LangChain.
- Quando viene caricato lo spazio di lavoro, apri il file
main.js
o
main.py
e aggiorna
la variabile API_KEY
con la chiave Gemini API di Google AI Studio.
- Testa l'app di base nel riquadro di anteprima web per vedere Gemini API in
azione e modifica la nuova app Gemini API di conseguenza.
Aggiungi Gemini API a un'app esistente
Puoi anche aggiungere Gemini API alla tua app esistente direttamente da
Firebase Studio.
Apri Firebase Studio.
Fai clic sull'icona Firebase Studio nel riquadro di navigazione per aprire il
riquadro Firebase Studio.
Espandi la sezione Integrazioni Google e fai clic su Aggiungi Gemini API.
Segui le istruzioni per autenticare il tuo account e aggiungere una chiave Gemini API
alla tua app.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[],[],null,["While you can use [the App Prototyping agent](/docs/studio/get-started-ai)\nto automatically create a new app prototype with the Gemini API, you can\nalso launch a blank canvas with the\n[Gemini Developer API](https://ai.google.dev/) through one click of\na button. Start using the latest generative AI models from Google in your\napp with a template that includes all the Gemini API infrastructure you\nneed. All you need to do is add your\n[Gemini API key](https://ai.google.dev/tutorials/setup) and get coding!\n\nBuild a new app with the Gemini API pre-loaded\n\nAccess the Firebase Studio Gemini API template from the\ntemplates dashboard and build with the power of AI.\n\n1. Open the [Firebase Studio template for the Gemini API](https://studio.firebase.google.com//new/gemini) from the Firebase Studio template dashboard.\n2. Select the language and framework for your environment. The Gemini API template in Firebase Studio is available in JavaScript (with Vite or Genkit) and Python (notebook or web app with Flask), with more languages and frameworks coming soon.\n3. *(Optional)* If you want to add the [LangChain](https://www.langchain.com/) framework to your app, select the **Use LangChain** option.\n4. 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](https://aistudio.google.com/app/apikey).\n5. Test the base app in the web preview panel to watch the Gemini API in action, and modify your new Gemini API app accordingly.\n\nAdd the Gemini API to an existing app\n\nYou can also add the Gemini API to your existing app directly from\nFirebase Studio.\n\n1. Open [Firebase Studio](https://studio.firebase.google.com/).\n\n2. Click the Firebase Studio icon from the navigation pane to open the\n Firebase Studio panel.\n\n3. Expand the **Google Integrations** section and click **Add Gemini API**.\n\n4. Follow the prompts to authenticate your account and add a Gemini API key\n to your app."]]