--- id: coze-workload-identity version: "0.1.14" license: MIT license_treatment: permissive maintenance: active --- # coze-workload-identity — Python SDK for Coze workload identity authentication License: permissive · Maintenance: active · Downloads: 84.5K/mo ## What it is and what it does Coze Workload Identity SDK is a Python client for authenticating with Coze services using OAuth2.0 token exchange. It manages the two-step flow of obtaining an ID token via client credentials grant, then exchanging it for an access token, with automatic process-level caching that refreshes tokens one minute before expiration. The SDK provides thread-safe token management, support for multiple deployment environments (BOE, PPE, custom), integration credential retrieval, project environment variable access, and configurable HTTPS proxy with custom CA certificate support. It requires Python 3.8 or later and depends only on requests and urllib3. Use it for: - Authenticate microservices or background jobs to Coze APIs without managing token lifecycle manually. - Retrieve integration credentials and project environment variables from Coze in a single authenticated session. - Deploy multi-threaded applications that share a single cached token across worker threads. - Route requests through corporate proxies with custom CA certificates while maintaining authentication. - Switch between development (BOE), staging (PPE), and production environments via environment variables. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements OAuth2.0 token exchange authentication for Coze workload identity, handling ID token retrieval and access token exchange with automatic caching and thread-safe operation. Yes, if you are building Python applications that integrate with Coze services. The SDK handles OAuth2 token exchange transparently with automatic caching and thread safety, requires minimal setup beyond environment variables, and carries no security vulnerabilities. The low dependency footprint and permissive MIT license make it a straightforward addition to any Coze-dependent project. ## Install pip install coze-workload-identity uv add coze-workload-identity poetry add coze-workload-identity ## Installing coze-workload-identity Before you install: Low install friction with only two runtime dependencies (requests, urllib3). Active maintenance status with a recent release. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal obligations. Quickstart: pip install coze-workload-identity from coze_workload_identity import Client with Client() as client: token = client.get_access_token() Requires environment variables COZE_WORKLOAD_IDENTITY_CLIENT_ID, COZE_WORKLOAD_IDENTITY_CLIENT_SECRET, COZE_WORKLOAD_IDENTITY_TOKEN_ENDPOINT, and COZE_WORKLOAD_ACCESS_TOKEN_ENDPOINT to be set. Verify before relying: - Whether the package is actively maintained beyond the 45 days since last release. - Real-world performance and reliability of token caching under high concurrency. - Completeness of error handling for network failures and edge cases. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 84.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags oauth2 token exchange, workload identity authentication, coze sdk python, oauth2 client credentials, token caching and refresh, thread-safe token management, coze api authentication, oauth2, authentication, coze [View on SkillFed](https://skillfed.io/packages/coze-workload-identity) · [View on PyPI](https://pypi.org/project/coze-workload-identity/)