Method: models.list

Lists models available through the API.

HTTP request

GET https://generativelanguage.googleapis.com/v1beta/models

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
pageSize

integer

The maximum number of Models to return (per page).

The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger pageSize.

pageToken

string

A page token, received from a previous models.list call.

Provide the pageToken returned by one request as an argument to the next request to retrieve the next page.

When paginating, all other parameters provided to models.list must match the call that provided the page token.

Request body

The request body must be empty.

Response body

Response from ListModel containing a paginated list of Models.

If successful, the response body contains data with the following structure:

JSON representation
{
  "models": [
    {
      object (Model)
    }
  ],
  "nextPageToken": string
}
Fields
models[]

object (Model)

The returned Models.

nextPageToken

string

A token, which can be sent as pageToken to retrieve the next page.

If this field is omitted, there are no more pages.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/generative-language
  • https://www.googleapis.com/auth/generative-language.tuning
  • https://www.googleapis.com/auth/generative-language.tuning.readonly
  • https://www.googleapis.com/auth/generative-language.retriever
  • https://www.googleapis.com/auth/generative-language.retriever.readonly

For more information, see the Authentication Overview.