ONE plans:margin
← Receivers

plans:margin

plans family

chatmcp

What each plan earned ONE against its floor: per plan, the credits granted, the credits billed, the model cost from gateway_calls.cost_usd and the margin as a percent of that provider cost against platform_floor_pct. Reads a window (24h, 7d, 30d, 90d, mtd, all) that never reaches back past the live rate (2026-09-27). Margin is read on billed charges that have a priced model call; unpriced calls, billed charges with no call and unbilled calls are counted per plan and make the margin a bound (bound: true), never a fact. A plan with no subscribed group says cohort no_paying_cohort_yet. Test money, transfers, unlimited groups and our own groups are left out. Platform owners only: per-plan cost across every tenant is ONE's books (text/billing.md promise 9)

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_workspace
The class of authority the caller must already hold, decided from the attested context with no round trip.
Authority action
read_revenue
Also gated per node — the caller must be permitted this action over the workspace it names.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.
Version
1.0.0
Pin this to keep a contract stable; additive bumps never break callers.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/plans:margin \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "window": "30d" }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • window 24h | 7d | 30d | … optional How far back, in UTC: 24h, 7d, 30d, 90d, mtd (this calendar month) or all. Default 30d. Burns are never read from before 2026-09-27, whatever the window.

Response

What comes back from the call.

  • ok boolean
  • window string
  • since number Unix seconds burns and calls are read from: the window start, never before the live rate.
  • grantsSince number Unix seconds grants are read from: the window start.
  • plans object[]
  • total number Number of plans in the answer. Every plan is returned; the list is never cut.
  • truncated boolean
  • sum object Across every plan.
  • floorPct number
  • pegUsdPerCredit number The list peg used for retainedAtPegUsd: USD per credit.
  • costColumn string The column cost was read from: gateway_calls.cost_usd.
  • marginBasis string
  • asOf string ISO time the read ran.
  • error string unauthenticated | forbidden | no_db | invalid_request | margin_unavailable

Traffic

Every call to plans:margin, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names plans:margin, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

UI 1
  • one.ie/web/src/components/finance/map/stations.ts:215
API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:352
  • one.ie/web/src/lib/resolvers/finance.ts:69
CLI 1
  • packages/cli/src/finance.ts:116
→

Answered by

