---
title: "Revenue against AI cost for platform operators (read-only): MRR, paid invoices, Build Credits sold and used, AI model cost, gross margin, open credit reservations and the teams with the highest AI cost over the last `days` days (default 30)"
method: GET
path: "/operator/billing/revenue"
tags: ["Operator"]
---

# Revenue against AI cost for platform operators (read-only): MRR, paid invoices, Build Credits sold and used, AI model cost, gross margin, open credit reservations and the teams with the highest AI cost over the last \`days\` days (default 30)

`GET /operator/billing/revenue`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/operator/billing/revenue`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `days` integer

## Response `200`

Revenue

- object
  - `days` integer, required
  - `currency` string, required
  - `requiredGrossMargin` number, required
  - `revenuePerCreditCents` number, required
  - `mrr` integer, required: minor units (cents)
  - `paidSubscriptions` integer, required
  - `paidRevenue` object[], required
    - `kind` string, required
    - `currency` string, required
    - `amount` integer, required: minor units (cents)
  - `creditsSold` number, required
  - `creditsSoldValue` integer, required: minor units (cents)
  - `creditsGranted` number, required
  - `creditsUsed` number, required
  - `creditsUsedValue` integer, required: minor units (cents)
  - `aiCostMicros` integer, required: model cost of the AI work paid with Build Credits, micro-USD (1,000,000 = $1)
  - `assistantCostMicros` integer, required: model cost of the dashboard assistant (its own monthly allowance), micro-USD
  - `grossMargin` number, nullable, required
  - `reservations` object, required
    - `held` integer, required
    - `heldCredits` number, required
    - `expired` integer, required
    - `settled` integer, required
    - `shortfallCredits` number, required
  - `topTeams` object[], required
    - `organizationId` string, uuid, required
    - `name` string, required
    - `planId` string, required
    - `aiCostMicros` integer, required
    - `creditsUsed` number, required
    - `grossMargin` number, nullable, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden); details.requiresSession for plan/payment changes over a token
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state, e.g. a subscription already exists (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Billing is not set up on this server (code not_configured)
- `503`: The payment provider is unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
