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

# Return cost status and usage components for a session.



## OpenAPI

````yaml /openapi.yaml get /v1/training/sessions/{session_id}/cost
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/sessions/{session_id}/cost:
    parameters:
      - $ref: '#/components/parameters/SessionId'
    get:
      tags:
        - unified-training
      summary: Return cost status and usage components for a session.
      operationId: getTrainingSessionCost
      responses:
        '200':
          description: >-
            Pending cost intentionally has the literal `cost_pending` rather
            than an invented total.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostResponse'
        default:
          $ref: '#/components/responses/ApiError'
components:
  parameters:
    SessionId:
      name: session_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SessionId'
  schemas:
    CostResponse:
      type: object
      additionalProperties: false
      required:
        - session_id
        - estimated_max_microusd
        - settlement_status
        - total_microusd
        - components
      properties:
        session_id:
          $ref: '#/components/schemas/SessionId'
        estimated_max_microusd:
          type:
            - integer
            - 'null'
        settlement_status:
          type: string
          enum:
            - pending
            - settled
            - unavailable
        total_microusd:
          oneOf:
            - type: integer
            - type: string
              const: cost_pending
            - type: 'null'
        components:
          type: array
          items:
            $ref: '#/components/schemas/UsageComponent'
    SessionId:
      type: string
      pattern: ^wts_[0-9a-f]{32}$
    UsageComponent:
      type: object
      additionalProperties: false
      required:
        - session_id
        - run_id
        - operation_id
        - provider
        - meter
        - quantity
        - unit
        - cost_microusd
        - settlement_status
        - observed_at
        - settled_at
      properties:
        session_id:
          $ref: '#/components/schemas/SessionId'
        run_id:
          oneOf:
            - $ref: '#/components/schemas/RunId'
            - type: 'null'
        operation_id:
          oneOf:
            - $ref: '#/components/schemas/OperationId'
            - type: 'null'
        provider:
          type: string
          enum:
            - modal
            - tinker
        meter:
          type: string
        quantity:
          type: number
        unit:
          type: string
        cost_microusd:
          type:
            - integer
            - 'null'
        settlement_status:
          type: string
          enum:
            - pending
            - settled
            - unavailable
        observed_at:
          $ref: '#/components/schemas/Timestamp'
        settled_at:
          oneOf:
            - $ref: '#/components/schemas/Timestamp'
            - type: 'null'
    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
    RunId:
      type: string
      pattern: ^wtr_[0-9a-f]{32}$
    OperationId:
      type: string
      pattern: ^wto_[0-9a-f]{32}$
    Timestamp:
      type: string
      format: date-time
  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.

````