{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/regtail-com/json-schema/regtail-com-advice-schema.json",
  "title": "Advice",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/regtail-com-openapi.yml#/components/schemas/Advice",
  "properties": {
    "charged": {
      "type": "boolean",
      "title": "Charged",
      "description": "Whether this call spent a credit (never on the API plan)"
    },
    "credits_remaining": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credits Remaining",
      "description": "After this call; null with a sample key"
    },
    "sample": {
      "type": "boolean",
      "title": "Sample",
      "description": "True with an rt_test_ key: a sandbox answer, nothing spent",
      "default": false
    },
    "scenario": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scenario",
      "description": "With an rt_test_ key: the sandbox scenario that answered (GET /api/v1/sandbox/scenarios)"
    },
    "plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/Plan"
        },
        {
          "type": "null"
        }
      ],
      "description": "With the API plan: this period's cars, instead of credits"
    },
    "vrm": {
      "type": "string",
      "title": "Vrm"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "priorities": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Priorities",
      "description": "What to check at the viewing, why, and the report records it comes from"
    },
    "model": {
      "additionalProperties": true,
      "type": "object",
      "title": "Model",
      "description": "Known weak spots and facts about the model"
    },
    "basis": {
      "type": "string",
      "title": "Basis"
    }
  },
  "type": "object",
  "required": [
    "charged",
    "credits_remaining",
    "vrm",
    "summary",
    "priorities",
    "model",
    "basis"
  ],
  "$defs": {
    "Plan": {
      "properties": {
        "cars_used": {
          "type": "integer",
          "title": "Cars Used",
          "description": "Distinct cars looked up this billing period, this one included"
        },
        "cars_included": {
          "type": "integer",
          "title": "Cars Included",
          "description": "Cars the monthly plan includes"
        },
        "extra_cars": {
          "type": "integer",
          "title": "Extra Cars",
          "description": "Cars past the included ones this period, billed at the end of the month"
        },
        "price_per_extra_car_pence": {
          "type": "integer",
          "title": "Price Per Extra Car Pence"
        },
        "period_end": {
          "type": "string",
          "title": "Period End",
          "description": "When this billing period ends and the count starts again (UTC)"
        },
        "new_car": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "New Car",
          "description": "Whether this call counted a car not yet looked up this period"
        }
      },
      "type": "object",
      "required": [
        "cars_used",
        "cars_included",
        "extra_cars",
        "price_per_extra_car_pence",
        "period_end"
      ],
      "title": "Plan"
    }
  }
}