Appearance
Any language (HTTP)
The FastAPI SDK is a convenience layer over three HTTP endpoints, the SDK API. From Node, Go, Rails, Laravel or anything else, you can do the same job with a few calls.
This page is for APIs you sell or run for your own teams. Sign in services use standard OAuth and OpenID Connect instead, described in the OAuth and OpenID Connect reference.
Authentication
Every call sends your API's SDK secret key, from the Connect tab:
http
Authorization: Bearer mas_...The base URL is https://api.microauth.com. Errors use application/problem+json with a detail you can show in logs. A rotated or wrong secret gets 401, and an API suspended by MicroAuth gets 403.
Keys are matched by hash
Your customers send their key (map_...) to your API. You never forward it to MicroAuth. You send its SHA-256 hex digest instead: 64 lowercase hex characters. The snapshot lists key hashes and the verify endpoint takes a key_hash.
The simple version
Two calls cover it. Before your handler runs, look up the key. After the response, report it.
bash
# 1. Check the key a request came with. Send its SHA-256, never the key.
HASH=$(printf %s "$CUSTOMER_KEY" | shasum -a 256 | cut -d' ' -f1)
curl -s "https://api.microauth.com/sdk/v1/keys/verify?key_hash=$HASH" \
-H "Authorization: Bearer $MICROAUTH_SECRET_KEY"
# 2. Report the request when it's done. Retrying with the same
# idempotency_key never bills twice.
curl -s -X POST "https://api.microauth.com/sdk/v1/usage" \
-H