Usage by API key
curl --request GET \
--url https://api.pexafy.com/api/v1/usage/by-key \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pexafy.com/api/v1/usage/by-key"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pexafy.com/api/v1/usage/by-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.pexafy.com/api/v1/usage/by-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 => [
"x-api-key: <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.pexafy.com/api/v1/usage/by-key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.pexafy.com/api/v1/usage/by-key")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pexafy.com/api/v1/usage/by-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"keys": [
{
"key_id": "007BD937014346F18E37980984DD7254",
"name": "default",
"created_at": "2026-09-04T10:03:17+00:00",
"last_used_at": "2026-10-09T18:42:51+00:00",
"requests_this_month": 1987,
"requests_today": 0
},
{
"key_id": "DF056FA544D24B21955BBA90FE532A62",
"name": "blog-illustrator",
"created_at": "2026-10-02T14:27:40+00:00",
"last_used_at": "2026-10-14T16:05:09+00:00",
"requests_this_month": 1495,
"requests_today": 846
}
]
},
"meta": {
"request_id": "e2dd2976-fc40-4aed-960d-132acea88674",
"took_ms": 4.18
},
"error": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Usage
Usage by API key
Break your usage down by individual API key — see this month’s and today’s request count for each active key. Handy for spotting which key (or which app) drives the most traffic.
GET
/
api
/
v1
/
usage
/
by-key
Usage by API key
curl --request GET \
--url https://api.pexafy.com/api/v1/usage/by-key \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pexafy.com/api/v1/usage/by-key"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pexafy.com/api/v1/usage/by-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.pexafy.com/api/v1/usage/by-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 => [
"x-api-key: <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.pexafy.com/api/v1/usage/by-key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.pexafy.com/api/v1/usage/by-key")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pexafy.com/api/v1/usage/by-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"keys": [
{
"key_id": "007BD937014346F18E37980984DD7254",
"name": "default",
"created_at": "2026-09-04T10:03:17+00:00",
"last_used_at": "2026-10-09T18:42:51+00:00",
"requests_this_month": 1987,
"requests_today": 0
},
{
"key_id": "DF056FA544D24B21955BBA90FE532A62",
"name": "blog-illustrator",
"created_at": "2026-10-02T14:27:40+00:00",
"last_used_at": "2026-10-14T16:05:09+00:00",
"requests_this_month": 1495,
"requests_today": 846
}
]
},
"meta": {
"request_id": "e2dd2976-fc40-4aed-960d-132acea88674",
"took_ms": 4.18
},
"error": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Pass your Pexafy API key in this header.
Get your API key at pexafy.com/dashboard/api-keys/create.
⌘I