Get the authenticated key identity and normalized permissions
curl --request GET \
--url https://api.trycarhub.com/v1/api-keys/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/v1/api-keys/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trycarhub.com/v1/api-keys/self', 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.trycarhub.com/v1/api-keys/self",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.trycarhub.com/v1/api-keys/self"
req, _ := http.NewRequest("GET", 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.get("https://api.trycarhub.com/v1/api-keys/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/v1/api-keys/self")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"livemode": true,
"is_staging": true,
"permissions": [
"<string>"
],
"scopes": [
"<string>"
],
"expires_at": 123,
"rotates_at": 123
}API Reference
Get the authenticated key identity and normalized permissions
Available to every valid key, without business permissions. Accepts no key or organisation identifier. Permissions do not guarantee paid rights or available quota. No secret is returned.
GET
/
v1
/
api-keys
/
self
Get the authenticated key identity and normalized permissions
curl --request GET \
--url https://api.trycarhub.com/v1/api-keys/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/v1/api-keys/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trycarhub.com/v1/api-keys/self', 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.trycarhub.com/v1/api-keys/self",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.trycarhub.com/v1/api-keys/self"
req, _ := http.NewRequest("GET", 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.get("https://api.trycarhub.com/v1/api-keys/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/v1/api-keys/self")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"livemode": true,
"is_staging": true,
"permissions": [
"<string>"
],
"scopes": [
"<string>"
],
"expires_at": 123,
"rotates_at": 123
}Authorizations
Organisation API key, sent as Authorization: Bearer chk_live_….
chk_live_…— production inference, live credits,livemode: true,is_staging: false.chk_stg_…— real inference classified as staging, the same live credits,livemode: true,is_staging: true.chk_test_…— identical pipeline against the fixture backend, test credits,livemode: false.
Keys are stored hashed; only the prefix (chk_live_a1b2…) is ever displayed again. A key
may be scoped to a subset of endpoint families — calling outside its scopes is a 403.