Version 1.2.0
What's new
OAuth 2.0 client-credentials authentication. You can now authenticate with OAuth instead of an API key:
# OAuth (recommended)
blaaiz = Blaaiz(
client_id=os.environ["BLAAIZ_CLIENT_ID"],
client_secret=os.environ["BLAAIZ_CLIENT_SECRET"],
# oauth_scope optional — defaults to all scopes
)
# Legacy API key (still works)
blaaiz = Blaaiz("your-api-key")The SDK fetches a token from /oauth/token using the client_credentials grant, caches it, refreshes it ~60s before expiry, and sends it as Authorization: Bearer.
Backward compatibility
- API-key auth (
x-blaaiz-api-key) is unchanged — existing code keeps working. - When both OAuth credentials and an API key are set, OAuth is preferred.