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

# Estimate token cost

> Estimate an existing operation from raw input dimensions without consuming quota or reserving capacity. Thinking prediction requires the fitted model family and actual per-base-estimator count. Cache estimates assume a hit; fallback and the actual estimator count can change the final charge. Available when quota v3 is enabled. For TabPFN-3.5-Thinking, a thinking_fit estimate is the maximum reservation for the selected effort. The final charge uses measured fit time, subject to a minimum charge and the reservation cap. An estimate does not reserve tokens or guarantee sufficient remaining quota.



## OpenAPI

````yaml /api-reference/openapi.json post /tabpfn/estimate_cost
openapi: 3.1.0
info:
  title: TabPFN API
  description: >-
    TabPFN REST API. For Python applications, use
    [tabpfn-client](/api-reference/overview). See the [REST
    quickstart](/api/rest-quickstart) for authentication and the upload, fit,
    and predict flow.
  version: 2.0.0
  contact:
    name: Prior Labs
    email: hello@priorlabs.ai
servers:
  - url: https://api.priorlabs.ai
    description: Production TabPFN API
security:
  - BearerAuth: []
paths:
  /tabpfn/estimate_cost:
    post:
      tags:
        - Metering
      summary: Estimate token cost
      description: >-
        Estimate an existing operation from raw input dimensions without
        consuming quota or reserving capacity. Thinking prediction requires the
        fitted model family and actual per-base-estimator count. Cache estimates
        assume a hit; fallback and the actual estimator count can change the
        final charge. Available when quota v3 is enabled. For
        TabPFN-3.5-Thinking, a thinking_fit estimate is the maximum reservation
        for the selected effort. The final charge uses measured fit time,
        subject to a minimum charge and the reservation cap. An estimate does
        not reserve tokens or guarantee sufficient remaining quota.
      operationId: tabpfn_estimate_cost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateCostRequest'
            example:
              model_version: v4
              operation: predict
              train_rows: 10000
              test_rows: 1000
              raw_columns: 20
              n_estimators: 4
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateCostResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EstimateCostRequest:
      additionalProperties: false
      properties:
        train_rows:
          maximum: 2147483647
          minimum: 1
          title: Train Rows
          type: integer
        raw_columns:
          maximum: 2147483647
          minimum: 1
          title: Raw Columns
          type: integer
        test_rows:
          default: 0
          maximum: 2147483647
          minimum: 0
          title: Test Rows
          type: integer
        model_version:
          $ref: '#/components/schemas/ModelVersion'
          default: v3.5
        operation:
          $ref: '#/components/schemas/QuotaOperation'
          default: predict
        n_estimators:
          default: 8
          maximum: 2147483647
          minimum: 1
          title: N Estimators
          type: integer
        thinking_effort:
          anyOf:
            - type: string
              enum:
                - micro
                - mini
                - low
                - medium
                - high
                - xhigh
                - max
            - type: 'null'
          title: Thinking Effort
      required:
        - train_rows
        - raw_columns
      title: EstimateCostRequest
      type: object
    EstimateCostResponse:
      additionalProperties: false
      properties:
        estimated_cost:
          description: >-
            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.
          title: Estimated Cost
          type: integer
        pricing_version:
          title: Pricing Version
          type: string
        inputs:
          $ref: '#/components/schemas/EstimateCostRequest'
      required:
        - estimated_cost
        - pricing_version
        - inputs
      title: EstimateCostResponse
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        message:
          description: What went wrong.
          title: Message
          type: string
        error_code:
          default: GENERAL_ERROR
          description: Machine-readable error category, such as `BUSY`.
          title: Error Code
          type: string
          x-sdk-keep-default: true
        trace_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: Id to quote when reporting the error.
          title: Trace Id
      required:
        - message
      title: ErrorResponse
      type: object
    ModelVersion:
      enum:
        - v2
        - v2.5
        - v2.6
        - v3
        - v3.5
        - v3.5-fast
        - v4
      title: ModelVersion
      type: string
    QuotaOperation:
      enum:
        - predict
        - thinking_predict
        - thinking_fit
        - cache_predict
      title: QuotaOperation
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token for authentication, obtained after signing up and
        generating an API key.

````

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