API Key Rotation
Rotate API keys without downtime using the dual-key pattern.
GET
/v2/authentication/api-key-rotationRequires authenticationCode Example
bash
# Generate a new API key
curl -X POST https://api.nexus.dev/v2/keys/rotate \
-H "Authorization: Bearer $CURRENT_API_KEY" \
-H "Content-Type: application/json"
# Response includes both old and new keys
# {
# "new_key": "nxs_sk_new...",
# "old_key_expires_at": "2026-05-01T00:00:00Z"
# }
# Update your environment with the new key
export NEXUS_API_KEY="nxs_sk_new..."Last updated: April 21, 2026bash