Skip to content
  • Auto
  • Light
  • Dark

List

List Anthropic API Keys
agents.evaluation_metrics.anthropic.keys.list(KeyListParams**kwargs) -> KeyListResponse
get/v2/gen-ai/anthropic/keys

To list all Anthropic API keys, send a GET request to /v2/gen-ai/anthropic/keys.

ParametersExpand Collapse
page: Optional[int]

Page number.

per_page: Optional[int]

Items per page.

ReturnsExpand Collapse
class KeyListResponse:

ListAnthropicAPIKeysOutput is used to return the list of Anthropic API keys for a specific agent.

api_key_infos: Optional[List[APIAnthropicAPIKeyInfo]]

Api key infos

created_at: Optional[datetime]

Key creation date

formatdate-time
created_by: Optional[str]

Created by user id from DO

formatuint64
deleted_at: Optional[datetime]

Key deleted date

formatdate-time
name: Optional[str]

Name

updated_at: Optional[datetime]

Key last updated date

formatdate-time
uuid: Optional[str]

Uuid

Links to other pages

Information about how to reach other pages

First page

Last page

Next page

Previous page

meta: Optional[APIMeta]

Meta information about the data set

page: Optional[int]

The current page

formatint64
pages: Optional[int]

Total number of pages

formatint64
total: Optional[int]

Total amount of items over all pages

formatint64
List Anthropic API Keys
from gradient import Gradient

client = Gradient()
keys = client.agents.evaluation_metrics.anthropic.keys.list()
print(keys.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",
      "updated_at": "2023-01-01T00:00:00Z",
      "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",
      "updated_at": "2023-01-01T00:00:00Z",
      "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
  }
}