Skip to main content

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/authorize directly. 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

SDKInstallRepo
Gogo get github.com/authzx/authzx-gogithub.com/authzx/authzx-go
Node.jsnpm install @authzx/sdkgithub.com/authzx/authzx-node
Pythonpip install authzxgithub.com/authzx/authzx-python
CLIgo install github.com/authzx/authzx-cli/cmd/authzx@latestgithub.com/authzx/authzx-cli
Terraformsource = "authzx/authzx" in required_providersregistry.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:

ErrorMeaning
401Invalid or missing API key
403Forbidden
404Endpoint not found
429Rate limited
5xxServer error (auto-retried)

SDKs automatically retry on 5xx and 429 errors (default: 2 retries with backoff).