SAML SSO enabled but API calls still need OAuth client credentials?

We’ve recently locked down our Genesys Cloud org by enforcing SAML SSO for all user logins. The web UI works fine now, everyone gets redirected to our IdP, and the login flow is solid.

The issue is with our backend automation scripts. I’m trying to write a Python script using the genesyscloud SDK to pull some routing stats, but I’m confused about the authentication flow. Since we’re using SAML, do I still need to create a separate OAuth client credential pair just for the API? It feels redundant to manage two auth methods.

Right now, I’m trying to use the user’s SAML session token in the API header, but I keep getting a 401 Unauthorized error. Here’s the basic setup I’m using:

from platform_sdk import PlatformClient

config = PlatformClient.new_config()
config.host = 'https://api.mypurecloud.com'
config.access_token = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...' # Copied from browser dev tools

client = PlatformClient(config)
try:
 user = client.users.get_user(123456)
except Exception as e:
 print(f"Failed: {e}")

The error message says invalid_grant or invalid_token. Is this because the JWT from the SAML flow isn’t valid for the API? Or is there a specific endpoint I should be hitting to exchange the SAML assertion for an API token? I haven’t found clear docs on bridging these two.