> ## AI Agent Context
> - Full documentation index: https://aistudio.google.com/llms.txt
> - Gemini Docs MCP server (consistent live info): https://gemini-api-docs-mcp.dev
> - Coding agent skills & setup guide: https://aistudio.google.com/docs/coding-agents.md

# Listing models

{% mark class="http-get" %}{% icon name="south_west" /%}`GET`{% /mark %} `https://generativelanguage.googleapis.com/v1beta/models`

Lists the [`Model`s](/docs/models)
available through the Gemini API.

{% two-column-layout %}
  {% left-column %}
## Parameters  {% class="hide-from-toc" id="parameters" %}

  {% section class="api-ref-property-list" %}
  **pageSize**: `integer`

  The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.

  {% hr /%}

  **pageToken**: `string`

  A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.

  {% /section %}

  {% /left-column %}

  {% right-column class="sticky" %}
  **Example request** {% class="example-heading" %}

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY
  ```

  {% /tab %}

  {% tab label="Python" %}
  ```python
  from google import genai
  
  client = genai.Client()
  
  print("List of models that support generateContent:\n")
  for m in client.models.list():
    for action in m.supported_actions:
      if action == "generateContent":
        print(m.name)
  
  print("List of models that support embedContent:\n")
  for m in client.models.list():
    for action in m.supported_actions:
      if action == "embedContent":
        print(m.name)
  ```

  {% /tab %}

  {% tab label="Go" %}
  ```go
  ctx := context.Background()
  client, err := genai.NewClient(ctx, &genai.ClientConfig{
      APIKey:  os.Getenv("GEMINI_API_KEY"),
      Backend: genai.BackendGeminiAPI,
  })
  if err != nil {
      log.Fatal(err)
  }
  
  // Retrieve the list of models.
  models, err := client.Models.List(ctx, &genai.ListModelsConfig{})
  if err != nil {
      log.Fatal(err)
  }
  
  fmt.Println("List of models that support generateContent:")
  for _, m := range models.Items {
      for _, action := range m.SupportedActions {
          if action == "generateContent" {
              fmt.Println(m.Name)
              break
          }
      }
  }
  
  fmt.Println("\nList of models that support embedContent:")
  for _, m := range models.Items {
      for _, action := range m.SupportedActions {
          if action == "embedContent" {
              fmt.Println(m.Name)
              break
          }
      }
  }
  ```

  {% /tab %}

  {% /tabs %}

  {% /right-column %}

{% /two-column-layout %}

## Response  {% class="hide-from-toc" id="response" %}

{% section class="api-ref-property-list" %}
  **models**: [`Model`](/api-reference/models/list-models#Resource:Model) `array`

  The returned Models.

  {% hr /%}

  **nextPageToken**: `string`

  A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.

{% /section %}

## Resources  {% class="hide-from-toc" id="resources" %}

### Model  {% class="hide-from-toc" id="Resource:Model" %}

Information about a Generative Language Model.

**Properties:**

{% section class="api-ref-property-list" %}
  **name**: {% mark %}required{% /mark %} `string`

  The resource name of the [`Model`](/api-reference/models/list-models#Resource:Model). Refer to [Model variants](/docs/models#model-versions) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of:

  - "{base_model_id}-{version}"

  Examples:

  - `models/gemini-1.5-flash-001`

  {% hr /%}

  **baseModelId**: {% mark %}required{% /mark %} `string`

  The name of the base model, pass this to the generation request. Examples:

  - `gemini-1.5-flash`

  {% hr /%}

  **version**: {% mark %}required{% /mark %} `string`

  The version number of the model. This represents the major version (`1.0` or `1.5`)

  {% hr /%}

  **displayName**: `string`

  The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters.

  {% hr /%}

  **description**: `string`

  A short description of the model.

  {% hr /%}

  **inputTokenLimit**: `integer`

  Maximum number of input tokens allowed for this model.

  {% hr /%}

  **outputTokenLimit**: `integer`

  Maximum number of output tokens available for this model.

  {% hr /%}

  **supportedGenerationMethods**: `string array`

  The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.

  {% hr /%}

  **temperature**: `number`

  Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.

  {% hr /%}

  **maxTemperature**: `number`

  The maximum temperature this model can use.

  {% hr /%}

  **topP**: `number`

  For [Nucleus sampling](/docs/prompting-strategies#model-parameters). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.

  {% hr /%}

  **topK**: `integer`

  For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.

  {% hr /%}

  **thinking**: `boolean`

  Whether the model supports thinking.

{% /section %}

