Skip to main content


1. Install the Anyscale CLI

Install it from pip.

pip install anyscale

2. Authentication

Anyscale authenticates API requests using a token, which can be issued either via anyscale login command in the CLI or via Generate API Token.

  • Use anyscale login The CLI command fetches and updates the token in the local credential file (~/.anyscale/credentials.json). The CLI will use this token to authenticate its requests. This is recommended for interactive development.

  • Use ANYSCALE_CLI_TOKEN environment variable Manually generate your API Token here and set it in this environment variable. The CLI checks the environment variable first before the credentials file. This is recommended for CI/CD integration and other production use case.


Tokens issued by anyscale login expire after 7 days. If you want them to persist longer or not to expire, use --expire-in-days=<# of days> or --no-expire flags.


Be sure to keep your auth token private and secure to prevent unwanted access to your Anyscale resources.

3. Test it out

To verify that everything is working, try listing the clusters you have access to.

anyscale cluster list

If the authentication is working, you shouldn't see any error related to permissions.

4. Next Steps

You have successfully set up the Anyscale CLI, you can start interacting with Anyscale from your terminal. If you have questions about how to use Anyscale CLI commands, check out the reference.