API reference
Retrieve usage
Returns the all-time Verification Pass total and accrued amount for the key's environment.
GET/usageSandbox and Production differ
Overview #
Returns the all-time Verification Pass total and accrued amount for the key's environment.
Authenticate with an environment API key in the Authorization: Bearer header. See Authentication.
Environments. Sandbox amounts accrue at the unit price for visibility but are never billed.
curl https://attestinfra.com/usage \
-H "Authorization: Bearer $ATTEST_API_KEY"const response = await fetch("https://attestinfra.com/usage", {
headers: {
Authorization: `Bearer ${process.env.ATTEST_API_KEY}`,
},
});
console.log(response.status, await response.json());import json, os, urllib.request
request = urllib.request.Request(
"https://attestinfra.com/usage",
headers={
"Authorization": "Bearer " + os.environ["ATTEST_API_KEY"],
},
)
with urllib.request.urlopen(request) as response:
print(response.status, json.loads(response.read()))Parameters #
This endpoint takes no parameters.
Response #
200 Usage totals.
Response fields #
| Field | Type | Description |
|---|---|---|
customer_id | string | Your account identifier. |
environment_id | string | The environment the key belongs to. |
verification_passes | integer | All-time Verification Passes in this environment. |
amount_usd | number | verification_passes multiplied by the unit price, rounded to 4 decimal places. |
{
"customer_id": "79e99bf5-9836-496a-a846-9533be1c4a16",
"environment_id": "1f7133e2-ec96-4c4c-89d1-ebdb7ca3dde3",
"verification_passes": 3,
"amount_usd": 0.003
}Errors #
| Status | error | code | Meaning |
|---|---|---|---|
401 | Invalid API key | — | The API key is missing, unknown, revoked, or belongs to an environment that is not active. |
All error bodies and their causes are listed in Errors.
{
"error": "Invalid API key"
}