{
  "$id": "https://schemas.mapi.dev/v1/api-RunCost.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Cost of a run (all attempts). ``estimated`` is true until an ``actual`` ledger entry\nexists; ``usd`` is kept for v0.2 clients and is set only when the currency is USD.",
  "examples": [
    {
      "estimated": true,
      "gib_seconds": null,
      "usd": null,
      "vcpu_seconds": null
    },
    {
      "amount_micros": 31200,
      "attempts_billed": 1,
      "currency": "USD",
      "estimate_micros": 30000,
      "estimated": false,
      "gib_seconds": 4800,
      "price_version": "cloudrun-list-2026-10",
      "usd": 0.0312,
      "vcpu_seconds": 1200
    }
  ],
  "properties": {
    "amount_micros": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Amount Micros"
    },
    "attempts_billed": {
      "default": 0,
      "minimum": 0,
      "title": "Attempts Billed",
      "type": "integer"
    },
    "currency": {
      "anyOf": [
        {
          "pattern": "^[A-Z]{3}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Currency"
    },
    "estimate_micros": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Pre-run estimate",
      "title": "Estimate Micros"
    },
    "estimated": {
      "default": true,
      "title": "Estimated",
      "type": "boolean"
    },
    "gib_seconds": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Gib Seconds"
    },
    "price_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Price Version"
    },
    "usd": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Usd"
    },
    "vcpu_seconds": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Vcpu Seconds"
    }
  },
  "title": "RunCost",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
