I have no idea, how to properly test this, so its untested code, but maybe it helps.
Deepl docs claim:
Header-based authentication is the preferred method of authentication, and overrides the auth_key parameter.
New API functions added in the future will only support the header-based authentication.
I have no idea, how to properly test this, so its untested code, but maybe it helps. Deepl docs claim: