- Billing screen (Settings → Billing): a per-project and per-type spend breakdown for the current billing period.
- CSV export: the “Export CSV” button on that breakdown downloads exactly what you see, grouped by project or by type.
- API (
GET /v1/usage): the same per-project figures over a date range you choose, for feeding a warehouse, a finance report, or a per-team chargeback.
Who can see spend
Billing is organization-wide financial data, so no project role includes it, not even project Owner or Admin. You can see the Billing screen, the CSV export, and the per-call and per-run cost views if you are:- an organization Owner or Admin, or
- a member an Owner has granted billing access: in Settings → Project → Members, open the member’s Data access and turn on View billing. The grant applies to the whole organization (the Billing screen shows every project’s spend), and it is read-only. Organization settings stay hidden.
Authentication
GET /v1/usage accepts two credentials. Pick the narrower one that does the job.
Project API key (least privilege)
For a team that reports its own spend, use a project key that carriesbilling:read. It reads only its own project: leave out projectId (or pass the key’s own project), and any other projectId returns 403. A key that holds only billing:read can read spend and nothing else.
Create one in Settings → Project → API keys: choose Custom, set every row to No Access if spend is all you need, and turn on Spend. The Spend switch only appears for people who can see billing (see above), and the API refuses billing:read on a key minted by anyone else, so a project admin cannot give themselves spend through a key.
Organization API key
For a finance or warehouse job that needs every project, use an Organization API key (the same credential family used for org provisioning) that carriesusage:read. An org Owner or Admin creates one under Settings → Organization → API keys; new keys get the full organization permission set, so they include usage:read.
Cost visibility is a deliberately separate permission from project access. If you are using an organization key created before usage reporting launched, re-mint it so it carries
usage:read; an older key returns 403 on this endpoint.Endpoint
Query parameters
Example request
Example response
Response fields
totalUsdMicros/totalUsd: total billable spend across the organization (or the single project, whenprojectIdis set) over the window. The total is the sum ofprojects.projects[]: per-project billable spend, highest first. Only projects with spend in the window appear.projectName: the project’s current name, ornullif the project no longer exists.projects[].breakdown[]: that project’s spend split by cost type, highest first, summing to the project’samountUsdMicros. Each entry has asourceand asurface.sourceis the granular cost source (SIM_PLATFORM_FEE,SIM_LLM,SIM_TTS,SIM_STT,SIM_TELEPHONY,METRIC,TRANSCRIPTION); theSIM_*sources are what the Billing screen groups under “Simulation”.surfaceisSIMULATIONorPOST_CALL(a production call). Roll these up however your report needs.- Micros vs dollars:
amountUsdMicrosis the exact, canonical integer (1,000,000=$1, the unit the billing ledger stores). Use it to sum and reconcile against an invoice.amountUsdis the same figure as a convenience float for display.
Amounts are billable spend only. Internal costs Roark absorbs on your behalf are never included, so these figures match what you are charged.
Errors
Paging longer histories
The 366-day ceiling keeps a single request bounded. To report across a longer period, page the window month by month (or quarter by quarter) and sum thetotalUsdMicros from each response.
Per-call and per-run cost
Spend is attributed to the call and to the simulation run that incurred it, not only to the project and window. Both endpoints need a project API key withbilling:read, and read only that key’s project.
One call
METRIC line per grading pass; metricCollectionJobId tells them apart.
One simulation run
conversationId.
conversationId is the call id for voice runs (the chat id for chat runs). It is null for costs incurred before the conversation existed; join those on simulationJobId.