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

# Token usage and cost for a single RFT run

> Return the running token + cost totals for one RFT run.

Mirrors the per-row training data shown on the billing page (Training
tokens, Inference input/output tokens, price per million tokens, and
total cost) so an agent can poll this endpoint to monitor a live run.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json get /api/v1/billing/runs/{run_id}/usage
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/billing/runs/{run_id}/usage:
    get:
      tags:
        - Billing
      summary: Token usage and cost for a single RFT run
      description: |-
        Return the running token + cost totals for one RFT run.

        Mirrors the per-row training data shown on the billing page (Training
        tokens, Inference input/output tokens, price per million tokens, and
        total cost) so an agent can poll this endpoint to monitor a live run.
      operationId: get_run_usage_api_v1_billing_runs__run_id__usage_get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunUsageResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    RunUsageResponse:
      properties:
        run_id:
          type: string
          title: Run Id
        run_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Name
        base_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Model
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        training:
          $ref: '#/components/schemas/RunUsageBreakdown'
        inference:
          $ref: '#/components/schemas/RunUsageBreakdown'
        total_tokens:
          type: integer
          title: Total Tokens
        total_cost_usd:
          type: number
          title: Total Cost Usd
        pricing:
          $ref: '#/components/schemas/RunPricing'
        record_count:
          type: integer
          title: Record Count
          default: 0
      type: object
      required:
        - run_id
        - training
        - inference
        - total_tokens
        - total_cost_usd
        - pricing
      title: RunUsageResponse
      description: Per-run usage totals — drives `prime train usage <run_id>`.
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    RunUsageBreakdown:
      properties:
        tokens:
          type: integer
          title: Tokens
          description: Total tokens recorded for this usage type
          default: 0
        input_tokens:
          type: integer
          title: Input Tokens
          description: Total input tokens (only populated for INFERENCE)
          default: 0
        output_tokens:
          type: integer
          title: Output Tokens
          description: Total output tokens (only populated for INFERENCE)
          default: 0
        cost_usd:
          type: number
          title: Cost Usd
          description: Total cost charged for this usage type
          default: 0
      type: object
      title: RunUsageBreakdown
      description: Token + cost totals for a single usage type within a run.
    RunPricing:
      properties:
        training_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Training Per Mtok
        inference_input_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Inference Input Per Mtok
        inference_output_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Inference Output Per Mtok
      type: object
      title: RunPricing
      description: Snapshotted per-million-token pricing used to bill the run.
    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

````