Skip to content
  • Auto
  • Light
  • Dark

List

List Agent API Keys
client.agents.apiKeys.list(stringagentUuid, APIKeyListParams { page, per_page } query?, RequestOptionsoptions?): APIKeyListResponse { api_key_infos, links, meta }
get/v2/gen-ai/agents/{agent_uuid}/api_keys

To list all agent API keys, send a GET request to /v2/gen-ai/agents/{agent_uuid}/api_keys.

ParametersExpand Collapse
agentUuid: string
query: APIKeyListParams { page, per_page }
page?: number

Page number.

per_page?: number

Items per page.

ReturnsExpand Collapse
APIKeyListResponse { api_key_infos, links, meta }
api_key_infos?: Array<APIAgentAPIKeyInfo { created_at, created_by, deleted_at, 3 more } >

Api key infos

created_at?: string

Creation date

formatdate-time
created_by?: string

Created by

formatuint64
deleted_at?: string

Deleted date

formatdate-time
name?: string

Name

secret_key?: string
uuid?: string

Uuid

Links to other pages

Information about how to reach other pages

First page

Last page

Next page

Previous page

meta?: APIMeta { page, pages, total }

Meta information about the data set

page?: number

The current page

formatint64
pages?: number

Total number of pages

formatint64
total?: number

Total amount of items over all pages

formatint64
List Agent API Keys
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const apiKeys = await client.agents.apiKeys.list('"123e4567-e89b-12d3-a456-426614174000"');

console.log(apiKeys.api_key_infos);
{
  "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
  }
}
Returns Examples
{
  "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
  }
}