Gemini API Reference

This page contains the API reference for the Gemini API.

Authentication

The Gemini API uses API keys for authentication. You can get an API key from the Google AI Studio.

API Endpoint

The base URL for the Gemini API is:

https://generativelanguage.googleapis.com/

Models

The following models are available through the Gemini API:

  • gemini-pro: A powerful, multimodal model that can understand and generate text, images, and video.
  • gemini-pro-vision: A version of Gemini Pro that is optimized for image understanding.
  • embedding-001: A model that can be used to generate embeddings for text.

Methods

The following methods are available through the Gemini API:

  • generateContent: Generates content from a prompt.
  • embedContent: Generates an embedding for a piece of content.
  • countTokens: Counts the number of tokens in a piece of content.

Client Libraries

The following client libraries are available for the Gemini API:

  • Python
  • Node.js
  • Go
  • Java