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

# Create Dedicated Run

> Dispatch a dedicated full-FT prime-rl run on a registered PrimeCluster.

Access is gated by ClusterAllocation - the picker in
`training_service.create_dedicated_run` rejects callers whose
team/user has no matching allocation on a live PrimeCluster. When
`team_id` is set the caller must additionally be a member of that
team (mirrors the LoRA/shared dispatch path).

Config validation (validator schema, hub env ids, HF repo names,
per-run GPU cap) runs sync so bad configs return 400 immediately.
Cluster-side probes (GPU capacity, model cache) and the helm
install run async in a Cloud Task; callers poll
`GET /api/v1/rft/runs/{run_id}` for status transitions PENDING ->
CREATING -> RUNNING (or FAILED with errorMessage on a cluster-side
rejection).



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/v1/training/runs
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/training/runs:
    post:
      tags:
        - training
      summary: Create Dedicated Run
      description: |-
        Dispatch a dedicated full-FT prime-rl run on a registered PrimeCluster.

        Access is gated by ClusterAllocation - the picker in
        `training_service.create_dedicated_run` rejects callers whose
        team/user has no matching allocation on a live PrimeCluster. When
        `team_id` is set the caller must additionally be a member of that
        team (mirrors the LoRA/shared dispatch path).

        Config validation (validator schema, hub env ids, HF repo names,
        per-run GPU cap) runs sync so bad configs return 400 immediately.
        Cluster-side probes (GPU capacity, model cache) and the helm
        install run async in a Cloud Task; callers poll
        `GET /api/v1/rft/runs/{run_id}` for status transitions PENDING ->
        CREATING -> RUNNING (or FAILED with errorMessage on a cluster-side
        rejection).
      operationId: create_dedicated_run_api_v1_training_runs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDedicatedRunRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDedicatedRunResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateDedicatedRunRequest:
      properties:
        config:
          type: object
          title: Config
          description: >-
            Full prime-rl-style TOML, parsed to a dict. Same shape as
            `prime-rl/examples/*/rl.toml`; the platform splits it into trainer /
            orchestrator / inference subconfigs and bakes each into the
            corresponding pod's startup command.
        mode:
          type: string
          enum:
            - rl
            - sft
          title: Mode
          description: >-
            Which prime-rl schema the `config` blob follows. 'rl' (default) is
            the RL mega-TOML (trainer + orchestrator + inference). 'sft' is the
            SFT mega-TOML (top-level model/data/optim blocks, trainer-only
            deployment): the validator validates it against SFTConfig and
            renders a trainer-only Helm release (no orchestrator, inference, or
            env-server pods). The caller declares the mode; the backend never
            sniffs the config shape.
          default: rl
        imageTag:
          anyOf:
            - type: string
            - type: 'null'
          title: Imagetag
          description: >-
            prime-rl container image tag on ghcr.io/primeintellect-ai/prime-rl.
            Omit to use the deployment default: the operator-configured
            RL_FFT_DEFAULT_IMAGE_TAG when set, otherwise the validator's pinned
            build for RL runs and `main` for SFT runs. An explicit value,
            including `main`, is always used as-is.
        sourceRef:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourceref
          description: >-
            prime-rl git ref (branch, tag, or sha in the canonical
            PrimeIntellect-ai/prime-rl repo) the pods check out over the image's
            baked source at start, so a branch can be tested without building an
            image. The validator resolves it to a commit and validates the
            config against that commit's schema; the resolved sha is pinned on
            the run. Not generally available: only team runs (teamId) may send
            it, the team needs sourceRef access granted (contact support), and
            the backend needs RL_SOURCE_REF_ENABLED.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Optional human-readable run name
        teamId:
          anyOf:
            - type: string
            - type: 'null'
          title: Teamid
          description: Owning team (defaults to caller's user)
        wandbApiKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Wandbapikey
          description: >-
            W&B key. On the PENDING fast-path it's materialised straight into
            the run's k8s Secret. On the QUEUED path it's stashed AES-encrypted
            on the RFTRun row so the drainer can rebuild the same Secret at
            promotion time without re-prompting.
        hfToken:
          anyOf:
            - type: string
            - type: 'null'
          title: Hftoken
          description: >-
            HF token for gated/private model downloads. Same storage rules as
            wandbApiKey above.
        secrets:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Secrets
          description: >-
            Arbitrary env-var secrets projected into trainer / inference /
            orchestrator / env-server pods (parity with the LoRA path). Keys
            must be uppercase POSIX env-var names (e.g. 'OPENAI_API_KEY');
            WANDB_API_KEY / HF_TOKEN / PRIME_API_KEY are reserved — use the
            dedicated fields for those. Materialised into the per-run k8s
            Secret. Held encrypted on the RFTRun row only for the sync ->
            dispatch-task hop, then cleared once the run deploys (or on stop /
            delete / rollback); never returned by any read endpoint.
        volume:
          anyOf:
            - type: string
            - type: 'null'
          title: Volume
          description: >-
            Name of a volume in the caller's team (or personal) namespace. The
            run writes its outputs to `runs/<runId>/` on it instead of to a
            per-run PVC.
        gpuType:
          anyOf:
            - type: string
            - type: 'null'
          title: Gputype
          description: >-
            Optional GPU type constraint (e.g. 'H200_141GB', 'B200_180GB'). When
            set, dispatch is restricted to PrimeClusters whose `gpuType`
            matches. When omitted, the picker chooses the oldest eligible
            cluster with no type preference.
      type: object
      required:
        - config
      title: CreateDedicatedRunRequest
    CreateDedicatedRunResponse:
      properties:
        runId:
          type: string
          title: Runid
        jobId:
          type: string
          title: Jobid
        tokenValue:
          type: string
          title: Tokenvalue
          description: >-
            PRIME_API_KEY for this run. Returned once — the platform stores only
            the token id.
      type: object
      required:
        - runId
        - jobId
        - tokenValue
      title: CreateDedicatedRunResponse
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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