API key contains $ character so when passed to CLI using -a option as double-quoted value, shell tries to performs variable expansion and API key gets corrupted.
Check whether API contains $, and if it doesn't, abort the operation and give user a hint to use single quotes rather than double quotes for API key