Authorizing Access to Leap

Ocean’s SDK releases 6.6 and higher enable LeapTM authentication using the secure OAuth 2.0 industry standard. As described in the Configuring Access to Leap’s Solvers section, you require a Solver API (SAPI) token from your Leap account to submit problems to Leap solvers.


The OAuth-based authorization is provided for convenience but you also have the option of manually copying your SAPI token from Leap.

For any new developer environment (for example, a Python virtual environment or a GitHub Codespaces codespace), authorize Ocean’s access to your Leap account, using the secure OAuth 2.0 code exchange, by running one of the following Ocean CLI commands1 from your terminal. Ocean authorization to access Leap is persisted across subsequent development sessions for this development environment.

  • In an environment such as an IDE installed on your system, where you can access localhost addresses from your browser, initiate the OAuth redirect flow:

    dwave auth login
  • In an environment such as a cloud IDE, where access to localhost addresses from your browser might be blocked, you can initiate the alternative OAuth out-of-band flow:

    dwave auth login --oob

A page opened in your browser will lead you through the authorization procedure.


You can see help documentation for Ocean CLI commands and all their options with the CLI’s --help option.