## Using Stripe API keys The Stripe CLI supports several different ways to set and use [API keys](/keys): 1. [`stripe login`](/cli/login) 2. [`stripe config`](/cli/config) 3. [`--api-key` flag](/cli/api_keys) 4. Environment variables Each supports a different use case. `stripe login` is the easiest and recommended way to get started. Running this command will prompt you to log in from your browser and persist your API key locally, rather than requiring it for each command. If you want to provide an API key manually, you can use `stripe login --interactive`. Using `stripe config` allows you to set persistent keys manually: - `stripe config --set test_mode_api_key sk_test_123` `--api-key` is a global flag that overrides your local configuration if you need to run one-off commands with a specific API key. You can set two environment variables, which take precedence over all other values: - `STRIPE_API_KEY`: the API key to use for the CLI. - `STRIPE_DEVICE_NAME`: the device name for the CLI, visible in the Dashboard.