Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'mtenhanceprovider'

Please forgive me if anything is unclear, I'm new to SDL so I will try to clarify if anything is unclear.

I am creating an external application that can create a new Project, add files from a local directory, attach a TM, and fall back on the MT Enhance using Microsoft Translator. I've set up a Project Template, which uses the TM and the Automated Translation. Both working properly within the Studio application (with and without a category ID). However, when I use it through my application, it always fails at the Analyze Files task with this error:

{"Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'mtenhancedprovider:///?sendplaintextonly=False&selectedprovider=Microsoft+Translator&usecatid=False&catid=65c5ca74-d991-4f3f-9374-224861807990-en-US-es-MX-TMX-CUSTOM&resenddrafts=False&usepreedit=False&usepostedit=False&prelookupfilename=&postlookupfilename='.."}

I think I need to add something within the AnalysisTaskSettings but I'm not sure what or how. I tried adding credentials using the 'mtenahncedprovider:///' as the Uri and the API key as the credentials but I'm guessing that is incorrect. Any help would be greatly appreciated.