Generative Language API

The PaLM API allows developers to build generative AI applications using the PaLM model. Large Language Models (LLMs) are a powerful, versatile type of machine learning model that enables computers to comprehend and generate natural language through a series of prompts. The PaLM API is based on Google's next generation LLM, PaLM. It excels at a variety of different tasks like code generation, reasoning, and writing. You can use the PaLM API to build generative AI applications for use cases like 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: v1beta3.models

Methods
batchEmbedText POST /v1beta3/{model=models/*}:batchEmbedText
Generates multiple embeddings from the model given input text in a synchronous call.
countMessageTokens POST /v1beta3/{model=models/*}:countMessageTokens
Runs a model's tokenizer on a string and returns the token count.
countTextTokens POST /v1beta3/{model=models/*}:countTextTokens
Runs a model's tokenizer on a text and returns the token count.
embedText POST /v1beta3/{model=models/*}:embedText
Generates an embedding from the model given an input message.
generateMessage POST /v1beta3/{model=models/*}:generateMessage
Generates a response from the model given an input MessagePrompt.
generateText POST /v1beta3/{model=models/*}:generateText
Generates a response from the model given an input message.
get GET /v1beta3/{name=models/*}
Gets information about a specific Model.
list GET /v1beta3/models
Lists models available through the API.

REST Resource: v1beta3.tunedModels

Methods
create POST /v1beta3/tunedModels
Creates a tuned model.
delete DELETE /v1beta3/{name=tunedModels/*}
Deletes a tuned model.
generateText POST /v1beta3/{model=tunedModels/*}:generateText
Generates a response from the model given an input message.
get GET /v1beta3/{name=tunedModels/*}
Gets information about a specific TunedModel.
list GET /v1beta3/tunedModels
Lists tuned models owned by the user.
patch PATCH /v1beta3/{tunedModel.name=tunedModels/*}
Updates a tuned model.
transferOwnership POST /v1beta3/{name=tunedModels/*}:transferOwnership
Transfers ownership of the tuned model.

REST Resource: v1beta3.tunedModels.permissions

Methods
create POST /v1beta3/{parent=tunedModels/*}/permissions
Create a permission to a specific resource.
delete DELETE /v1beta3/{name=tunedModels/*/permissions/*}
Deletes the permission.
get GET /v1beta3/{name=tunedModels/*/permissions/*}
Gets information about a specific Permission.
list GET /v1beta3/{parent=tunedModels/*}/permissions
Lists permissions for the specific resource.
patch PATCH /v1beta3/{permission.name=tunedModels/*/permissions/*}
Updates the permission.