Adjust output volume for external API

What’s the best way to programmatically adjust the output volume for the external API?