This code does the magic:
var params = { keyId: 'STRING_VALUE', keyType: 'STRING_VALUE', usagePlanId: 'STRING_VALUE' }; apigateway.createUsagePlanKey(params, function(err, data) { if (err) console.log(err, err.stack);
What I was missing was that keyType should be "API_KEY"
source share