# Remove the cloud provider's API key.

> No cloud VM starts until a key is stored again; agents that need one wait.
> https://koi.dog/docs/api/cloud/remove-cloud-api-key/

`DELETE /api/v1/cloud/api-key` · Scopes: `config`, `approve`

`409 connection_in_use` while a cloud VM may still be costing money: stop it first (`stopVm`, or `stopAllCloud`), since the key is what deletes it. The timeline records the key ID, action and outcome.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Response.

204 No Content

## Request.

```sh
curl -X DELETE https://api.koi.dog/api/v1/cloud/api-key \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch("https://api.koi.dog/api/v1/cloud/api-key", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(res.status);
```

```python
import os

import requests

r = requests.delete(
    "https://api.koi.dog/api/v1/cloud/api-key",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.status_code)
```
