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

# Resume a training run

> Retry a run blocked on funds or payment after adding funds. Returns its updated state. Returns 409 if the run is not resumable or its payment window has expired.



## OpenAPI

````yaml /api-reference/openapi.json post /training-runs/{trainingRunId}/resume
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:
  /training-runs/{trainingRunId}/resume:
    post:
      tags:
        - Trainings
      summary: Resume a training run
      description: >-
        Retry a run blocked on funds or payment after adding funds. Returns its
        updated state. Returns 409 if the run is not resumable or its payment
        window has expired.
      operationId: resumeTrainingRun
      parameters:
        - in: path
          name: trainingRunId
          required: true
          schema:
            $ref: '#/components/schemas/TrainingRunId'
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              additionalProperties: false
              example: {}
              properties: {}
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingRun'
          description: Resumed Training Run
          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'
        '409':
          description: Training Run is not resumable from its current state
          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 run = await client.trainings.resumeRun({
              trainingRunId: "trn.019a0000-0000-7000-8000-000000000001"
            });
            console.log(run);
components:
  schemas:
    TrainingRunId:
      description: ID of the training run, with prefix `trn.`.
      pattern: >-
        ^trn\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    TrainingRun:
      description: The configuration, inputs, and current state of one training run.
      properties:
        billingStatus:
          description: >-
            Billing state: `pending` before reservation, `reserved` while funds
            are held, `release_pending` or `released` for returned funds,
            `settled` after charging, `payment_required` for a shortfall,
            `resolved` after staff review, or `reconciliation_required` when
            charges need review.
          enum:
            - pending
            - reserved
            - release_pending
            - released
            - settled
            - payment_required
            - resolved
            - reconciliation_required
          type: string
        blockedReason:
          anyOf:
            - enum:
                - funds
                - payment
                - billing_review
              type: string
            - type: 'null'
          description: >-
            Reason the run is blocked: `funds` to reserve the budget, `payment`
            to settle usage, or `billing_review` for staff review; otherwise
            null.
        chargedAmount:
          anyOf:
            - pattern: ^(0|[1-9][0-9]*)(\.[0-9]+)?$
              type: string
            - type: 'null'
          description: >-
            Settled charge in US dollars as a decimal string, or null before a
            charge is recorded.
        configuration:
          $ref: '#/components/schemas/TrainingConfiguration'
        createdAt:
          description: Time the training run was created, as an ISO 8601 timestamp.
          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
        error:
          anyOf:
            - additionalProperties: false
              properties:
                code:
                  anyOf:
                    - enum:
                        - data_export_failed
                        - input_report_mismatch
                        - billing_rejected
                        - provider_failed
                        - provider_timeout
                        - invalid_provider_output
                        - provider_output_changed
                        - prompt_changed
                        - payment_window_expired
                      type: string
                    - const: canceled
                      type: string
                  description: Machine-readable reason the run failed or was canceled.
                message:
                  description: Explanation of the failure or cancellation.
                  maxLength: 500
                  type: string
                retryable:
                  description: Whether this failure is marked as retryable.
                  type: boolean
              required:
                - code
                - message
                - retryable
              type: object
            - type: 'null'
          description: Failure or cancellation details, or null when no error is recorded.
        estimateFingerprint:
          description: >-
            SHA-256 fingerprint of the accepted estimate, as 64 lowercase
            hexadecimal characters.
          pattern: ^[0-9a-f]{64}$
          type: string
        estimateInputSetId:
          $ref: '#/components/schemas/TrainingCostEstimateInputSetId'
        id:
          $ref: '#/components/schemas/TrainingRunId'
        inputCutoff:
          description: Cutoff used to freeze the input rows, as an ISO 8601 timestamp.
          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
        inputs:
          anyOf:
            - additionalProperties: false
              properties:
                training:
                  additionalProperties: false
                  description: Prepared files and validation report for the training input.
                  properties:
                    byteSize:
                      description: Size of the prepared input file in bytes.
                      maximum: 9007199254740991
                      minimum: 0
                      type: integer
                    contract:
                      description: Versioned format contract for the training examples.
                      enum:
                        - openai-chat-v1
                      type: string
                    datasetExportId:
                      description: >-
                        Export ID with prefix `dex.` that prepared these
                        examples.
                      pattern: >-
                        ^dex\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                      type: string
                    datasetFileId:
                      description: Prepared dataset file ID with prefix `dfl.`.
                      pattern: >-
                        ^dfl\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                      type: string
                    datasetId:
                      description: Dataset ID with prefix `ds.` containing these examples.
                      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
                    format:
                      const: training-jsonl
                      description: >-
                        File format; `training-jsonl` stores one training
                        example per JSON line.
                      type: string
                    itemFilter:
                      $ref: '#/components/schemas/TrainingInputItemFilter'
                    report:
                      $ref: '#/components/schemas/TrainingInputReport'
                      description: >-
                        Validation results and token counts for the prepared
                        examples.
                    sha256:
                      description: >-
                        SHA-256 checksum of the input file, as 64 lowercase
                        hexadecimal characters.
                      pattern: ^[0-9a-f]{64}$
                      type: string
                  required:
                    - datasetId
                    - datasetExportId
                    - datasetFileId
                    - itemFilter
                    - format
                    - contract
                    - byteSize
                    - sha256
                    - report
                  type: object
                validation:
                  anyOf:
                    - additionalProperties: false
                      properties:
                        byteSize:
                          description: Size of the prepared input file in bytes.
                          maximum: 9007199254740991
                          minimum: 0
                          type: integer
                        contract:
                          description: Versioned format contract for the training examples.
                          enum:
                            - openai-chat-v1
                          type: string
                        datasetExportId:
                          description: >-
                            Export ID with prefix `dex.` that prepared these
                            examples.
                          pattern: >-
                            ^dex\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                          type: string
                        datasetFileId:
                          description: Prepared dataset file ID with prefix `dfl.`.
                          pattern: >-
                            ^dfl\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                          type: string
                        datasetId:
                          description: >-
                            Dataset ID with prefix `ds.` containing these
                            examples.
                          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
                        format:
                          const: training-jsonl
                          description: >-
                            File format; `training-jsonl` stores one training
                            example per JSON line.
                          type: string
                        itemFilter:
                          $ref: '#/components/schemas/TrainingInputItemFilter'
                        report:
                          $ref: '#/components/schemas/TrainingInputReport'
                          description: >-
                            Validation results and token counts for the prepared
                            examples.
                        sha256:
                          description: >-
                            SHA-256 checksum of the input file, as 64 lowercase
                            hexadecimal characters.
                          pattern: ^[0-9a-f]{64}$
                          type: string
                      required:
                        - datasetId
                        - datasetExportId
                        - datasetFileId
                        - itemFilter
                        - format
                        - contract
                        - byteSize
                        - sha256
                        - report
                      type: object
                    - type: 'null'
                  description: >-
                    Prepared validation input, or null when no validation input
                    was selected.
              required:
                - training
                - validation
              type: object
            - type: 'null'
          description: >-
            Prepared training and validation inputs; null when unavailable or
            omitted from create and list responses.
        maxCost:
          description: >-
            Maximum accepted charge for this run, in US dollars as a decimal
            string.
          type: string
        message:
          description: >-
            Current status or billing explanation, or null when none is
            available.
          type:
            - string
            - 'null'
        outputModelVersionId:
          $ref: '#/components/schemas/ModelVersionId'
        outputModelVersionName:
          description: Name reserved for the model version this run produces.
          maxLength: 120
          minLength: 1
          type: string
        outputModelVersionRevision:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 9007199254740991
              type: integer
            - type: 'null'
          description: Published model version revision, or null before publication.
        progress:
          anyOf:
            - additionalProperties: false
              properties:
                message:
                  anyOf:
                    - maxLength: 500
                      type: string
                    - type: 'null'
                  description: Progress explanation, or null when none is available.
                phase:
                  description: Current phase of training.
                  maxLength: 120
                  minLength: 1
                  type: string
                step:
                  anyOf:
                    - maximum: 9007199254740991
                      minimum: 0
                      type: integer
                    - type: 'null'
                  description: >-
                    Current training step, or null when step progress is
                    unavailable.
                total:
                  anyOf:
                    - exclusiveMinimum: 0
                      maximum: 9007199254740991
                      type: integer
                    - type: 'null'
                  description: Total number of training steps, or null when unknown.
              required:
                - phase
                - step
                - total
                - message
              type: object
            - type: 'null'
          description: >-
            Latest training progress while running or stopping; null in other
            states or when progress is unavailable.
        quote:
          description: Cost estimate accepted for this run.
          properties:
            budget:
              $ref: '#/components/schemas/TrainingResourceBudget'
            calculatedAt:
              description: Time the estimate was calculated, as an ISO 8601 timestamp.
              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
            capabilityVersion:
              description: Version of the model capability rules used for this estimate.
              minLength: 1
              type: string
            currency:
              const: USD
              description: Currency used for the estimate; always `USD`.
              type: string
            cutoff:
              description: >-
                Dataset cutoff used to select the inputs, as an ISO 8601
                timestamp.
              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
            inputSetId:
              $ref: '#/components/schemas/TrainingCostEstimateInputSetId'
            inputs:
              $ref: '#/components/schemas/TrainingCostEstimateInputs'
            maximumCharge:
              description: Maximum charge in US dollars as a decimal string.
              type: string
            pricingVersion:
              description: Version of the pricing rules used for this estimate.
              minLength: 1
              type: string
          required:
            - inputSetId
            - cutoff
            - inputs
            - capabilityVersion
            - pricingVersion
            - calculatedAt
            - budget
            - maximumCharge
            - currency
          type: object
        status:
          description: >-
            Run state: `queued`, `running`, `stopping`, `blocked`, `completed`,
            `failed`, or `canceled`; `blocked` requires resolving the reported
            reason.
          enum:
            - queued
            - running
            - stopping
            - blocked
            - completed
            - failed
            - canceled
          type: string
        trainingId:
          $ref: '#/components/schemas/TrainingId'
        updatedAt:
          description: Time the training run was last updated, as an ISO 8601 timestamp.
          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
      required:
        - id
        - trainingId
        - configuration
        - estimateInputSetId
        - estimateFingerprint
        - outputModelVersionId
        - outputModelVersionName
        - maxCost
        - status
        - outputModelVersionRevision
        - progress
        - blockedReason
        - error
        - billingStatus
        - chargedAmount
        - message
        - quote
        - inputCutoff
        - inputs
        - createdAt
        - updatedAt
      type: object
    TrainingConfiguration:
      description: A normalized method-specific Training draft.
      oneOf:
        - $ref: '#/components/schemas/SftTrainingConfiguration'
        - $ref: '#/components/schemas/GistingTrainingConfiguration'
    TrainingCostEstimateInputSetId:
      description: The immutable input set used to calculate a Training Cost Estimate.
      pattern: >-
        ^tei\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    TrainingInputItemFilter:
      additionalProperties: false
      description: Filter used to select this frozen training or validation input.
      properties:
        createdBefore:
          description: Include rows created before this ISO 8601 timestamp.
          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'
      required:
        - createdBefore
      type: object
    TrainingInputReport:
      additionalProperties: false
      properties:
        errors:
          description: Sample of validation errors, up to 50 entries.
          items:
            additionalProperties: false
            properties:
              itemIndex:
                description: Index of the dataset item with a validation error.
                maximum: 9007199254740991
                minimum: 0
                type: integer
              reason:
                description: Reason the example failed validation.
                type: string
            required:
              - itemIndex
              - reason
            type: object
          maxItems: 50
          type: array
        invalidCount:
          description: Number of examples rejected during validation.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        tokens:
          additionalProperties: false
          description: Token-count statistics for the valid examples.
          properties:
            estimatorVersion:
              anyOf:
                - enum:
                    - utf16-code-units-div-4-v1
                    - script-weighted-v1
                  type: string
                - type: 'null'
              default: null
              description: Version of the token estimator used, or null when unavailable.
            max:
              description: Largest token count among valid examples.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            p50:
              description: Median number of tokens per valid example.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            p95:
              description: 95th percentile of tokens per valid example.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            total:
              anyOf:
                - maximum: 9007199254740991
                  minimum: 0
                  type: integer
                - type: 'null'
              default: null
              description: Total tokens across valid examples, or null when unavailable.
          required:
            - p50
            - p95
            - max
          type: object
        validCount:
          description: Number of valid training examples in the selection.
          maximum: 9007199254740991
          minimum: 0
          type: integer
      required:
        - validCount
        - invalidCount
        - errors
        - tokens
      type: object
    ModelVersionId:
      description: Model version ID with prefix `mdv.`.
      pattern: >-
        ^mdv\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    TrainingResourceBudget:
      additionalProperties: false
      description: Estimated and maximum training resource usage.
      properties:
        estimatedGpuSeconds:
          description: Estimated total GPU time, in seconds summed across all GPUs.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        estimatedWallSeconds:
          description: Estimated elapsed training time, in seconds.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        gpuCount:
          description: Number of GPUs used for the estimate.
          exclusiveMinimum: 0
          maximum: 9007199254740991
          type: integer
        maximumGpuSeconds:
          description: >-
            Maximum GPU time used to bound the charge, in seconds summed across
            all GPUs.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        maximumWallSeconds:
          description: Conservative maximum elapsed training time, in seconds.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        methodWorkUnits:
          description: >-
            Token-based work estimate, including epochs and the method-specific
            training and validation workload.
          maximum: 9007199254740991
          minimum: 0
          type: integer
      required:
        - methodWorkUnits
        - estimatedGpuSeconds
        - estimatedWallSeconds
        - maximumWallSeconds
        - maximumGpuSeconds
        - gpuCount
      type: object
    TrainingCostEstimateInputs:
      additionalProperties: false
      description: Prepared inputs and their validation reports.
      properties:
        training:
          additionalProperties: false
          description: Frozen training selection and its validation result.
          properties:
            datasetExportId:
              description: Export ID with prefix `dex.` for the frozen selection.
              pattern: >-
                ^dex\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
              type: string
            datasetId:
              description: Dataset ID with prefix `ds.` containing these examples.
              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
            failure:
              $ref: '#/components/schemas/TrainingInputExportFailure'
            heldOutRows:
              description: >-
                Number of rows excluded by split roles; absent when that count
                has not been calculated.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            report:
              anyOf:
                - $ref: '#/components/schemas/TrainingInputReport'
                - type: 'null'
              description: >-
                Validation report for these examples, or null when the export
                failed or produced no report.
          required:
            - datasetId
            - datasetExportId
            - report
            - failure
          type: object
        validation:
          anyOf:
            - additionalProperties: false
              properties:
                datasetExportId:
                  description: Export ID with prefix `dex.` for the frozen selection.
                  pattern: >-
                    ^dex\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                  type: string
                datasetId:
                  description: Dataset ID with prefix `ds.` containing these examples.
                  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
                failure:
                  $ref: '#/components/schemas/TrainingInputExportFailure'
                heldOutRows:
                  description: >-
                    Number of rows excluded by split roles; absent when that
                    count has not been calculated.
                  maximum: 9007199254740991
                  minimum: 0
                  type: integer
                report:
                  anyOf:
                    - $ref: '#/components/schemas/TrainingInputReport'
                    - type: 'null'
                  description: >-
                    Validation report for these examples, or null when the
                    export failed or produced no report.
              required:
                - datasetId
                - datasetExportId
                - report
                - failure
              type: object
            - type: 'null'
          description: >-
            Frozen validation selection and its validation result, or null when
            no validation input is selected.
      required:
        - training
        - validation
      type: object
    TrainingId:
      description: Training draft ID with prefix `trg.`.
      pattern: >-
        ^trg\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    SftTrainingConfiguration:
      additionalProperties: false
      description: A normalized supervised fine-tuning draft using LoRA.
      properties:
        batchSize:
          description: >-
            Sequences per optimizer step across all GPUs: 8, 16, 32, or 64. The
            default is 8.
          enum:
            - 8
            - 16
            - 32
            - 64
          type: number
        epochs:
          description: >-
            Passes over the training selection, 1 through 5. The cost estimate
            grows linearly with epochs.
          maximum: 5
          minimum: 1
          type: integer
        learningRate:
          description: >-
            Optimizer learning rate, 0.00001 through 0.001. The default is
            0.00015.
          maximum: 0.001
          minimum: 0.00001
          type: number
        loraRank:
          description: >-
            LoRA adapter rank: 8, 16, or 32. Defaults to 16. Alpha is twice the
            rank.
          enum:
            - 8
            - 16
            - 32
          type: number
        maxSequenceLength:
          description: >-
            Token budget per training example, prompt and target together: 64
            through 16384. The cost estimate is blocked when the longest example
            exceeds it. Defaults: 12288 for SFT, 3072 for gisting.
          maximum: 16384
          minimum: 64
          type: integer
        method:
          const: sft
          description: >-
            Training method; `sft` learns a LoRA adapter from prompt and target
            examples.
          type: string
        sliceId:
          description: >-
            The dataset slice to train on. It must freeze a split field.
            Training uses its train parts and validation uses its validate parts
            at the slice cutoff. Rows marked as test by any split field are
            excluded, except validation rows in a part with both validate and
            test roles in the selected split field.
          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
        source:
          $ref: '#/components/schemas/TrainingModelSource'
        splitFieldId:
          description: >-
            The split field to use, identified by field ID. Required when the
            slice freezes more than one split field.
          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
        trainParts:
          description: >-
            The train parts to learn on. Defaults to every part with the train
            role.
          items:
            maxLength: 64
            pattern: ^[A-Za-z0-9_]+(?:[.-][A-Za-z0-9_]+)*$
            type: string
          maxItems: 10
          minItems: 1
          type: array
        training:
          $ref: '#/components/schemas/TrainingDatasetSelection'
        validation:
          $ref: '#/components/schemas/TrainingDatasetSelection'
      required:
        - method
        - source
        - loraRank
        - epochs
        - learningRate
        - batchSize
        - maxSequenceLength
        - training
      type: object
    GistingTrainingConfiguration:
      additionalProperties: false
      description: A normalized prompt-gisting Training draft.
      properties:
        batchSize:
          description: >-
            Sequences per optimizer step across all GPUs: 8, 16, 32, or 64. The
            default is 8.
          enum:
            - 8
            - 16
            - 32
            - 64
          type: number
        epochs:
          description: >-
            Passes over the training selection, 1 through 5. The cost estimate
            grows linearly with epochs.
          maximum: 5
          minimum: 1
          type: integer
        gistTokens:
          description: >-
            Number of learned tokens that replace the prompt: 8, 32, 64, or a
            fraction of the prompt length: "1/4", "1/8", "1/16", or "1/32".
            Fractions are rounded up to a whole token and limited to 8 through
            256 tokens. Defaults to "1/8".
          enum:
            - 8
            - 32
            - 64
            - 1/4
            - 1/8
            - 1/16
            - 1/32
        learningRate:
          description: >-
            Optimizer learning rate for the soft tokens, 0.001 through 0.3. The
            default is 0.03.
          maximum: 0.3
          minimum: 0.001
          type: number
        maxSequenceLength:
          description: >-
            Token budget per training example, prompt and target together: 64
            through 16384. The cost estimate is blocked when the longest example
            exceeds it. Defaults: 12288 for SFT, 3072 for gisting.
          maximum: 16384
          minimum: 64
          type: integer
        method:
          const: gisting
          description: >-
            Training method; `gisting` learns tokens that replace a reusable
            prompt.
          type: string
        promptFileId:
          description: >-
            Project file ID with prefix `ppf.` containing the finalized UTF-8
            prompt to compress.
          pattern: >-
            ^ppf\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          type: string
        sliceId:
          description: >-
            The dataset slice to train on. It must freeze a split field.
            Training uses its train parts and validation uses its validate parts
            at the slice cutoff. Rows marked as test by any split field are
            excluded, except validation rows in a part with both validate and
            test roles in the selected split field.
          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
        source:
          $ref: '#/components/schemas/TrainingModelSource'
        splitFieldId:
          description: >-
            The split field to use, identified by field ID. Required when the
            slice freezes more than one split field.
          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
        trainParts:
          description: >-
            The train parts to learn on. Defaults to every part with the train
            role.
          items:
            maxLength: 64
            pattern: ^[A-Za-z0-9_]+(?:[.-][A-Za-z0-9_]+)*$
            type: string
          maxItems: 10
          minItems: 1
          type: array
        training:
          $ref: '#/components/schemas/TrainingDatasetSelection'
        validation:
          $ref: '#/components/schemas/TrainingDatasetSelection'
      required:
        - method
        - source
        - promptFileId
        - gistTokens
        - epochs
        - learningRate
        - batchSize
        - maxSequenceLength
        - training
      type: object
    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
    TrainingInputExportFailure:
      anyOf:
        - properties:
            code:
              description: >-
                Failure category: `empty_selection` when no rows match,
                `size_limit_exceeded` when the export is too large, or
                `assembly_failed` when preparation fails.
              enum:
                - empty_selection
                - size_limit_exceeded
                - assembly_failed
              type: string
            message:
              description: Explanation of why the export failed.
              maxLength: 500
              minLength: 1
              type: string
            timestamp:
              description: Time the export failed, as an ISO 8601 timestamp.
              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
          required:
            - timestamp
            - code
            - message
          type: object
        - type: 'null'
      description: Export failure details, or null when the export did not fail.
    TrainingModelSource:
      description: The exact Base Model or Model Version used as the source.
      oneOf:
        - additionalProperties: false
          properties:
            baseModelId:
              description: Catalog base model identifier.
              enum:
                - qwen3-4b
                - qwen3-8b
                - qwen3-32b
                - qwen3-235b
              type: string
            type:
              const: base_model
              description: >-
                Training source: `base_model` uses a catalog model;
                `model_version` uses a published project model version.
              type: string
          required:
            - type
            - baseModelId
          type: object
        - additionalProperties: false
          properties:
            modelVersionId:
              description: Source model version ID with prefix `mdv.`.
              pattern: >-
                ^mdv\.[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:
              const: model_version
              description: >-
                Training source: `base_model` uses a catalog model;
                `model_version` uses a published project model version.
              type: string
          required:
            - type
            - modelVersionId
          type: object
    TrainingDatasetSelection:
      additionalProperties: false
      description: A Dataset and normalized filter selected for one Training input purpose.
      properties:
        datasetId:
          description: Dataset ID with prefix `ds.` containing the selected examples.
          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
        itemFilter:
          $ref: '#/components/schemas/TrainingDatasetItemFilter'
          description: >-
            Conditions selecting dataset rows; omitted conditions do not
            restrict the selection.
      required:
        - datasetId
        - itemFilter
      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
    TrainingDatasetItemFilter:
      additionalProperties: false
      description: A normalized Dataset item filter stored with a Training draft.
      properties:
        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'
      required:
        - fieldValues
        - fieldSources
        - missingRevisionFields
      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.