{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geniffy-com/json-schema/geniffy-com-usage-out-schema.json",
  "title": "UsageOut",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geniffy-com-openapi.json#/components/schemas/UsageOut",
  "properties": {
    "plan": {
      "type": "string",
      "title": "Plan",
      "description": "free, pro or max: the same plans for everyone, the API in every one; startup or scale for a company's plan, paid by invoice"
    },
    "trial": {
      "type": "boolean",
      "title": "Trial",
      "description": "On the 14 days of Pro every account gets once"
    },
    "period_start": {
      "type": "string",
      "title": "Period Start",
      "description": "When this month's use began counting"
    },
    "period_end": {
      "type": "string",
      "title": "Period End",
      "description": "When it resets"
    },
    "learned_tokens": {
      "type": "integer",
      "title": "Learned Tokens",
      "description": "Tokens learned this month from everything saved, every way in, your app's end users included (as many as each save holds; an edit counts only what is new)"
    },
    "included_tokens": {
      "type": "integer",
      "title": "Included Tokens",
      "description": "The tokens the plan learns in a month"
    },
    "waiting_tokens": {
      "type": "integer",
      "title": "Waiting Tokens",
      "description": "Saved and searchable, waiting to be learned next month (or at once with extra learning on)"
    },
    "answers": {
      "type": "integer",
      "title": "Answers",
      "description": "Written answers and context blocks this month"
    },
    "included_answers": {
      "type": "integer",
      "title": "Included Answers",
      "description": "Written answers the plan includes in a month"
    },
    "extra_on": {
      "type": "boolean",
      "title": "Extra On",
      "description": "Extra learning: past the plan, saves are learned and questions answered at once, $5 per million tokens and $5 per 1,000 answers, up to the cap"
    },
    "extra_cap_usd": {
      "type": "number",
      "title": "Extra Cap Usd",
      "description": "The most extra learning may come to this month"
    },
    "extra_used_usd": {
      "type": "number",
      "title": "Extra Used Usd",
      "description": "What extra learning has come to so far this month"
    },
    "state": {
      "type": "string",
      "enum": [
        "ok",
        "near",
        "over",
        "extra",
        "paused"
      ],
      "title": "State",
      "description": "Learning against the plan: near at 80%; over: new saves wait; extra: extra learning carries on; paused: what waits is so large that new saves are refused"
    }
  },
  "type": "object",
  "required": [
    "plan",
    "trial",
    "period_start",
    "period_end",
    "learned_tokens",
    "included_tokens",
    "waiting_tokens",
    "answers",
    "included_answers",
    "extra_on",
    "extra_cap_usd",
    "extra_used_usd",
    "state"
  ]
}