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

# Publish a completed LoRA artifact to a customer Hugging Face repository.

> Only LoRA adapters are eligible for Hub export. Whitney accepts a
customer credential reference, never a Hugging Face token. Full
weights are available only through signed Volume download in v1.




## OpenAPI

````yaml /openapi.yaml post /v1/training/runs/{run_id}/exports
openapi: 3.1.0
info:
  title: Whitney Training API
  version: 0.3.0
  description: >
    Public HTTP API for caller-owned model training on Whitney.


    Authenticate with a Whitney API key (`whitney_test_…` or `whitney_live_…`).

    Create a session and run, submit ordered training and sampling primitives,

    poll durable operations, and retrieve checkpoints, artifacts, usage, and
    cost.


    Every public request uses typed JSON. Token IDs and dense tensor values are

    ordinary JSON arrays validated against strict, provider-neutral schemas.
servers:
  - url: http://localhost:3001
    description: Local API
  - url: https://api.staging.trywhitney.com
    description: Staging API
  - url: https://api.trywhitney.com
    description: Production API
security:
  - WhitneyApiKey: []
tags:
  - name: unified-training
    description: Whitney-owned session, primitive, and operations API.
paths:
  /v1/training/runs/{run_id}/exports:
    parameters:
      - $ref: '#/components/parameters/RunId'
    post:
      tags:
        - unified-training
      summary: Publish a completed LoRA artifact to a customer Hugging Face repository.
      description: |
        Only LoRA adapters are eligible for Hub export. Whitney accepts a
        customer credential reference, never a Hugging Face token. Full
        weights are available only through signed Volume download in v1.
      operationId: exportTrainingLora
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportLoraRequest'
      responses:
        '200':
          description: Export completed and includes the published artifact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletedExportResponse'
        '202':
          description: Export is still executing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendingExportResponse'
        default:
          $ref: '#/components/responses/ApiError'
components:
  parameters:
    RunId:
      name: run_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/RunId'
  schemas:
    ExportLoraRequest:
      type: object
      additionalProperties: false
      required:
        - request_id
        - artifact_id
        - repo
      properties:
        request_id:
          type: string
          minLength: 1
          maxLength: 200
        artifact_id:
          type: string
          format: uuid
        destination:
          const: huggingface
          default: huggingface
        repo:
          type: string
          pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*$
          maxLength: 200
        private:
          type: boolean
          default: true
        credential_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 200
        revision:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 80
        mode:
          const: lora
          default: lora
    CompletedExportResponse:
      type: object
      additionalProperties: false
      required:
        - export
        - artifact
        - mode
      properties:
        export:
          $ref: '#/components/schemas/Export'
        artifact:
          $ref: '#/components/schemas/Artifact'
        mode:
          const: lora
    PendingExportResponse:
      type: object
      additionalProperties: false
      required:
        - export
        - mode
      properties:
        export:
          $ref: '#/components/schemas/Export'
        mode:
          const: lora
    RunId:
      type: string
      pattern: ^wtr_[0-9a-f]{32}$
    Export:
      type: object
      additionalProperties: false
      required:
        - id
        - run_id
        - artifact_id
        - status
        - result_artifact_id
        - repo
        - revision
        - error_code
        - created_at
        - updated_at
      properties:
        id:
          type: string
        run_id:
          $ref: '#/components/schemas/RunId'
        artifact_id:
          type: string
          format: uuid
        status:
          type: string
        result_artifact_id:
          type:
            - string
            - 'null'
        repo:
          type: string
        revision:
          type:
            - string
            - 'null'
        error_code:
          type:
            - string
            - 'null'
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Artifact:
      type: object
      additionalProperties: false
      required:
        - id
        - session_id
        - run_id
        - checkpoint_id
        - kind
        - checksum
        - size_bytes
        - export_mode
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
        session_id:
          oneOf:
            - $ref: '#/components/schemas/SessionId'
            - type: 'null'
        run_id:
          $ref: '#/components/schemas/RunId'
        checkpoint_id:
          oneOf:
            - $ref: '#/components/schemas/CheckpointId'
            - type: 'null'
        kind:
          type: string
        checksum:
          type:
            - string
            - 'null'
        size_bytes:
          type:
            - integer
            - 'null'
        export_mode:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - available
            - retired
        created_at:
          $ref: '#/components/schemas/Timestamp'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
        request_id:
          type: string
        funding_source:
          type: string
          enum:
            - platform
            - byok
    Timestamp:
      type: string
      format: date-time
    SessionId:
      type: string
      pattern: ^wts_[0-9a-f]{32}$
    CheckpointId:
      type: string
      pattern: ^wtc_[0-9a-f]{32}$
  responses:
    ApiError:
      description: Whitney API error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    WhitneyApiKey:
      type: http
      scheme: bearer
      bearerFormat: whitney_test_|whitney_live_
      description: Whitney-issued API key. No organization-selection header is accepted.

````