Skip to main content
Looking for usage documentation? Check out Classification and Regression.
Initializes the TabPFN client and authenticates with the TabPFN cloud service. Authentication is token-based and never interactive. The token comes from set_access_token() or the TABPFN_TOKEN environment variable, or from a token cached by an earlier interactive_login(). If none is available this raises, explaining how to obtain one — it will not prompt. Generate a token at https://platform.priorlabs.ai/account/api-keys, or call tabpfn_client.interactive_login() to log in through the browser.
Parameters
Raises RuntimeError If local inference is requested, if the server is unreachable, or if no valid access token is available.

interactive_login

View source
Log in or create an account interactively, returning the access token. This is opt-in. The default authentication path never calls it: init() uses TABPFN_TOKEN, set_access_token(), or a cached token, and raises with instructions when none is available. Offers two routes. Logging in opens the Prior Labs login page in a browser (or prints the URL when there is no display) and waits for the resulting API key. Creating an account runs entirely in the terminal, which is what makes this usable from a hosted notebook where a browser tab is not an option. On success the token is verified, cached for future runs, and installed as the active token, so a subsequent init() needs no further input.
Parameters
Returns
Raises InteractiveLoginError If no terminal is available, the flow was aborted, or the resulting token was rejected.

get_access_token

View source
Retrieves the current active access token. If the client is not yet initialized, this will trigger the init() login flow.
Returns
Raises RuntimeError If no access token is available after initialization.

set_access_token

View source
Manually sets the access token for the session. Use this in non-interactive environments (e.g. CI/CD, notebooks) as an alternative to the TABPFN_TOKEN environment variable. Generate a token at https://platform.priorlabs.ai/account/api-keys
Parameters

Resets the client state and clears local authentication caches. Use this function if you need to log out or clear stored session data from the local machine.