{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quorum-dog/json-schema/quorum-dog-estimate-schema.json",
  "title": "Estimate",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quorum-dog-openapi.json#/components/schemas/Estimate",
  "type": "object",
  "properties": {
    "request_id": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "mode": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Mode, by its ticker in COMPANY:MODE form (e.g. `QRUM:STAN`), the same name `model` takes. `null` when the Mode has no ticker or the name lookup fails; the call itself is unaffected."
    },
    "depth": {
      "type": "string",
      "enum": [
        "light",
        "medium",
        "deep"
      ],
      "description": "The classified depth of the prompt."
    },
    "difficulty_score": {
      "type": "number",
      "description": "0–1. Production distribution as of 2026-08-20 (n=3,947): 45% light, 33% medium, 22% deep; mean 0.456."
    },
    "task_type": {
      "type": "string"
    },
    "estimated_price_usd": {
      "type": "number",
      "description": "The Mode's fee in the quote, kept for older clients. `estimate.total_usd` is the whole call."
    },
    "estimate": {
      "type": [
        "object",
        "null"
      ],
      "description": "The quote for the whole call on your prompt, from the same formula the bill uses. The bill follows actual usage, so it can differ. `null` when no quote could be made.",
      "properties": {
        "rule": {
          "type": "string",
          "enum": [
            "per_mtok"
          ],
          "description": "`per_mtok`: engines at actual cost, the platform fee and the Mode's fee."
        },
        "gateway_usd": {
          "type": [
            "number",
            "null"
          ],
          "description": "Estimated engine cost. `null` only when no figure is available."
        },
        "platform_fee_usd": {
          "type": "number"
        },
        "token_charge_usd": {
          "type": "number"
        },
        "mode_fee_usd": {
          "type": "number",
          "description": "The Mode's fee."
        },
        "gross_usd": {
          "type": "number",
          "description": "Before the call ceiling."
        },
        "cap_credit_usd": {
          "type": "number"
        },
        "total_usd": {
          "type": "number",
          "description": "After the call ceiling."
        },
        "capped": {
          "type": "boolean"
        },
        "ceiling_usd": {
          "type": "number"
        },
        "tier": {
          "type": "string"
        },
        "depth": {
          "type": [
            "string",
            "null"
          ]
        },
        "basis": {
          "type": "object",
          "description": "What the quote rests on: `kind` is `recorded` (recorded calls of this Mode) or `rates` (its engines' rates), with the sample size `n` and the gates applied."
        },
        "per_mtok_by_tier": {
          "type": [
            "object",
            "null"
          ],
          "description": "The Mode's fee per tier in dollars per 1M tokens processed, the same rate and shape `/v1/models` publishes in `pricing.tiers`. A tier with no recorded calls yet carries null rates and a `reason`.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "input_usd_per_mtok": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "output_usd_per_mtok": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "n": {
                "type": "integer"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "api_calls",
                  "lab_runs"
                ]
              },
              "reason": {
                "type": "string",
                "description": "Present when the rates are `null`."
              }
            }
          }
        }
      }
    },
    "billed_usd": {
      "type": "number",
      "const": 0,
      "description": "Always zero. This endpoint is free."
    },
    "timing_ms": {
      "type": "object",
      "description": "Returned so you can measure this round trip yourself rather than taking our word for it.",
      "properties": {
        "total": {
          "type": "integer"
        },
        "classify": {
          "type": "integer"
        }
      }
    }
  }
}