--- id: openfga-sdk version: "0.10.4" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openfga-sdk — A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. License: permissive · Maintenance: active · Downloads: 1.0M/mo ## 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 above — 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 pip install openfga-sdk uv add openfga-sdk poetry add openfga-sdk ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fine-grained authorization python, openfga sdk, zanzibar authorization, permission checking api, relationship-based access control, rebac python client, authorization model management, authorization, fine-grained-access-control, async-client [View on SkillFed](https://skillfed.io/packages/openfga-sdk) · [View on PyPI](https://pypi.org/project/openfga-sdk/)