Utilities

Usage API

Inspect your organization's current-month API usage, monthly trendline, endpoint breakdown, per-key activity, and recent latency metrics from a single authenticated endpoint.

Endpoint:/api/v1/usage
Method:GET
Auth:Authorization: ******

Month-to-date usage

Returns current usage versus plan limits, plus a six-month request history.

Endpoint analytics

See which endpoints are receiving traffic and compare average versus P99 latency.

Per-key breakdown

Identify which active API keys are generating usage so you can separate production from staging.

Example request

bash
curl -X GET "https://khaleejiapi.dev/api/v1/usage" \
-H "Authorization: ******"

This endpoint is authenticated. If you need a key first, start with Authentication.

Example response

json
{
"current": {
"requestsUsed": 1842,
"requestsLimit": 5000,
"percentUsed": 37,
"periodStart": "2026-08-01T00:00:00.000Z",
"periodEnd": "2026-08-31T00:00:00.000Z"
},
"plan": {
"name": "Starter",
"requestsPerMonth": 5000,
"requestsPerMinute": 30,
"price": 49
},
"monthlyData": [
{ "month": "Mar", "requests": 912 },
{ "month": "Apr", "requests": 1044 },
{ "month": "May", "requests": 1321 },
{ "month": "Jun", "requests": 1410 },
{ "month": "Jul", "requests": 1628 },
{ "month": "Aug", "requests": 1842 }
],
"endpointBreakdown": [
{ "endpoint": "/email/validate", "requests": 923 },
{ "endpoint": "/translate", "requests": 418 }
],
"apiKeyUsage": [
{ "id": "key_123", "name": "Production key", "requests": 1600 },
{ "id": "key_456", "name": "Staging key", "requests": 242 }
],
"avgResponseTime": 87,
"latencyByEndpoint": [
{ "endpoint": "/api/v1/email/validate", "avg": 62, "p99": 118, "count": 923 },
{ "endpoint": "/api/v1/translate", "avg": 411, "p99": 652, "count": 418 }
]
}

Response fields

FieldDescription
currentCurrent period usage, limits, and percentage consumed.
planPlan name, request quotas, and billing price reference.
monthlyDataSix-month request trend for charts and budget tracking.
endpointBreakdownRequest counts grouped by endpoint called this month.
apiKeyUsageRequest counts for each active API key in the organization.
latencyByEndpointAverage and P99 latency snapshots from recent audit logs.

Related docs

Debugging & Support

Include X-Request-ID when contacting support

Every response from KhaleejiAPI includes an X-Request-ID header — a unique identifier that lets our support team pull the exact log entry for your request within seconds. Always share it when reporting an unexpected error or unexpected result.

How to capture it

JavaScript / fetch

const res = await fetch("https://khaleejiapi.dev/api/v1/...", {
  headers: { Authorization: "******" },
});
const requestId = res.headers.get("x-request-id");
console.log("Request ID:", requestId);
// → e.g. "req_01j9xkz4vp8..."

cURL

curl -si "https://khaleejiapi.dev/api/v1/..." \
  -H "Authorization: ******" | grep -i x-request-id
# → x-request-id: req_01j9xkz4vp8...

Browser DevTools

Open DevTools (F12) → Network tab → click the failing request → scroll to the Response Headers section → copy the value next to x-request-id.

For a full list of error codes and guidance on common issues, see the Troubleshooting guide.