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

# Estimate pipeline cost

> Return expected and maximum costs for the current graph and attached dataset. Optional `itemLimit` and `itemFilter` override the Start node settings for this estimate. No run is started.



## OpenAPI

````yaml /api-reference/openapi.json post /pipelines/{pipelineId}/cost-estimate
openapi: 3.1.0
info:
  description: >-
    Manage projects, datasets, labeling pipelines, and model training. **Beta:**
    endpoints, request and response shapes, and error contracts can change
    without notice or a backward-compatibility promise.
  title: Toloka Platform API
  version: 2.0.0
servers:
  - url: https://platform.toloka.ai/api/v2-beta
security:
  - apiKeyAuth: []
  - scopedTokenAuth: []
tags:
  - description: The authenticated API key owner.
    name: Account
  - description: A project is the container for pipelines, datasets, and files.
    name: Projects
  - description: Rows and typed fields. Field schemas are immutable once created.
    name: Datasets
  - description: Append rows to a dataset from a file.
    name: Dataset uploads
  - description: Read a dataset out as a file.
    name: Dataset exports
  - description: A pipeline is a graph of nodes that processes each dataset item.
    name: Pipelines
  - description: The nodes, connections, fields, and version of a pipeline graph.
    name: Pipeline graph
  - description: Execute a pipeline over a dataset and inspect each item.
    name: Runs
  - description: Per-node checks that a pipeline must pass before deployment.
    name: Checks
  - description: Named credentials available to pipeline code.
    name: Secrets
  - description: Project files available to pipeline code and labeling interfaces.
    name: Files
  - description: >-
      Global, read-only catalog of the models a synthetic generation node can
      use, with their budget bounds.
    name: Generation models
  - description: >-
      Global, read-only catalog of the expert audience: the values a node
      `audience` filter can use.
    name: Audience
  - description: >-
      Project lists of experts a node can take its workforce from with
      `audienceMode: service`. Available only to teams with the audience service
      enabled.
    name: Expert lists
  - description: >-
      Experts banned in a project: they cannot be invited and are removed from
      the work they are in. Available only to teams with expert bans enabled.
    name: Expert ban list
  - description: Global, read-only base model catalog.
    name: Base models
  - description: Project-owned mutable model-training drafts.
    name: Trainings
  - description: Project-owned Models and immutable Model Versions.
    name: Models
  - name: Batch inference
paths:
  /pipelines/{pipelineId}/cost-estimate:
    post:
      tags:
        - Pipelines
      summary: Estimate pipeline cost
      description: >-
        Return expected and maximum costs for the current graph and attached
        dataset. Optional `itemLimit` and `itemFilter` override the Start node
        settings for this estimate. No run is started.
      operationId: estimatePipelineCost
      parameters:
        - in: path
          name: pipelineId
          required: true
          schema:
            $ref: '#/components/schemas/PipelineId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                itemFilter:
                  additionalProperties: false
                  description: >-
                    Filter selecting items to price. Defaults to the Start
                    node's `itemFilter`.
                  properties:
                    createdBefore:
                      description: >-
                        Cutoff for dataset items and field revisions, as an ISO
                        8601 timestamp; omit to use the endpoint's cutoff.
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                      type: string
                    excludeParts:
                      $ref: '#/components/schemas/DatasetSplitPartExclusions'
                    fieldSources:
                      $ref: '#/components/schemas/DatasetFieldSourceConditions'
                    fieldValues:
                      $ref: '#/components/schemas/DatasetFieldValueConditions'
                    missingRevisionFields:
                      description: >-
                        Field IDs with prefix `df.` that must have no revision
                        on a selected row; defaults to an empty array.
                      items:
                        pattern: >-
                          ^df\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                        type: string
                      type: array
                    parts:
                      $ref: '#/components/schemas/DatasetSplitPartInclusion'
                    slice:
                      $ref: '#/components/schemas/DatasetSliceSelection'
                  type: object
                itemLimit:
                  description: >-
                    Maximum number of items to price. Defaults to the Start
                    node's `itemLimit`, or all matching items if no limit is
                    set.
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                  type: integer
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineCostEstimate'
          description: Cost estimate
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '400':
          description: Pipeline has no dataset attached or the graph is missing a root node
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '404':
          description: Pipeline not found
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '429':
          description: Rate limit exceeded
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
      x-codeSamples:
        - label: TypeScript SDK
          lang: typescript
          source: |
            import { createClient } from "@toloka-platform/sdk";

            const client = createClient({
              baseUrl: "https://platform.toloka.ai",
              apiKey: process.env.TOLOKA_API_KEY!,
            });

            const estimate = await client.pipelines.estimateCost({
              pipelineId: "pl.019a0000-0000-7000-8000-000000000001",
              itemLimit: 100
            });
            console.log(estimate);
