Replace the `api_key` argument with a hash of options

This change should be backwards compatible.