Get the calling API key
curl --request GET \
--url https://api.deapi.ai/api/v2/key \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deapi.ai/api/v2/key"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://api.deapi.ai/api/v2/key', 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.deapi.ai/api/v2/key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.deapi.ai/api/v2/key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v2/key")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"name": "Production backend",
"preview": "42|...f3a",
"role": "api",
"status": "active",
"created_at": "2026-09-22T10:00:00+00:00",
"expires_at": null,
"last_used_at": "2026-09-22T11:30:00+00:00",
"ip_whitelist": [
"203.0.113.7",
"198.51.100.0/24"
],
"ip_whitelist_count": 2,
"limit": 100,
"reset_interval": "monthly",
"limit_used": 41.25,
"limit_remaining": 58.75,
"limit_resets_at": "2026-10-22T10:00:00+00:00"
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "This API key does not have permission to access this endpoint.",
"code": "insufficient_permissions"
}{
"message": "Too Many Attempts."
}API Keys
Get Current Key
The key sending the request: name, preview, role, status, dates, spend limit and IP whitelist. Never the secret. Works with any key role.
GET
/
api
/
v2
/
key
Get the calling API key
curl --request GET \
--url https://api.deapi.ai/api/v2/key \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deapi.ai/api/v2/key"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://api.deapi.ai/api/v2/key', 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.deapi.ai/api/v2/key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.deapi.ai/api/v2/key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v2/key")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"name": "Production backend",
"preview": "42|...f3a",
"role": "api",
"status": "active",
"created_at": "2026-09-22T10:00:00+00:00",
"expires_at": null,
"last_used_at": "2026-09-22T11:30:00+00:00",
"ip_whitelist": [
"203.0.113.7",
"198.51.100.0/24"
],
"ip_whitelist_count": 2,
"limit": 100,
"reset_interval": "monthly",
"limit_used": 41.25,
"limit_remaining": 58.75,
"limit_resets_at": "2026-10-22T10:00:00+00:00"
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123,
"code": "missing_key"
}{
"message": "This API key does not have permission to access this endpoint.",
"code": "insufficient_permissions"
}{
"message": "Too Many Attempts."
}Works with both ADMIN and API keys — see API Keys.
Authorizations
Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.
Headers
Available options:
application/json Response
The calling key.
Show child attributes
Show child attributes
Was this page helpful?