# Delete key

URL: https://docs.hanzo.ai/docs/openapi/websearch/delete-search-engine-key

> Removes an engine's API key from KMS.

`DELETE /v1/websearch/engines/{name}/key`

> [Websearch →](https://docs.hanzo.ai/docs/openapi/websearch) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                        |
| ------------- | ------------------------------------------------------ |
| **Address**   | `https://api.hanzo.ai/v1/websearch/engines/{name}/key` |
| **Method**    | `DELETE`                                               |
| **Operation** | `delete_search_engine_key`                             |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                 |

Removes an engine's API key from KMS.

Searches stop using the key at once. Removing a key that is not held answers
the same as removing one that is. 409 when the saved setting would be left with
no engine that can answer — enable bing or ddg first.

SuperAdmin only. 404 for an engine that does not exist, 400 for one that takes
no key, 503 when the settings store or KMS cannot answer.

## Request

1 field.

| Field  | In   | Type   | Required | Description                        |
| ------ | ---- | ------ | -------- | ---------------------------------- |
| `name` | path | string | yes      | Name is the engine, from the path. |

## Response

| Status    | Body                        | Meaning |
| --------- | --------------------------- | ------- |
| `200`     | websearch.searchEngineKeyed | ok      |
| `default` | problem-details             | refused |

`200` body — 2 fields.

| Field   | In   | Type    | Always | Description                         |
| ------- | ---- | ------- | ------ | ----------------------------------- |
| `keyed` | body | boolean | —      | Keyed is whether a key is now held. |
| `name`  | body | string  | —      | Name is the engine.                 |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo websearch engines key clear <name>
```

**SDK**

**.ts**

```ts
import { Configuration, WebsearchApi } from 'hanzoai';

const api = new WebsearchApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteSearchEngineKey({ name: 'name' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WebsearchApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WebsearchApi(client).delete_search_engine_key(name='name')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WebsearchAPI.DeleteSearchEngineKey(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, websearch_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = websearch_api::delete_search_engine_key(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WebsearchApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WebsearchApi(client).deleteSearchEngineKey();
```

**HTTP**

```bash
curl -X DELETE https://api.hanzo.ai/v1/websearch/engines/<name>/key \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **websearch** through the `websearch` tool, which names its 3 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_search_engines"
         }
       }
     }'
```

---

[Websearch API](https://docs.hanzo.ai/docs/openapi/websearch) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
