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

# Estimate Data Loading

> Estimate the time and cost of a data-loading job before submitting it.

Use this tool to size a data-loading run up front, for example to choose a
qubit count or layer count that fits a time budget. It creates no job and
spends no credits.

When to Use:
    - Call this before ``load_classical_data_with_data_loading`` when the user
      asks how long loading will take or what it will cost.
    - Call this to compare qubit or layer counts before committing to one.

Constraints:
    - Only ``DistributionLoading`` and ``VectorLoading`` have resource models.
      Other modes accepted by ``load_classical_data_with_data_loading`` cannot
      be estimated and are rejected with ``422``.
    - The estimate depends only on ``num_qubits`` and ``num_layers``; the
      actual data payload does not change it.

Notes:
    - Report the estimate in seconds and credits, and state plainly that it
      is an estimate rather than a quote.

Args:
    user: Authenticated user resolved from the API key.
    data: Loading mode, qubit count, and mode parameters to estimate.

Returns:
    The estimated time and cost with an explanatory context string.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json post /ai/estimate_data_loading
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.5.0
servers: []
security: []
paths:
  /ai/estimate_data_loading:
    post:
      summary: Estimate Data Loading
      description: >-
        Estimate the time and cost of a data-loading job before submitting it.


        Use this tool to size a data-loading run up front, for example to choose
        a

        qubit count or layer count that fits a time budget. It creates no job
        and

        spends no credits.


        When to Use:
            - Call this before ``load_classical_data_with_data_loading`` when the user
              asks how long loading will take or what it will cost.
            - Call this to compare qubit or layer counts before committing to one.

        Constraints:
            - Only ``DistributionLoading`` and ``VectorLoading`` have resource models.
              Other modes accepted by ``load_classical_data_with_data_loading`` cannot
              be estimated and are rejected with ``422``.
            - The estimate depends only on ``num_qubits`` and ``num_layers``; the
              actual data payload does not change it.

        Notes:
            - Report the estimate in seconds and credits, and state plainly that it
              is an estimate rather than a quote.

        Args:
            user: Authenticated user resolved from the API key.
            data: Loading mode, qubit count, and mode parameters to estimate.

        Returns:
            The estimated time and cost with an explanatory context string.
      operationId: estimate_data_loading
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContextDataLoadingEstimatesSubmitModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextEstimatesModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    ContextDataLoadingEstimatesSubmitModel:
      properties:
        dl_type:
          type: string
          enum:
            - DistributionLoading
            - VectorLoading
          title: Dl Type
          description: >-
            Data loading mode to estimate. Only `DistributionLoading` and
            `VectorLoading` have resource models; the other modes accepted by
            `load_classical_data_with_data_loading` cannot be estimated yet.
        num_qubits:
          type: integer
          minimum: 1
          title: Num Qubits
          description: Target qubit count for the loaded state.
        parameters:
          additionalProperties: true
          type: object
          title: Parameters
          description: >-
            Mode-specific parameters. Only `num_layers` currently affects the
            estimate.
      type: object
      required:
        - dl_type
        - num_qubits
      title: ContextDataLoadingEstimatesSubmitModel
      description: |-
        Define payload for estimating a data-loading job.

        Attributes:
            dl_type: Data-loading mode. Only the two modes with resource models
                implemented are accepted.
            num_qubits: Target qubit count for the loaded state.
            parameters: Mode-specific parameters; only ``num_layers`` affects the
                estimate today.
      examples:
        - dl_type: DistributionLoading
          num_qubits: 12
          parameters:
            num_layers: 3
        - dl_type: VectorLoading
          num_qubits: 8
          parameters:
            num_layers: 2
    ContextEstimatesModel:
      properties:
        estimated_time:
          type: number
          title: Estimated Time
        estimated_cost:
          type: number
          title: Estimated Cost
        context:
          type: string
          title: Context
      type: object
      required:
        - estimated_time
        - estimated_cost
        - context
      title: ContextEstimatesModel
      description: |-
        Represent a pre-submission time and cost estimate.

        Attributes:
            estimated_time: Estimated wall-clock computation time in seconds.
            estimated_cost: Estimated cost in Haiqu credits.
            context: Summary of what the estimate covers and how to act on it.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````