Skip to main content
DELETE
/
api
/
v0
/
auth
/
apikeys
/
{id}
/
delete api key
curl --request DELETE \
  --url https://console.vast.ai/api/v0/auth/apikeys/{id}/ \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://console.vast.ai/api/v0/auth/apikeys/{id}/"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://console.vast.ai/api/v0/auth/apikeys/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://console.vast.ai/api/v0/auth/apikeys/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://console.vast.ai/api/v0/auth/apikeys/{id}/"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://console.vast.ai/api/v0/auth/apikeys/{id}/")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://console.vast.ai/api/v0/auth/apikeys/{id}/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
"Successfully Deleted API Key"
{
"msg": "API Key ID not provided."
}
{
"success": false,
"error": "<string>",
"msg": "<string>"
}
{
"msg": "You do not have permission to delete this API Key."
}
{
"msg": "API Key not found."
}
{
"detail": "API requests too frequent endpoint threshold=2.0"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Path Parameters

id
integer
required

ID of the API key to delete

Required range: x >= 1

Response

API key successfully deleted

The response is of type string.

Example:

"Successfully Deleted API Key"