The reason for the error is that my API was not associated to a Product. To fix this,
1. Open the Publisher Portal from 'Overview' option in the API Management blade
2. Navigate to the 'Products' tab and assign the API to a product
3. Now navigate to the Developer Portal and subscription key value is now set in the request header.