Get started
Authentication
Authenticate every request with an environment API key.
API keys #
Every request to /v1/* and /usage must carry an API key. Each key belongs to one environment, and the prefix tells you which:
att_test_: Sandbox.att_live_: Production.
Send the key in the Authorization header with the Bearer scheme. The scheme word is case-sensitive and is followed by one space. If no Bearer header is present, attest reads the key from an x-api-key header instead.
Create, rotate, and revoke keys under API Keys in the dashboard. A key's full value is shown once, at creation. Store it in a secret manager or environment variable such as ATTEST_API_KEY.
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())){
"customer_id": "79e99bf5-9836-496a-a846-9533be1c4a16",
"environment_id": "1f7133e2-ec96-4c4c-89d1-ebdb7ca3dde3",
"verification_passes": 3,
"amount_usd": 0.003
}Failed authentication #
attest returns 401 with {"error": "Invalid API key"} when:
- no key is sent, or the key is unknown;
- the key was revoked, or replaced by rotation (rotating revokes the old key immediately);
- the key's environment, workspace, or account is not active.
{
"error": "Invalid API key"
}Routes without a key #
GET /.well-known/attest-signing-key, the proof inspector downloads, and GET /health are public and ignore any key you send.