{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://convomargin.pages.dev/schemas/prompt-receipt.json",
  "title": "ConvoMarginPromptReceipt",
  "description": "Token-efficient one-prompt P&L row. Compact keys follow Daniel's Corner taxonomy rules: short names, 1-token canon after lowercase/alias map. Expand for humans; send this shape to agents and APIs.",
  "type": "object",
  "additionalProperties": false,
  "required": ["m", "ti", "to", "c", "rev", "mg"],
  "properties": {
    "m": {
      "type": "string",
      "description": "Canonical model id (grok-4.6, claude-sonnet, gpt-4o). Not a monthly blend."
    },
    "ti": { "type": "integer", "minimum": 0, "description": "Input tokens" },
    "to": { "type": "integer", "minimum": 0, "description": "Output tokens" },
    "tl": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Canonical tools: web, git, deploy, rag, headroom"
    },
    "u": { "type": "string", "description": "Umbrella / topic cluster id" },
    "uid": { "type": "string", "description": "User, cohort, or session id" },
    "c": { "type": "number", "description": "Cost USD for this prompt/conversation" },
    "rev": { "type": "number", "description": "Revenue USD assigned to this conversation" },
    "mg": { "type": "number", "description": "Margin USD (rev - c)" }
  }
}
