---
title: "Revoke an AI Gateway key"
method: DELETE
path: "/project/{project}/ai-gateway/keys/{key_id}"
tags: ["AIGateway"]
---

# Revoke an AI Gateway key

`DELETE /project/{project}/ai-gateway/keys/{key_id}`

## Request

- Base URL: `https://api.aiven.io/v1`
- URL: `https://api.aiven.io/v1/project/{project}/ai-gateway/keys/{key_id}`
- Auth: HTTP bearer and OAuth 2
  - Authorization code: `https://console.aiven.io/oauth/authorize`
  - Token URL: `https://api.aiven.io/v1/oauth2/token` scopes: `projects:write`

> This endpoint **may be changed or removed at any time**. Don't use it in production environments.

The key stops working immediately, but its ID stays resolvable so that recorded AI Gateway usage can still be attributed.

## Path parameters

- `project` string, required
- `key_id` string, required

## Response `204`

Revoke an AI Gateway key

## Other responses

- `403`: AI Gateway is not enabled for this organization
- `404`: Key not found
- `409`: The key has expired or has already been revoked
- `503`: AI Gateway keys are unavailable

## Changes

- **2026-10-14** `890113a87c87`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/aiven/apis/aiven-api-documentation/changes/project/:project/ai-gateway/keys/:key_id/delete.md)

---

[API](https://skmtc.dev/aiven/apis/aiven-api-documentation.md) - [All operations](https://skmtc.dev/aiven/apis/aiven-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/aiven/apis/aiven-api-documentation/revisions/562453405db0?raw)
