openfga-sdk
A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.
What it is and what it does
The openfga-sdk is an autogenerated Python wrapper around the OpenFGA API, a fine-grained authorization engine inspired by Google's Zanzibar. It provides an async client for managing authorization stores, models, and relationship tuples, and for performing authorization checks (including batch checks), expansions, and queries. The SDK handles credential flows (API token, client credentials, OAuth2), retries failed requests automatically, and integrates with OpenTelemetry for observability.
You initialize a single OpenFgaClient with your API endpoint and credentials, then use it to read/write authorization models, manage relationship tuples (the core permission data), and run authorization queries like checking whether a user has a specific permission. The client is designed for reuse across your application to avoid initialization overhead and maximize connection pooling.
Use it for:
- Implement role-based or relationship-based access control (RBAC/ReBAC) in a web application by checking permissions before granting access to resources.
- Manage complex permission hierarchies where permissions depend on relationships between users, roles, and resources.
- Batch-check permissions for multiple user-resource pairs in a single operation to reduce API call overhead.
- Query authorization models to expand what permissions a user has or list all objects they can access.
- Integrate fine-grained authorization into microservices by centralizing permission logic in OpenFGA and querying it from multiple services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for OpenFGA that wraps the OpenFGA API, enabling fine-grained authorization checks, relationship tuple management, and authorization model operations through an async client.
Yes. The SDK is actively maintained, has no known vulnerabilities, installs with low friction, and is licensed permissively. It is the canonical Python client for OpenFGA and suitable for production use if you are already running or planning to run an OpenFGA authorization service. Install it only if you have an OpenFGA instance to connect to.
Install
openfga-sdk on PyPI
pip
pip install openfga-sdkuv
uv add openfga-sdkpoetry
poetry add openfga-sdkInstalling openfga-sdk
Before you install
Low friction install with a pure-Python wheel and four lightweight runtime dependencies. The package is actively maintained with a recent release 46 days ago and supports current Python versions (3.10–3.14).
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install openfga_sdk
from openfga_sdk import ClientConfiguration, OpenFgaClient
async def main():
config = ClientConfiguration(api_url="https://api.fga.example", store_id="store_id")
async with OpenFgaClient(config) as client:
models = await client.read_authorization_models()
return models
Requires Python 3.10 or later; async/await syntax required; OpenFGA API endpoint and store ID must be configured.
Verify before relying
- Exact scope of OpenTelemetry integration and what observability signals are exported.
- Performance characteristics and latency impact of the default retry strategy (up to 3 retries on 429/5xx).
- Whether connection pooling behavior is configurable or automatic via aiohttp.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aiohttp, opentelemetry-api, python-dateutil, urllib3 |
| Maintenance | actively maintained — 46 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,020,393/month — #4,494 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openfga_sdk-0.10.4-py3-none-any.whl
Keywords: authorization, fga, fine-grained-authorization, openfga, rebac, zanzibar
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
django-oauth-toolkitAdds OAuth2 authorization server capabilities…
permissive · top 5,000 on PyPI
aws-s3-access-grants-boto3-pluginA boto3 plugin that integrates AWS S3 Access…
unclear · top 15,000 on PyPI
oneloginOfficial Python SDK for OneLogin's API,…
unclear · top 15,000 on PyPI
django-oidc-providerProvides OpenID Connect and OAuth 2.0 server…
permissive · top 15,000 on PyPI
pydata-google-authProvides helper functions to authenticate to…
permissive · top 1,000 on PyPI
coze-workload-identityImplements OAuth2.0 token exchange…
permissive · top 15,000 on PyPI
pyopImplements an OpenID Connect Provider (OP)…
permissive · top 15,000 on PyPI
google-oauthImplements Google OAuth2 authentication for…
permissive · top 15,000 on PyPI
ovhLightweight Python wrapper for OVHcloud APIs…
permissive · top 15,000 on PyPI