components:
  schemas:
    PipelineId:
      description: Pipeline ID with prefix `pl.`.
      pattern: >-
        ^pl\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    DatasetSplitPartExclusions:
      description: Split-part selections to exclude; omit when no parts should be excluded.
      items:
        additionalProperties: false
        description: Split field and selected part names.
        properties:
          fieldId:
            description: Split field ID with prefix `df.`.
            pattern: >-
              ^df\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
            type: string
          names:
            description: Names of the split parts to select.
            items:
              maxLength: 64
              pattern: ^[A-Za-z0-9_]+(?:[.-][A-Za-z0-9_]+)*$
              type: string
            maxItems: 10
            minItems: 1
            type: array
        required:
          - fieldId
          - names
        type: object
      maxItems: 500
      type: array
    DatasetFieldSourceConditions:
      description: >-
        Field-author conditions that selected rows must satisfy; defaults to no
        conditions.
      items:
        additionalProperties: false
        description: Required authors for a field.
        properties:
          fieldId:
            description: Dataset field ID with prefix `df.`.
            pattern: >-
              ^df\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
            type: string
          sources:
            description: Revision authors to match for this field.
            items:
              $ref: '#/components/schemas/FieldRevisionSource'
            minItems: 1
            type: array
        required:
          - fieldId
          - sources
        type: object
      type: array
    DatasetFieldValueConditions:
      description: >-
        Field-value conditions that selected rows must satisfy; defaults to no
        conditions.
      items:
        additionalProperties: false
        description: Condition applied to a field value.
        properties:
          fieldId:
            description: Dataset field ID with prefix `df.` to compare.
            pattern: >-
              ^df\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
            type: string
          jsonPath:
            description: JSONPath locating the value within the field.
            minLength: 1
            type: string
          latestOnly:
            default: true
            description: >-
              Whether to test only the latest revision from the allowed authors;
              false tests any revision, and the default is true.
            type: boolean
          operator:
            description: >-
              Text comparison: `text_eq` for equality or `text_neq` for
              inequality.
            enum:
              - text_eq
              - text_neq
            type: string
          sources:
            default: []
            description: Allowed revision authors; an empty array allows any author.
            items:
              $ref: '#/components/schemas/FieldRevisionSource'
            type: array
          value:
            description: Scalar value compared as text; null is treated as an empty string.
            type:
              - string
              - number
              - boolean
              - 'null'
        required:
          - jsonPath
          - operator
          - value
          - fieldId
        type: object
      type: array
    DatasetSplitPartInclusion:
      additionalProperties: false
      description: Split parts to include; omit to include every part.
      properties:
        fieldId:
          description: Split field ID with prefix `df.`.
          pattern: >-
            ^df\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          type: string
        names:
          description: Names of the split parts to select.
          items:
            maxLength: 64
            pattern: ^[A-Za-z0-9_]+(?:[.-][A-Za-z0-9_]+)*$
            type: string
          maxItems: 10
          minItems: 1
          type: array
      required:
        - fieldId
        - names
      type: object
    DatasetSliceSelection:
      additionalProperties: false
      description: >-
        Slice whose frozen rows and fields to read; omit to use live dataset
        rows.
      properties:
        sliceId:
          description: Dataset slice ID with prefix `dsl.`.
          pattern: >-
            ^dsl\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          type: string
      required:
        - sliceId
      type: object
    PipelineCostEstimate:
      additionalProperties: false
      description: >-
        A forecast of pipeline cost for the current graph. Expected and maximum
        are forecasts; billing is pay-as-you-go.
      properties:
        dataset:
          additionalProperties: false
          description: Dataset and item count used for the forecast.
          properties:
            datasetId:
              description: Dataset ID with prefix `ds.` being priced.
              pattern: >-
                ^ds\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
              type: string
            itemCount:
              description: Number of matching dataset items included in the forecast.
              maximum: 9007199254740991
              minimum: 0
              type: integer
          required:
            - datasetId
            - itemCount
          type: object
        disclaimer:
          description: Explanation of the estimate assumptions and billing limitations.
          type: string
        graphVersion:
          $ref: '#/components/schemas/PipelineGraphVersion'
        nodes:
          description: Per-node cost forecasts, including nodes that cannot be priced.
          items:
            oneOf:
              - additionalProperties: false
                properties:
                  expectedItems:
                    description: Expected number of items reaching this node.
                    maximum: 9007199254740991
                    minimum: 0
                    type: integer
                  kind:
                    const: non-priced
                    description: >-
                      Estimate kind: `non-priced` for nodes without charges,
                      `validation-errors` when configuration prevents pricing,
                      or `priced` when a forecast is available.
                    type: string
                  nodeId:
                    description: Identifier of the pipeline node being priced.
                    type: string
                  nodeNameDisplay:
                    description: Display name of the node.
                    type: string
                  nodeType:
                    description: Type of node being priced.
                    enum:
                      - root
                      - code
                      - generation_sft
                      - match
                      - quorum_sft
                    type: string
                required:
                  - nodeId
                  - nodeType
                  - nodeNameDisplay
                  - expectedItems
                  - kind
                type: object
              - additionalProperties: false
                properties:
                  expectedItems:
                    description: Expected number of items reaching this node.
                    maximum: 9007199254740991
                    minimum: 0
                    type: integer
                  kind:
                    const: validation-errors
                    description: >-
                      Estimate kind: `non-priced` for nodes without charges,
                      `validation-errors` when configuration prevents pricing,
                      or `priced` when a forecast is available.
                    type: string
                  nodeId:
                    description: Identifier of the pipeline node being priced.
                    type: string
                  nodeNameDisplay:
                    description: Display name of the node.
                    type: string
                  nodeType:
                    description: Type of node being priced.
                    enum:
                      - root
                      - code
                      - generation_sft
                      - match
                      - quorum_sft
                    type: string
                required:
                  - nodeId
                  - nodeType
                  - nodeNameDisplay
                  - expectedItems
                  - kind
                type: object
              - additionalProperties: false
                properties:
                  displayBreakdown:
                    description: Cost lines and nested calculations for this node.
                    items:
                      $ref: '#/components/schemas/CostBreakdownLine'
                    type: array
                  expectedItems:
                    description: Expected number of items reaching this node.
                    maximum: 9007199254740991
                    minimum: 0
                    type: integer
                  expectedTotal:
                    description: >-
                      Expected node cost in US dollars, formatted with a
                      currency symbol.
                    type: string
                  groupSubtitle:
                    additionalProperties: false
                    description: >-
                      Summary of the quantities and assumptions used for this
                      node.
                    properties:
                      explanation:
                        description: >-
                          Additional explanation of the quantities; absent when
                          none is needed.
                        type: string
                      text:
                        description: Summary of the quantities priced for this node.
                        type: string
                    required:
                      - text
                    type: object
                  kind:
                    const: priced
                    description: >-
                      Estimate kind: `non-priced` for nodes without charges,
                      `validation-errors` when configuration prevents pricing,
                      or `priced` when a forecast is available.
                    type: string
                  maxTotal:
                    description: >-
                      Maximum forecast node cost in US dollars, formatted with a
                      currency symbol.
                    type: string
                  nodeId:
                    description: Identifier of the pipeline node being priced.
                    type: string
                  nodeNameDisplay:
                    description: Display name of the node.
                    type: string
                  nodeType:
                    description: Type of node being priced.
                    enum:
                      - root
                      - code
                      - generation_sft
                      - match
                      - quorum_sft
                    type: string
                  perItemExpected:
                    description: >-
                      Expected cost per item in US dollars with a currency
                      symbol, or null when there are no items to price.
                    type:
                      - string
                      - 'null'
                  warning:
                    description: Pricing warning; absent when no warning applies.
                    type: string
                required:
                  - nodeId
                  - nodeType
                  - nodeNameDisplay
                  - expectedItems
                  - kind
                  - groupSubtitle
                  - expectedTotal
                  - maxTotal
                  - perItemExpected
                  - displayBreakdown
                type: object
          type: array
        total:
          additionalProperties: false
          description: Forecast costs for all priced nodes.
          properties:
            bestCase:
              default: null
              description: >-
                Minimum forecast pipeline cost in US dollars with a currency
                symbol, or null when unavailable.
              type:
                - string
                - 'null'
            expected:
              description: >-
                Expected pipeline cost in US dollars, formatted with a currency
                symbol.
              type: string
            perItemExpected:
              description: >-
                Expected cost per input item in US dollars with a currency
                symbol, or null when no items are selected.
              type:
                - string
                - 'null'
            perItemWorstCase:
              description: >-
                Maximum forecast cost per input item in US dollars with a
                currency symbol, or null when no items are selected.
              type:
                - string
                - 'null'
            worstCase:
              description: >-
                Maximum forecast pipeline cost in US dollars, formatted with a
                currency symbol.
              type: string
          required:
            - expected
            - worstCase
            - perItemExpected
            - perItemWorstCase
          type: object
      required:
        - dataset
        - total
        - disclaimer
        - nodes
        - graphVersion
      type: object
    FieldRevisionSource:
      description: Source that wrote a field revision.
      oneOf:
        - additionalProperties: false
          description: Source that wrote a field revision.
          properties:
            type:
              const: user
              description: >-
                Revision author: `user` for a user action or `system` for a
                platform operation.
              type: string
            userId:
              description: Identifier of the user who wrote the revision.
              minLength: 1
              type: string
          required:
            - type
            - userId
          type: object
        - additionalProperties: false
          description: Source that wrote a field revision.
          properties:
            source:
              description: Identifier of the platform operation that wrote the revision.
              minLength: 1
              type: string
            type:
              const: system
              description: >-
                Revision author: `user` for a user action or `system` for a
                platform operation.
              type: string
          required:
            - type
            - source
          type: object
    PipelineGraphVersion:
      description: >-
        The snapshot version expected to still be active. A stale version is
        rejected with HTTP 409.
      pattern: >-
        ^ple\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    CostBreakdownLine:
      additionalProperties: false
      properties:
        criterionId:
          description: >-
            Related quality criterion ID; absent for costs not tied to one
            criterion.
          type: string
        criterionLabel:
          description: >-
            Related quality criterion label; absent for costs not tied to one
            criterion.
          type: string
        expectedTotal:
          description: Expected total in US dollars, formatted with a currency symbol.
          type: string
        formula:
          additionalProperties: false
          description: Calculation details; absent when no formula is supplied.
          properties:
            expected:
              additionalProperties: false
              description: Expected-cost calculation and its explanation.
              properties:
                explanation:
                  description: >-
                    Additional explanation of the expected-cost formula; absent
                    when none is needed.
                  type: string
                text:
                  description: Formula used to calculate the expected cost.
                  type: string
              required:
                - text
              type: object
            max:
              description: Formula used to calculate the maximum forecast cost.
              type: string
          required:
            - expected
            - max
          type: object
        label:
          description: Display name of this cost line.
          type: string
        labelTooltip:
          description: >-
            Additional explanation of this cost line; absent when none is
            supplied.
          type: string
        lineId:
          description: Pricing line identifier; absent for a group of cost lines.
          enum:
            - expert_task
            - llm_qa
            - video_tool
            - human_qa_task
            - onboarding_task
            - exam_task
            - synthetic_generation_input_tokens
            - synthetic_generation_cached_tokens
            - synthetic_generation_output_tokens
          type: string
        maxTotal:
          description: >-
            Maximum forecast total in US dollars, formatted with a currency
            symbol.
          type: string
        pricePerUnit:
          description: Display price in US dollars with a currency symbol and unit label.
          type: string
        quantity:
          description: >-
            Display quantity used to calculate this line, including
            approximation marks when applicable.
          type: string
        subLines:
          description: >-
            Detailed cost lines or rates within this group; absent for an
            individual line.
          items:
            anyOf:
              - $ref: '#/components/schemas/CostBreakdownLine'
              - additionalProperties: false
                properties:
                  label:
                    description: Display name of this cost line.
                    type: string
                  labelTooltip:
                    description: >-
                      Additional explanation of this cost line; absent when none
                      is supplied.
                    type: string
                  lineId:
                    description: Identifier of the pricing line represented by this rate.
                    enum:
                      - expert_task
                      - llm_qa
                      - video_tool
                      - human_qa_task
                      - onboarding_task
                      - exam_task
                      - synthetic_generation_input_tokens
                      - synthetic_generation_cached_tokens
                      - synthetic_generation_output_tokens
                    type: string
                  pricePerUnit:
                    description: >-
                      Display price in US dollars with a currency symbol and
                      unit label.
                    type: string
                required:
                  - label
                  - lineId
                  - pricePerUnit
                type: object
          type: array
      required:
        - label
        - pricePerUnit
        - quantity
        - expectedTotal
        - maxTotal
      type: object
  headers:
    RateLimit-Limit:
      description: The maximum number of requests allowed in the current window.
      schema:
        type: integer
    RateLimit-Policy:
      description: The rate limit policy (e.g., "60;w=60").
      schema:
        type: string
    RateLimit-Remaining:
      description: The number of requests remaining in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: The number of seconds until the current window resets.
      schema:
        type: integer
    X-Request-Id:
      description: >-
        The request id: the X-Request-Id you sent when it is 1-128 characters of
        letters, digits, ".", "_" or "-", otherwise a generated UUID. Present on
        every response, including errors; quote it when reporting a problem.
      schema:
        type: string
  securitySchemes:
    apiKeyAuth:
      description: >-
        Enter `ApiKey <your-api-key>` in Authorization, including the `ApiKey `
        prefix. In cURL and Python samples, `<api-key>` means this full value.
        The TypeScript SDK adds the prefix for you.
      in: header
      name: Authorization
      type: apiKey
    scopedTokenAuth:
      description: >-
        Enter the project-scoped token as `pst_...` in X-Scoped-Token, without
        an `ApiKey ` prefix. Create a token with POST
        /projects/{projectId}/tokens.
      in: header
      name: X-Scoped-Token
      type: apiKey

````

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