cURL
curl -X DELETE https://platform.subconscious.dev/api/v1/management/api-keys/a1b2c3d4 \
-H "Authorization: Bearer sk-mgmt-..."import requests
url = "https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}', 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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}",
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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}"
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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}")
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{
"revoked": true,
"id": "5f0c8a1e-2b4d-4c7e-9a10-6d3f2e1b0c9a",
"keyPrefix": "a1b2c3d4"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "No active API key with prefix a1b2c3d4"
}{
"error": "<string>"
}{
"error": "<string>"
}Management
Delete inference key
Revoke an inference key by its prefix
DELETE
/
api
/
v1
/
management
/
api-keys
/
{keyPrefix}
cURL
curl -X DELETE https://platform.subconscious.dev/api/v1/management/api-keys/a1b2c3d4 \
-H "Authorization: Bearer sk-mgmt-..."import requests
url = "https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}', 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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}",
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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}"
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://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.subconscious.dev/api/v1/management/api-keys/{keyPrefix}")
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{
"revoked": true,
"id": "5f0c8a1e-2b4d-4c7e-9a10-6d3f2e1b0c9a",
"keyPrefix": "a1b2c3d4"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "No active API key with prefix a1b2c3d4"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
bearerAuthapiKeyAuth
API key in the Authorization header. Management endpoints require a management key (sk-mgmt-...). GET /api/v1/usage requires an inference key (sk-gw-...).
Path Parameters
Prefix returned when the inference key was created.
Example:
"a1b2c3d4"
Was this page helpful?