API Reference / Account
Get your balance
GET/v1/credits
Returns your plan, your available credits and the credits held by checks that are still running. On the unlimited plan unlimited is true and available is null. Requires scope credits:read.
Authentication
Send your API key as Authorization: Bearer <your API key>.
Headers
| Name | Type | Details |
|---|---|---|
Authorizationrequired | string |
|
Response
200 Success.
request_idstringrequiredobjectstringrequiredalways
"credits"planstringrequiredYour plan.
One of:
free,unlimitedunlimitedbooleanrequiredtrue on the unlimited plan: checks use no credits and
availableis null.availableinteger or nullrequiredCredits you can use; null on the unlimited plan.
reservedintegerrequiredCredits held by checks that are still running.
price_per_operationintegerrequiredCredits one completed check uses (0 on the unlimited plan).
Example response
{
"request_id": "req_8f14e45fceea167a5a36dedd",
"object": "credits",
"plan": "free",
"unlimited": false,
"available": 1000,
"reserved": 0
}Errors
| Status | Meaning |
|---|---|
| 401 | The API key is missing, invalid or revoked. |
| 403 | The key lacks the required scope, the email address is not verified, or the account is suspended. |
| 429 | Too many requests or too many operations at the same time. Wait for the number of seconds in Retry-After. |
| 500 | Something went wrong on our side. No credits were used. |
Error bodies share one shape with a stable error.code; see Errors for every code and how to fix it.
Code samples
curl "https://platform.detectif.ai/v1/credits" \
-H "Authorization: Bearer $DETECTIF_API_KEY"import os
import requests
resp = requests.get(
"https://platform.detectif.ai/v1/credits",
headers={"Authorization": f"Bearer {os.environ['DETECTIF_API_KEY']}"},
timeout=30,
)
print(resp.status_code, resp.json())const res = await fetch("https://platform.detectif.ai/v1/credits", {
headers: {
Authorization: `Bearer ${process.env.DETECTIF_API_KEY}`,
},
});
console.log(res.status, await res.json());