> ## 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 credentials

{% callout type="note" %}
  This API is in Beta. Endpoints are under `/v1beta/`.

{% /callout %}

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

Lists credentials.

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

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

  Optional. Maximum number of credentials to return.

  {% hr /%}

  **page_token**: `string`

  Optional. Pagination token.

  {% /section %}

  {% /left-column %}

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

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl -X GET "https://generativelanguage.googleapis.com/v1beta/credentials" \
    -H "x-goog-api-key: $GEMINI_API_KEY"
  ```

  {% /tab %}

  {% /tabs %}

  {% /right-column %}

{% /two-column-layout %}

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

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

  {% hr /%}

  **next_page_token**: `string`

  {% /section %}

  {% /left-column %}

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

  ```json
  {
    "credentials": [
      {
        "id": "string",
        "type": "bearer_token",
        "status": "active",
        "create_time": "string",
        "update_time": "string"
      }
    ],
    "next_page_token": "string"
  }
  ```

  {% /right-column %}

{% /two-column-layout %}

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

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

Server-managed credential resource stored in Secret Manager.

**Properties:**

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

  Output only. Identifier. Unique identifier for the credential.

  {% hr /%}

  {% details %}
  {% summary %}
  **type**: {% mark %}required{% /mark %} `string enum`

  Output only. The type of credential.

  {% /summary %}

  Possible values:

  - `bearer_token`: Static token injected as header. No refresh logic.
  - `oauth2`: Auto-refresh expired access tokens using stored refresh token.
  - `environment_variable`: Environment variable injected into sandbox container.

  {% /details %}

  {% hr /%}

  {% details %}
  {% summary %}
  **status**: `string enum`

  Output only. Current status of the credential.

  {% /summary %}

  Possible values:

  - `active`: The credential is active and valid for use.
  - `revoked`: The credential has been revoked and is no longer valid.

  {% /details %}

  {% hr /%}

  **create_time**: `string`

  Output only. The timestamp when the credential was created.

  {% hr /%}

  **update_time**: `string`

  Output only. The timestamp when the credential was last updated.

{% /section %}

