Skip to main content
GET
Get revenue

Authorizations

Authorization
string
header
required

An API key (onx_sk_…) created in OnlyX under Settings → API & MCP, or an OAuth access token (onx_at_…) issued to a connected app. Send it as Authorization: Bearer <credential>. API keys may also be sent as X-API-Key: <key>.

Query Parameters

creatorId
string | null

Only this creator (cre_…). Without it, every creator the credential can see. A creator the credential cannot see is 404 CREATOR_NOT_FOUND, never an empty report.

Required string length: 1 - 64
days
integer
default:30

The last N calendar days including today (workspace time zone), 1 to 366. Ignored when start or end is sent.

Required range: 1 <= x <= 366
start
string<date> | null

First day of the window (YYYY-MM-DD, workspace time zone), included.

end
string<date> | null

Last day of the window (YYYY-MM-DD), included. The window never extends past today and keeps at most its latest 366 days.

Response

Earnings for the window: totals, by type, by day, by seller and by creator.

Revenue for a window. New fields may be added; ignore fields you do not know.

asOf
string | null
required

When these figures were read from the ledger (UTC).

balance
Balance · object
required
byCreator
RevenueCreator · object[]
required

Per creator, largest first.

byDay
RevenueDay · object[]
required

One entry per day in the window, oldest first, including days with no earnings.

bySeller
RevenueBySeller · object
required

Paid-message sales in chats, split by who sent the message: the AI (ai) or your team (team).

byType
RevenueByType · object[]
required

The window split by what was paid for, largest first.

complete
boolean
required

false when some creator's ledger could not be read in full, so the figures are a lower bound.

coverageFrom
string | null
required

The oldest day the earnings ledger has been read back to for the worst-covered creator; earlier days may be missing.

end
string
required

Last day of the window, included.

start
string
required

First day of the window (YYYY-MM-DD), included.

timezone
string
required

The workspace time zone days are counted in.

totals
RevenueTotals · object
required