All methods

Gemini API

The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.

Service: generativelanguage.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://generativelanguage.googleapis.com

REST Resource: v1beta.auth_tokens

Methods
create POST /v1beta/auth_tokens
Creates a token that can be used to constrain the behavior of a BidiGenerateContent session.

REST Resource: v1beta.batches

Methods
cancel POST /v1beta/{name=batches/*}:cancel
Starts asynchronous cancellation on a long-running operation.
delete DELETE /v1beta/{name=batches/*}
Deletes a long-running operation.
get GET /v1beta/{name=batches/*}
Gets the latest state of a long-running operation.
list GET /v1beta/{name=batches}
Lists operations that match the specified filter in the request.
updateEmbedContentBatch PATCH /v1beta/{embedContentBatch.name=batches/*}:updateEmbedContentBatch
Updates a batch of EmbedContent requests for batch processing.
updateGenerateContentBatch PATCH /v1beta/{generateContentBatch.name=batches/*}:updateGenerateContentBatch
Updates a batch of GenerateContent requests for batch processing.

REST Resource: v1beta.cachedContents

Methods
create POST /v1beta/cachedContents
Creates CachedContent resource.
delete DELETE /v1beta/{name=cachedContents/*}
Deletes CachedContent resource.
get GET /v1beta/{name=cachedContents/*}
Reads CachedContent resource.
list GET /v1beta/cachedContents
Lists CachedContents.
patch PATCH /v1beta/{cachedContent.name=cachedContents/*}
Updates CachedContent resource (only expiration is updatable).

REST Resource: v1beta.fileSearchStores

Methods
create POST /v1beta/fileSearchStores
Creates an empty FileSearchStore.
delete DELETE /v1beta/{name=fileSearchStores/*}
Deletes a FileSearchStore.
get GET /v1beta/{name=fileSearchStores/*}
Gets information about a specific FileSearchStore.
importFile POST /v1beta/{fileSearchStoreName=fileSearchStores/*}:importFile
Imports a File from File Service to a FileSearchStore.
list GET /v1beta/fileSearchStores
Lists all FileSearchStores owned by the user.

REST Resource: v1beta.fileSearchStores.documents

Methods
delete DELETE /v1beta/{name=fileSearchStores/*/documents/*}
Deletes a Document.
get GET /v1beta/{name=fileSearchStores/*/documents/*}
Gets information about a specific Document.
list GET /v1beta/{parent=fileSearchStores/*}/documents
Lists all Documents in a Corpus.

REST Resource: v1beta.fileSearchStores.operations

Methods
get GET /v1beta/{name=fileSearchStores/*/operations/*}
Gets the latest state of a long-running operation.

REST Resource: v1beta.fileSearchStores.upload.operations

Methods
get GET /v1beta/{name=fileSearchStores/*/upload/operations/*}
Gets the latest state of a long-running operation.

REST Resource: v1beta.files

Methods
delete DELETE /v1beta/{name=files/*}
Deletes the File.
get GET /v1beta/{name=files/*}
Gets the metadata for the given File.
list GET /v1beta/files
Lists the metadata for Files owned by the requesting project.
register POST /v1beta/files:register
Registers a Google Cloud Storage files with FileService.

REST Resource: v1beta.media

Methods
download GET /v1beta/{parent=environments/*}/files
Retrieves file metadata or directory contents from an environment's snapshot.
upload POST /v1beta/files
POST /upload/v1beta/files
Creates a File.
uploadToFileSearchStore POST /v1beta/{fileSearchStoreName=fileSearchStores/*}:uploadToFileSearchStore
POST /upload/v1beta/{fileSearchStoreName=fileSearchStores/*}:uploadToFileSearchStore
Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.

REST Resource: v1beta.models

Methods
asyncBatchEmbedContent POST /v1beta/{batch.model=models/*}:asyncBatchEmbedContent
Enqueues a batch of EmbedContent requests for batch processing.
batchEmbedContents POST /v1beta/{model=models/*}:batchEmbedContents
Generates multiple embedding vectors from the input Content which consists of a batch of strings represented as EmbedContentRequest objects.
batchGenerateContent POST /v1beta/{batch.model=models/*}:batchGenerateContent
Enqueues a batch of GenerateContent requests for batch processing.
countTokens POST /v1beta/{model=models/*}:countTokens
Runs a model's tokenizer on input Content and returns the token count.
embedContent POST /v1beta/{model=models/*}:embedContent
Generates a text embedding vector from the input Content using the specified Gemini Embedding model.
generateContent POST /v1beta/{model=models/*}:generateContent
Generates a model response given an input GenerateContentRequest.
get GET /v1beta/{name=models/*}
Gets information about a specific Model such as its version number, token limits, parameters and other metadata.
list GET /v1beta/models
Lists the Models available through the Gemini API.
predict POST /v1beta/{model=models/*}:predict
Performs a prediction request.
predictLongRunning POST /v1beta/{model=models/*}:predictLongRunning
Same as Predict but returns an LRO.
streamGenerateContent POST /v1beta/{model=models/*}:streamGenerateContent
Generates a streamed response from the model given an input GenerateContentRequest.

REST Resource: v1beta.interactions

Methods
CreateCredential POST /v1beta/credentials
Creates a credential.
CreateInteraction POST /v1beta/interactions
Creates a new interaction.
cancelInteractionById POST /v1beta/interactions/{id}/cancel
Cancels an interaction by id.
ListCredentials GET /v1beta/credentials
Lists credentials for a project.
GetCredential GET /v1beta/credentials/{id}
Gets metadata of a single credential (no secret fields).
getInteractionById GET /v1beta/interactions/{id}
Retrieves the full details of a single interaction based on its `Interaction.id`.
UpdateCredential PATCH /v1beta/credentials/{id}
Updates a credential.
DeleteCredential DELETE /v1beta/credentials/{id}
Deletes a credential.
deleteInteraction DELETE /v1beta/interactions/{id}
Deletes the interaction by id.

REST Resource: v1beta.agents

Methods
CreateAgent POST /v1beta/agents
Creates a new Agent (Typed version for SDK).
ListAgents GET /v1beta/agents
Lists all Agents.
GetAgent GET /v1beta/agents/{id}
Gets a specific Agent.
DeleteAgent DELETE /v1beta/agents/{id}
Deletes an Agent.

REST Resource: v1beta.webhooks

Methods
CreateWebhook POST /v1beta/webhooks
Creates a new Webhook.
PingWebhook POST /v1beta/webhooks/{id}:ping
Sends a ping event to a Webhook.
RotateSigningSecret POST /v1beta/webhooks/{id}:rotateSigningSecret
Generates a new signing secret for a Webhook.
ListWebhooks GET /v1beta/webhooks
Lists all Webhooks.
GetWebhook GET /v1beta/webhooks/{id}
Gets a specific Webhook.
UpdateWebhook PATCH /v1beta/webhooks/{id}
Updates an existing Webhook.
DeleteWebhook DELETE /v1beta/webhooks/{id}
Deletes a Webhook.

REST Resource: v1beta.triggers

Methods
CreateTrigger POST /v1beta/triggers
Creates a new trigger that will invoke the specified agent on the given cron schedule.
RunTrigger POST /v1beta/triggers/{trigger_id}/executions
Runs a trigger immediately.
ListTriggers GET /v1beta/triggers
Lists triggers for a project.
GetTrigger GET /v1beta/triggers/{id}
Gets details of a single trigger.
ListTriggerExecutions GET /v1beta/triggers/{trigger_id}/executions
Lists executions for a trigger.
UpdateTrigger PATCH /v1beta/triggers/{id}
Updates a trigger.
DeleteTrigger DELETE /v1beta/triggers/{id}
Deletes a trigger.

REST Resource: v1beta.environments

Methods
CreateEnvironment POST /v1beta/environments
Creates an environment.
ListEnvironments GET /v1beta/environments
Lists environments.
GetEnvironmentFiles GET /v1beta/environments/{environment}/files/{path}
Retrieves file metadata or directory contents from an environment's snapshot.
GetEnvironment GET /v1beta/environments/{id}
Gets an environment.
StartEnvironmentFileUpload PUT /upload/v1beta/environments/{environment}/files/{path}
Starts a resumable upload session for a file in an environment workspace.
DeleteEnvironment DELETE /v1beta/environments/{id}
Deletes an environment.