---
title: "Delete Api Key"
method: DELETE
path: "/keys/{key_prefix}"
tags: ["Keys"]
---

# Delete Api Key

`DELETE /keys/{key_prefix}`

Delete an API key with the given key prefix for the authenticated user.

Args:
    key_prefix (str): The prefix of the API key to be deleted.
    request (Request): The incoming request object.

Returns:
    dict: A dictionary containing a success message upon successful deletion.

Raises:
    HTTPException: If the API key is not found or does not belong to the user.

## Path parameters

- `key_prefix` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.net/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/versions/ea6421d829f1/schema)
