Skip to main content
Every bit of billable work in Roark (simulations, metric evaluations, transcription) is attributed to the project that incurred it. You can read that attribution three ways:
  • 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.
For a single call or simulation run, the call page’s Cost tab and the run report’s Cost section show what it cost, and the API exposes the same figures (see Per-call and per-run cost). This page covers who can see spend, and the API.

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 carries billing: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 carries usage: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, when projectId is set) over the window. The total is the sum of projects.
  • projects[]: per-project billable spend, highest first. Only projects with spend in the window appear.
  • projectName: the project’s current name, or null if the project no longer exists.
  • projects[].breakdown[]: that project’s spend split by cost type, highest first, summing to the project’s amountUsdMicros. Each entry has a source and a surface. source is the granular cost source (SIM_PLATFORM_FEE, SIM_LLM, SIM_TTS, SIM_STT, SIM_TELEPHONY, METRIC, TRANSCRIPTION); the SIM_* sources are what the Billing screen groups under “Simulation”. surface is SIMULATION or POST_CALL (a production call). Roll these up however your report needs.
  • Micros vs dollars: amountUsdMicros is the exact, canonical integer (1,000,000 = $1, the unit the billing ledger stores). Use it to sum and reconcile against an invoice. amountUsd is 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 the totalUsdMicros 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 with billing:read, and read only that key’s project.

One call

The billable spend for one call, split by cost type, with every cost line behind it. A simulated call includes what its simulation spent before the call connected.
A call graded twice carries one METRIC line per grading pass; metricCollectionJobId tells them apart.

One simulation run

The billable spend for one simulation run (run plan job): totals by cost type, and the spend of each simulated call. Safe to call while the run is in progress; totals reflect what has been recorded so far. For a call’s line items, call the per-call endpoint with its 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.

Errors