GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cloud-code-samples/nodejs/gemini-api at v1 · lkeff/cloud-code-samples

Expand file tree

/

gemini-api

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

gemini-api

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

README.md

Outline

Google Cloud Platform logo

Simple application to interact with Gemini API

"NodeJS: Gemini API" is a simple sample application that shows you how to interact with Google's Gemini APIs .

Table of Contents

  • Directory contents
  • Setting up the API Key
  • Getting started
  • Sign up for user research

Directory contents

  • launch.json - config file for later when you deploy your application to Google Cloud
  • index.js - the Node sample application that asks Gemini API to generate content based on a prompt
  • package.json - includes the google generative ai dependency

Setting up the API Key

Before you can use the Gemini API, you must first obtain an API key. If you don't already have one, create a key with one click in Google AI Studio. Get API

Getting started with Cloud Code

Run the application locally

  1. Make sure you have generated the API key as shown above. Please make sure to use and store this key securely.

  2. Install the package using npm install @google/generative-ai

  3. Run this using node index.js

Documentation

  1. You can see detailed API Reference for the Gemini APIs here

  2. You can see more samples and things to do here

Other things to try

  1. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.

  2. Install the Cloud Code VS Code plugin or Jetbrains Extension if you haven't already.

  3. Access Cloud Code documentation to learn how you can deploy your app to Google Cloud

Sign up for user research

We want to hear your feedback!

The Cloud Code team is inviting our user community to sign-up to participate in Google User Experience Research.

If you’re invited to join a study, you may try out a new product or tell us what you think about the products you use every day. At this time, Google is only sending invitations for upcoming remote studies. Once a study is complete, you’ll receive a token of thanks for your participation such as a gift card or some Google swag.

Sign up using this link and answer a few questions about yourself, as this will help our research team match you to studies that are a great fit.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.