curl -X POST https://api.getagentdrive.com/v0/keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD Pipeline",
"scope": "read-write"
}'
{
"id": "key_abc123",
"key": "agd_sk_live_abcdef1234567890abcdef1234567890",
"key_prefix": "agd_sk_live_abcd",
"name": "CI/CD Pipeline",
"scope": "read-write",
"created_at": "2026-03-19T10:00:00Z",
"last_used_at": null
}
API Keys
Create API Key
Create a new API key for authentication.
POST
/
v0
/
keys
curl -X POST https://api.getagentdrive.com/v0/keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD Pipeline",
"scope": "read-write"
}'
{
"id": "key_abc123",
"key": "agd_sk_live_abcdef1234567890abcdef1234567890",
"key_prefix": "agd_sk_live_abcd",
"name": "CI/CD Pipeline",
"scope": "read-write",
"created_at": "2026-03-19T10:00:00Z",
"last_used_at": null
}
Request Body
curl -X POST https://api.getagentdrive.com/v0/keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD Pipeline",
"scope": "read-write"
}'
{
"id": "key_abc123",
"key": "agd_sk_live_abcdef1234567890abcdef1234567890",
"key_prefix": "agd_sk_live_abcd",
"name": "CI/CD Pipeline",
"scope": "read-write",
"created_at": "2026-03-19T10:00:00Z",
"last_used_at": null
}
The full API key (
key field) is only returned once at creation time. Store it securely — you will not be able to retrieve it again.