Need help on generating the authorization header for GOTIT AI - translator API

I tried the code snippets for generating the authorization header and it’s returning internal server error code -500