For AI agents: The documentation index is at 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).
Usage
client.v2.genAi.agents.byAgent_uuId(agent_uuId).api_keys.post(body: ApiCreateAgentAPIKeyInputPublic, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | ApiCreateAgentAPIKeyOutput>
Description
To create an agent API key, send a POST request to /v2/gen-ai/agents/{agent_uuid}/api_keys.
Parameters
Path Parameters
agent_uuId string required
Example: "123e4567-e89b-12d3-a456-426614174000"
Agent id
Request Body
agentUuid string optional
Example: "12345678-1234-1234-1234-123456789012"
Agent id
name string optional
Example: Production Key
A human friendly name to identify the key
Request Sample
Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
createDigitalOceanClient,
DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";
const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);
const response = await client.v2.genAi.agents
.byAgent_uuId("\"123e4567-e89b-12d3-a456-426614174000\"").api_keys.post({
agentUuid: "\"12345678-1234-1234-1234-123456789012\"",
name: "Production Key",
});
Response Example
Show Response Example
{
"api_key_info": {
"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"
}
}
See /v2/gen-ai/agents/{agent_uuid}/api_keys in the API reference for additional detail on responses, headers, parameters, and more.