The username must be the literal string API_KEY, and the password is your personal key. You wrote “Username: API_KEY” and “Password: my personal API key”, which sounds right, but the 401 suggests the actual request isn’t using that format.
In Python requests, you need Basic Auth, not Bearer:
The key detail: auth=("API_KEY", API_KEY) means the username is literally the string "API_KEY" (not your athlete ID, not a variable), and the password is your actual key from Settings .
If you’re still getting 401 after that, double-check you haven’t accidentally set a Bearer header somewhere else in your code, since that will override Basic Auth .