Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.inference.delete_inference_api_key(project_id="proj_AoW6vRnwkvLn0", api_key_id="aitok_6VE1Wd37dXnZJ")
# Handle response
print(res)curl --request DELETE \
--url https://api.latitude.sh/inference/api_keys/{api_key_id} \
--header 'Authorization: <api-key>'const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/inference/api_keys/{api_key_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://api.latitude.sh/inference/api_keys/{api_key_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: <api-key>"
],
]);
$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://api.latitude.sh/inference/api_keys/{api_key_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.latitude.sh/inference/api_keys/{api_key_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/inference/api_keys/{api_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {}
}{
"errors": [
{
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Inference
Revoke an inference API key
Revokes the inference API key and immediately removes it from active listings while retaining its audit record. Control-plane removal is asynchronous. Other active keys remain valid. The key stops authorizing new requests after the control plane refreshes or its identity snapshot expires. Revoking an already revoked key succeeds.
DELETE
/
inference
/
api_keys
/
{api_key_id}
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.inference.delete_inference_api_key(project_id="proj_AoW6vRnwkvLn0", api_key_id="aitok_6VE1Wd37dXnZJ")
# Handle response
print(res)curl --request DELETE \
--url https://api.latitude.sh/inference/api_keys/{api_key_id} \
--header 'Authorization: <api-key>'const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/inference/api_keys/{api_key_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://api.latitude.sh/inference/api_keys/{api_key_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: <api-key>"
],
]);
$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://api.latitude.sh/inference/api_keys/{api_key_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.latitude.sh/inference/api_keys/{api_key_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/inference/api_keys/{api_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {}
}{
"errors": [
{
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Was this page helpful?