---
title: pydo.genai.list_agent_api_keys()
description: List Agent API Keys
product: Reference
url: https://docs.digitalocean.com/reference/pydo/reference/genai/list_agent_api_keys/
last_updated: "2026-11-06"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# pydo.genai.list_agent_api_keys()

Generated on 6 Nov 2026 from `pydo` version [`v0.45.0`](https://github.com/digitalocean/pydo/releases/tag/v0.45.0)

## Usage

```python
client.genai.list_agent_api_keys(
    agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"",
    page=None,
    per_page=None,
)
```

Returns `JSON` Raises `HttpResponseError`

## Description

To list all agent API keys, send a GET request to [`/v2/gen-ai/agents/{agent_uuid}/api_keys`](https://docs.digitalocean.com/reference/api/reference/agent-platform-api/index.html.md#genai_list_agent_api_keys).

## Parameters

`agent_uuid` string required

Agent id

`page` integer optional

Page number.

`per_page` integer optional

Items per page.

## Pagination

This method returns paginated results. The response includes a `links.pages` object with URLs for navigating between pages. To retrieve the next page, parse the `next` URL and pass the `page` parameter:

```python
from urllib.parse import urlparse, parse_qs

resp = client.genai.list_agent_api_keys(agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", )
pages = resp.get("links", {}).get("pages", {})

while "next" in pages:
    parsed = urlparse(pages["next"])
    page = int(parse_qs(parsed.query)["page"][0])
    resp = client.genai.list_agent_api_keys(agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", page=page)
    pages = resp.get("links", {}).get("pages", {})
```

## Response Example

## Show Response Example

```json
{
  "api_key_infos": [
    {
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "12345",
      "deleted_at": "2023-01-01T00:00:00Z",
      "name": "example name",
      "secret_key": "example string",
      "uuid": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "links": {
    "pages": {
      "first": "example string",
      "last": "example string",
      "next": "example string",
      "previous": "example string"
    }
  },
  "meta": {
    "page": 123,
    "pages": 123,
    "total": 123
  }
}
```

## More Information

See [`/v2/gen-ai/agents/{agent_uuid}/api_keys`](https://docs.digitalocean.com/reference/api/reference/agent-platform-api/index.html.md#genai_list_agent_api_keys) in the API reference for additional detail on responses, headers, parameters, and more.