Delete an assistant
Get an API key to send requests.
Request
Section titled “Request”POST
https://gptunnel.ru/v1/assistant/deleteDeletes an assistant created by the API key owner. The assistant disappears from the catalog and stops responding in chat.
Request headers
| Parameter | Type | Description |
|---|---|---|
Authorization* | string | API key |
Request body
| Parameter | Type | Description |
|---|---|---|
id* | string | Assistant ID from the /v1/assistant/create or /v1/assistant/list response |
After deletion, the assistant also disappears from the assistant list. A second delete request with the same id returns HTTP 404.
Example request
Section titled “Example request”Set GPTUNNEL_API_KEY to your API key and GPTUNNEL_ASSISTANT_ID to the id of your own test assistant that you want to delete.
import jsonimport osfrom urllib.request import Request, urlopen
body = { "id": os.environ['GPTUNNEL_ASSISTANT_ID']}request = Request( 'https://gptunnel.ru/v1/assistant/delete', headers={ 'Authorization': os.environ['GPTUNNEL_API_KEY'], 'Content-Type': 'application/json', }, data=json.dumps(body).encode('utf-8'),)with urlopen(request, timeout=60) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/v1/assistant/delete' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "id": "'"${GPTUNNEL_ASSISTANT_ID:?Set GPTUNNEL_ASSISTANT_ID}"'"}'const response = await fetch('https://gptunnel.ru/v1/assistant/delete', { method: 'POST', headers: { Authorization: process.env.GPTUNNEL_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "id": process.env.GPTUNNEL_ASSISTANT_ID }),})if (!response.ok) throw new Error(await response.text())console.log(await response.json())Example response
Section titled “Example response”{ "object": "assistant.deleted", "id": "68c9b2d1e4b0a2d3c4f5e6b8", "deleted": true}The assistant does not exist, has already been deleted, or belongs to another user.
{ "error": { "message": "Assistant not found", "type": "invalid_request_error", "param": null, "code": null }}