Skip to main content
DELETE
/
api
/
ai
/
key
Delete Gemini API Key
curl --request DELETE \
  --url https://api.example.com/api/ai/key
Removes the Gemini API key from the authenticated user’s account. After deletion, the user will need to configure a new key before using AI features.

Authentication

Requires Bearer token authentication.

Response

Returns 204 No Content on success with an empty response body.

Example Request

curl -X DELETE https://api.example.com/api/ai/key \
  -H "Authorization: Bearer YOUR_TOKEN_HERE"

Example Response

HTTP/1.1 204 No Content

Error Responses

401 Unauthorized
Authentication token is missing or invalid
{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}
404 Not Found
The user account was not found
{
  "error": "Not Found",
  "message": "User not found"
}

Notes

  • After deleting the API key, all AI chat functionality will be unavailable until a new key is configured
  • This operation sets the geminiKey field to null in the user’s account
  • This is useful if you need to revoke access or switch to a different API key

Build docs developers (and LLMs) love