Is there a way to script the entire installation of CA API Gateway servers?
I assume you're talking about appliance gateway, the document below should help,
Auto-Provision a Gateway - CA API Gateway - 9.4 - CA Technologies Documentation