Delete Keys
Overview
Delete API keys that are no longer needed via API to free up resources and reduce security risks.
API Request
Request Example
bash
curl -X DELETE https://ai-tokenhub.com/v1/keys/{hash} \
-H "Authorization: Bearer <YOUR_MANAGEMENT_API_KEY>"Request Parameters
| Parameter | Type | Location | Description |
|---|---|---|---|
| hash | string | path | Hash of the key to delete |
Response Example
Success Response
json
{
"success": true
}Error Response
json
{
"error": {
"message": "Key not found",
"type": "invalid_request_error",
"code": "key_not_found"
}
}Precautions
- Verify Before Deleting: Before deleting a key, ensure it is not being used by any application
- Backup Information: Record the basic information of the key before deletion for audit purposes
- Non-recoverable: Keys cannot be recovered after deletion, please operate with caution
Security Best Practices
Regular Cleanup
- Regularly review and delete keys that are no longer in use
- Monitor abnormally used keys and revoke them promptly
Least Privilege
- Create keys with the minimum necessary permissions for different applications
- Avoid creating unrestricted keys