> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priorlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# Authentication

> Initialize the client, log in, and manage the current access token.

<Info>
  Looking for usage documentation? Check out [Classification](/capabilities/classification) and [Regression](/capabilities/regression).
</Info>

<div className="python-reference-heading">
  <h2 id="init">
    `init`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/config.py#L44" aria-label="View source for init"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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()`](/api-reference/python/tabpfn-client/authentication#set-access-token) or the TABPFN\_TOKEN environment variable, or from a
token cached by an earlier [`interactive_login()`](/api-reference/python/tabpfn-client/authentication#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](https://platform.priorlabs.ai/account/api-keys), or call
[`tabpfn_client.interactive_login()`](/api-reference/python/tabpfn-client/authentication#interactive-login) to log in through the browser.

```python theme={null}
init(
    use_server: bool = True,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="init-use-server" /><code className="python-reference-parameter">use\_<wbr />server</code> | <code className="python-reference-type">bool</code> | `True` | Whether to use the TabPFN cloud service. Currently, only `True` is supported. |
</div>

**Raises**

`RuntimeError`

If local inference is requested, if the server is
unreachable, or if no valid access token is available.

***

<div className="python-reference-heading">
  <h2 id="interactive-login">
    `interactive_login`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/interactive_auth.py#L387" aria-label="View source for interactive_login"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Log in or create an account interactively, returning the access token.

This is opt-in. The default authentication path never calls it: [`init()`](/api-reference/python/tabpfn-client/authentication#init)
uses TABPFN\_TOKEN, [`set_access_token()`](/api-reference/python/tabpfn-client/authentication#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()`](/api-reference/python/tabpfn-client/authentication#init) needs no further input.

```python theme={null}
interactive_login(
    *,
    force_relogin: bool = False,
    open_browser: bool = True,
    timeout: float = _CALLBACK_TIMEOUT_SECS,
) -> str
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="interactive-login-force-relogin" /><code className="python-reference-parameter">force\_<wbr />relogin</code> | <code className="python-reference-type">bool</code> | `False` | Run the login flow even when a working token is already available, for example to switch accounts. By default an existing token is returned as-is. |
  | <span id="interactive-login-open-browser" /><code className="python-reference-parameter">open\_<wbr />browser</code> | <code className="python-reference-type">bool</code> | `True` | Open the login page in a browser. When `False` (or when no display is detected) the URL is printed and you paste the API key instead. Does not affect signup, which never needs a browser. |
  | <span id="interactive-login-timeout" /><code className="python-reference-parameter">timeout</code> | <code className="python-reference-type">float</code> | `_CALLBACK_TIMEOUT_SECS` | Seconds to wait for the browser callback. The paste prompt stays available throughout. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type">str</code> | The access token. |
</div>

**Raises**

[`InteractiveLoginError`](/api-reference/python/tabpfn-client/exceptions#interactiveloginerror)

If no terminal is available, the flow was
aborted, or the resulting token was rejected.

***

<div className="python-reference-heading">
  <h2 id="get-access-token">
    `get_access_token`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/config.py#L128" aria-label="View source for get_access_token"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Retrieves the current active access token.

If the client is not yet initialized, this will trigger the [`init()`](/api-reference/python/tabpfn-client/authentication#init) login flow.

```python theme={null}
get_access_token() -> str
```

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type">str</code> | The access token string used for API requests. |
</div>

**Raises**

`RuntimeError`

If no access token is available after initialization.

***

<div className="python-reference-heading">
  <h2 id="set-access-token">
    `set_access_token`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/config.py#L146" aria-label="View source for set_access_token"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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](https://platform.priorlabs.ai/account/api-keys)

```python theme={null}
set_access_token(
    access_token: str,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="set-access-token-access-token" /><code className="python-reference-parameter">access\_<wbr />token</code> | <code className="python-reference-type">str</code> | Required | A valid TabPFN access token string. |
</div>

***

<div className="python-reference-heading">
  <h2 id="reset">
    `reset`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/config.py#L113" aria-label="View source for reset"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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.

```python theme={null}
reset()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.