{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-internal-run-costs-response-schema.json",
  "title": "InternalRunCostsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-billing-api-openapi.yml#/components/schemas/InternalRunCostsResponse",
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/InternalRunCostRow"
      },
      "type": "array",
      "title": "Items"
    },
    "total": {
      "type": "integer",
      "title": "Total"
    },
    "observed_at": {
      "type": "string",
      "format": "date-time",
      "title": "Observed At"
    },
    "tracking_enabled": {
      "type": "boolean",
      "title": "Tracking Enabled"
    },
    "basis": {
      "type": "string",
      "const": "provider_estimate",
      "title": "Basis",
      "default": "provider_estimate"
    }
  },
  "type": "object",
  "required": [
    "items",
    "total",
    "observed_at",
    "tracking_enabled"
  ],
  "$defs": {
    "InternalRunCostRow": {
      "properties": {
        "organization_id": {
          "type": "string",
          "title": "Organization Id"
        },
        "organization_key": {
          "type": "string",
          "title": "Organization Key"
        },
        "organization_name": {
          "type": "string",
          "title": "Organization Name"
        },
        "run_id": {
          "type": "string",
          "title": "Run Id"
        },
        "run_name": {
          "type": "string",
          "title": "Run Name"
        },
        "launched_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Launched By"
        },
        "type": {
          "type": "string",
          "enum": [
            "training",
            "eval"
          ],
          "title": "Type"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model"
        },
        "agent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent"
        },
        "benchmark": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Benchmark"
        },
        "backend": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Backend"
        },
        "launch_at": {
          "type": "string",
          "format": "date-time",
          "title": "Launch At"
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Seconds"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        },
        "total_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Cost"
        },
        "sandbox_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sandbox Cost"
        },
        "training_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Training Cost"
        },
        "inference_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Inference Cost"
        },
        "grading_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Grading Cost"
        },
        "other_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Other Cost"
        },
        "public_total_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Total Cost"
        },
        "public_sandbox_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Sandbox Cost"
        },
        "public_training_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Training Cost"
        },
        "public_inference_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Inference Cost"
        },
        "public_grading_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Grading Cost"
        },
        "public_other_cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Public Other Cost"
        },
        "public_unpriced_categories": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Public Unpriced Categories",
          "default": []
        },
        "tinker_cost_basis": {
          "type": "string",
          "enum": [
            "provider_reported",
            "provider_reported_partial",
            "estimate"
          ],
          "title": "Tinker Cost Basis",
          "default": "estimate"
        },
        "unpriced_categories": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Unpriced Categories"
        }
      },
      "type": "object",
      "required": [
        "organization_id",
        "organization_key",
        "organization_name",
        "run_id",
        "run_name",
        "launched_by",
        "type",
        "model",
        "agent",
        "benchmark",
        "backend",
        "launch_at",
        "duration_seconds",
        "status",
        "total_cost",
        "sandbox_cost",
        "training_cost",
        "inference_cost",
        "grading_cost",
        "other_cost",
        "unpriced_categories"
      ],
      "title": "InternalRunCostRow"
    }
  }
}