You can either set the flag manually in the API definition object (non pro) - see auth section in this doc:
https://tyk.io/docs/tyk-api-gateway-v-2-0/api-management/api-definition-objects/
Or in the dashboard, in the API designer, at the bottom of the first screen, you can set the location of the key (query string or header)