SDKs & CLI
AuthzX provides official SDKs for Go, Node.js, and Python, a CLI for quick testing and automation, and a Terraform provider for managing your authorization model as infrastructure as code.
Two modes
All SDKs work in two modes with the same API:
- Cloud mode — SDK calls
api.authzx.com/v1/authorizedirectly. No infrastructure needed. - Agent mode — SDK calls your local AuthzX Agent at
localhost:8181. Policies sync from cloud, decisions stay on your infra.
// Cloud
client = new AuthzX({ apiKey: "azx_..." })
// Agent (local)
client = new AuthzX({ baseUrl: "http://localhost:8181" })
Available SDKs
| SDK | Install | Repo |
|---|---|---|
| Go | go get github.com/authzx/authzx-go | github.com/authzx/authzx-go |
| Node.js | npm install @authzx/sdk | github.com/authzx/authzx-node |
| Python | pip install authzx | github.com/authzx/authzx-python |
| CLI | go install github.com/authzx/authzx-cli/cmd/authzx@latest | github.com/authzx/authzx-cli |
| Terraform | source = "authzx/authzx" in required_providers | registry.terraform.io/providers/authzx/authzx |
Common API
Every SDK exposes the same two methods:
check(subject, action, resource) → bool
Quick yes/no authorization check.
authorize(request) → response
Full authorization with reason, policy ID, and access path.
Error handling
All SDKs throw structured errors with status codes:
| Error | Meaning |
|---|---|
401 | Invalid or missing API key |
403 | Forbidden |
404 | Endpoint not found |
429 | Rate limited |
5xx | Server error (auto-retried) |
SDKs automatically retry on 5xx and 429 errors (default: 2 retries with backoff).