Skip to content

Version 1.2.0

Choose a tag to compare

@Ishoshot Ishoshot released this 16 Jul 15:28
· 29 commits to main since this release
28f6cf2

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.