plans:margin one.ie/web/src/lib/resolvers/finance.ts:61 Dispatched through POST /api/ask/plans:margin, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "window": {
      "description": "How far back, in UTC: 24h, 7d, 30d, 90d, mtd (this calendar month) or all. Default 30d. Burns are never read from before 2026-09-27, whatever the window.",
      "type": "string",
      "enum": [
        "24h",
        "7d",
        "30d",
        "90d",
        "mtd",
        "all"
      ]
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "window": {
      "type": "string"
    },
    "since": {
      "description": "Unix seconds burns and calls are read from: the window start, never before the live rate.",
      "type": "number"
    },
    "grantsSince": {
      "description": "Unix seconds grants are read from: the window start.",
      "type": "number"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "description": "owners.plan of the group that PAID (the funder), or unknown when no owners row exists."
          },
          "groups": {
            "type": "number",
            "description": "Groups on this plan now, leaving out unlimited groups and our own."
          },
          "payingGroups": {
            "type": "number",
            "description": "Groups with a Stripe subscription. 0 means no paying cohort yet."
          },
          "cohort": {
            "type": "string",
            "enum": [
              "paying",
              "no_paying_cohort_yet"
            ]
          },
          "grants": {
            "type": "object",
            "properties": {
              "count": {
                "type": "number"
              },
              "credits": {
                "type": "number",
                "description": "Credits granted, live grants only."
              },
              "centsPaid": {
                "type": "number",
                "description": "USD cents customers paid for those grants; 0 when none carries a price."
              }
            },
            "required": [
              "count",
              "credits",
              "centsPaid"
            ]
          },
          "billed": {
            "type": "object",
            "properties": {
              "burns": {
                "type": "number"
              },
              "credits": {
                "type": "number",
                "description": "Credits charged, SUM(amount_credits)."
              },
              "retainedCredits": {
                "type": "number",
                "description": "Credits charged less the agency's margin and any creator share."
              }
            },
            "required": [
              "burns",
              "credits",
              "retainedCredits"
            ]
          },
          "matched": {
            "type": "object",
            "properties": {
              "burns": {
                "type": "number"
              },
              "calls": {
                "type": "number",
                "description": "Priced model calls behind those burns."
              },
              "retainedCredits": {
                "type": "number"
              },
              "modelCostUsd": {
                "type": "number",
                "description": "SUM(gateway_calls.cost_usd) for those calls. The only cost column read."
              }
            },
            "required": [
              "burns",
              "calls",
              "retainedCredits",
              "modelCostUsd"
            ]
          },
          "retainedAtPegUsd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "matched.retainedCredits at the list peg, in USD. What the credits retained are worth at the peg, not cash received. null when nothing is matched."
          },
          "marginUsd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "marginPct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Percent of provider cost, comparable to floorPct. null when no priced call backs the plan's burns."
          },
          "floorPct": {
            "type": "number",
            "description": "platform_floor_pct: the lowest platform margin any plan may carry, in percent of cost."
          },
          "verdict": {
            "type": "string",
            "enum": [
              "at_or_above_floor",
              "below_floor",
              "no_usage",
              "no_priced_calls"
            ]
          },
          "unpriced": {
            "type": "object",
            "properties": {
              "calls": {
                "type": "number",
                "description": "Linked model calls with no cost_usd."
              },
              "burnsWithoutCall": {
                "type": "number",
                "description": "Billed burns with no gateway call behind them."
              },
              "unbilledCalls": {
                "type": "number",
                "description": "Model calls no burn charged for, on this plan's groups."
              },
              "unbilledCostUsd": {
                "type": "number",
                "description": "Provider cost of those unbilled calls, where priced."
              }
            },
            "required": [
              "calls",
              "burnsWithoutCall",
              "unbilledCalls",
              "unbilledCostUsd"
            ]
          },
          "coverage": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "matched retained credits over billed retained credits, 0 to 1."
          },
          "bound": {
            "type": "boolean",
            "description": "true when any cost is unknown: marginPct is then not a fact."
          }
        },
        "required": [
          "plan",
          "groups",
          "payingGroups",
          "cohort",
          "grants",
          "billed",
          "matched",
          "retainedAtPegUsd",
          "marginUsd",
          "marginPct",
          "floorPct",
          "verdict",
          "unpriced",
          "coverage",
          "bound"
        ]
      }
    },
    "total": {
      "description": "Number of plans in the answer. Every plan is returned; the list is never cut.",
      "type": "number"
    },
    "truncated": {
      "type": "boolean"
    },
    "sum": {
      "description": "Across every plan.",
      "type": "object",
      "properties": {
        "groups": {
          "type": "number"
        },
        "payingGroups": {
          "type": "number"
        },
        "billedCredits": {
          "type": "number"
        },
        "matchedRetainedCredits": {
          "type": "number"
        },
        "modelCostUsd": {
          "type": "number"
        },
        "unpricedCalls": {
          "type": "number"
        },
        "burnsWithoutCall": {
          "type": "number"
        },
        "unbilledCalls": {
          "type": "number"
        },
        "unbilledCostUsd": {
          "type": "number"
        }
      },
      "required": [
        "groups",
        "payingGroups",
        "billedCredits",
        "matchedRetainedCredits",
        "modelCostUsd",
        "unpricedCalls",
        "burnsWithoutCall",
        "unbilledCalls",
        "unbilledCostUsd"
      ]
    },
    "floorPct": {
      "type": "number"
    },
    "pegUsdPerCredit": {
      "description": "The list peg used for retainedAtPegUsd: USD per credit.",
      "type": "number"
    },
    "costColumn": {
      "description": "The column cost was read from: gateway_calls.cost_usd.",
      "type": "string"
    },
    "marginBasis": {
      "type": "string"
    },
    "asOf": {
      "description": "ISO time the read ran.",
      "type": "string"
    },
    "error": {
      "description": "unauthenticated | forbidden | no_db | invalid_request | margin_unavailable",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}