> ## 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.

# Usage and costs

> Estimate an operation and inspect hosted API credit usage.

> [!NOTE]
>
> Looking for usage documentation? Check out [Classification](https://docs.priorlabs.ai/capabilities/classification.md), [Thinking mode](https://docs.priorlabs.ai/capabilities/thinking-mode.md) and [KV cache](https://docs.priorlabs.ai/capabilities/kv-cache.md).

## `estimate_cost`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/cost.py#L32)

Estimate one operation without uploading data or consuming quota.

Only raw row/column counts and the supplied configuration are sent. The
server resolves omitted model/ensemble defaults and returns them in
`result.inputs` alongside `estimated_cost` and `pricing_version`.
Quota v3 must be enabled on the server. Costs are tokens for `quota_v3`
and legacy cell-prediction credits for `legacy_v2`.

`thinking_fit` takes no `X_test`; its default effort is medium. For
`thinking_predict`, supply the fitted model's version and actual
per-base-estimator count. `cache_predict` assumes a cache hit; fallback
or different fitted estimator counts can change the final charge.
A quote does not guarantee model access or dataset eligibility.

```python theme={null}
estimate_cost(
    X_train: np.ndarray | pd.DataFrame,
    X_test: np.ndarray | pd.DataFrame | None = None,
    *,
    model_version: str | None = None,
    operation: Literal["predict", "thinking_fit", "thinking_predict", "cache_predict"] = "predict",
    n_estimators: int | None = None,
    thinking_effort: ThinkingEffort | None = None,
) -> EstimateCostResponse
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `X_train` | `np.ndarray \| pd.DataFrame` | Required | Training data; only its shape is used. |
| `X_test` | `np.ndarray \| pd.DataFrame \| None` | `None` | Test data; only its shape is used. Omit for `thinking_fit`. |
| `model_version` | `str \| None` | `None` | Model version to price. Resolved by the server if `None`. |
| `operation` | `Literal["predict", "thinking_fit", "thinking_predict", "cache_predict"]` | `"predict"` | Operation to price. |
| `n_estimators` | `int \| None` | `None` | Number of estimators. Resolved by the server if `None`. |
| `thinking_effort` | `ThinkingEffort \| None` | `None` | Effort level for thinking operations. |

**Returns**

| Type | Description |
| - | - |
| `EstimateCostResponse` | The server's cost estimate. |

**Raises**

`ValueError`

If an input is not two-dimensional or has invalid row or
feature counts, if `X_train` and `X_test` differ in feature count, if
`X_test` is given for `thinking_fit`, or if `n_estimators` is not a
positive integer.

***

## `EstimateCostResponse`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/api_models.py#L516)

**Fields**

| Name | Type | Default | Description |
| - | - | - | - |
| `estimated_cost` | `int` | Required | Tokens the operation is charged. For thinking\_fit, the most it can be charged: the effort level's fit time limit at the GPU-second rate, which is reserved at submit. The settled charge is the measured fit time at the same rate, up to this amount and at least the minimum charge. |
| `pricing_version` | `str` | Required | — |
| `inputs` | `EstimateCostRequest` | Required | — |

***

## `EstimateCostRequest`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/api_models.py#L217)

***

## `QuotaOperation`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/api_models.py#L210)

***

## `get_api_usage`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/config.py#L161)

Fetches and formats the current API usage statistics for the user.

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

**Returns**

| Type | Description |
| - | - |
| `str` | A human-readable string detailing current credit usage, the total limit, and when the limit resets. |


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