anthropic_api_keys
Creates, updates, deletes, gets or lists an anthropic_api_keys resource.
Overview
| Name | anthropic_api_keys |
| Type | Resource |
| Id | digitalocean.genai.anthropic_api_keys |
Fields
The following fields are returned by SELECT queries:
- genai_get_anthropic_api_key
- genai_list_anthropic_api_keys
A successful response.
| Name | Datatype | Description |
|---|---|---|
name | string | Name (example: example name) |
created_at | string (date-time) | Key creation date (example: 2023-01-01T00:00:00Z) |
created_by | string (uint64) | Created by user id from DO (example: 12345) |
deleted_at | string (date-time) | Key deleted date (example: 2023-01-01T00:00:00Z) |
updated_at | string (date-time) | Key last updated date (example: 2023-01-01T00:00:00Z) |
uuid | string | Uuid (example: 123e4567-e89b-12d3-a456-426614174000) |
A successful response.
| Name | Datatype | Description |
|---|---|---|
api_key_infos | array | Api key infos |
links | object | Links to other pages |
meta | object | Meta information about the data set |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
genai_get_anthropic_api_key | select | api_key_uuid | To retrieve details of an Anthropic API key, send a GET request to /v2/gen-ai/anthropic/keys/{api_key_uuid}. | |
genai_list_anthropic_api_keys | select | page, per_page | To list all Anthropic API keys, send a GET request to /v2/gen-ai/anthropic/keys. | |
genai_create_anthropic_api_key | insert | To create an Anthropic API key, send a POST request to /v2/gen-ai/anthropic/keys. | ||
genai_update_anthropic_api_key | replace | api_key_uuid | To update an Anthropic API key, send a PUT request to /v2/gen-ai/anthropic/keys/{api_key_uuid}. | |
genai_delete_anthropic_api_key | delete | api_key_uuid | To delete an Anthropic API key, send a DELETE request to /v2/gen-ai/anthropic/keys/{api_key_uuid}. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_key_uuid | string | API key ID (example: "123e4567-e89b-12d3-a456-426614174000") |
page | integer | Page number. (example: 1) |
per_page | integer | Items per page. (example: 1) |
SELECT examples
- genai_get_anthropic_api_key
- genai_list_anthropic_api_keys
To retrieve details of an Anthropic API key, send a GET request to /v2/gen-ai/anthropic/keys/{api_key_uuid}.
SELECT
name,
created_at,
created_by,
deleted_at,
updated_at,
uuid
FROM digitalocean.genai.anthropic_api_keys
WHERE api_key_uuid = '{{ api_key_uuid }}' -- required
;
To list all Anthropic API keys, send a GET request to /v2/gen-ai/anthropic/keys.
SELECT
api_key_infos,
links,
meta
FROM digitalocean.genai.anthropic_api_keys
WHERE page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- genai_create_anthropic_api_key
- Manifest
To create an Anthropic API key, send a POST request to /v2/gen-ai/anthropic/keys.
INSERT INTO digitalocean.genai.anthropic_api_keys (
data__api_key,
data__name
)
SELECT
'{{ api_key }}',
'{{ name }}'
RETURNING
api_key_info
;
# Description fields are for documentation purposes
- name: anthropic_api_keys
props:
- name: api_key
value: string
description: >
Anthropic API key
- name: name
value: string
description: >
Name of the key
REPLACE examples
- genai_update_anthropic_api_key
To update an Anthropic API key, send a PUT request to /v2/gen-ai/anthropic/keys/{api_key_uuid}.
REPLACE digitalocean.genai.anthropic_api_keys
SET
data__api_key = '{{ api_key }}',
data__api_key_uuid = '{{ api_key_uuid }}',
data__name = '{{ name }}'
WHERE
api_key_uuid = '{{ api_key_uuid }}' --required
RETURNING
api_key_info;
DELETE examples
- genai_delete_anthropic_api_key
To delete an Anthropic API key, send a DELETE request to /v2/gen-ai/anthropic/keys/{api_key_uuid}.
DELETE FROM digitalocean.genai.anthropic_api_keys
WHERE api_key_uuid = '{{ api_key_uuid }}' --required
;