Docs/Session spend
Organisations

Session spend

What each of a Tenant's sessions spent on AI calls, per UTC day range, under /v1/orgs/{orgId}/usage/sessions.

GET /v1/orgs/{orgId}/usage/sessions lists a Tenant's sessions with what each one spent on AI calls in a date range, so you can charge your customer per session or see which sessions cost the most. It sits next to Organisation usage and takes the same credentials: an owner's or admin's session, or an Organisation Key of this Organisation. A Tenant of another Organisation is 404 not_found.

The figures are what the Organisation is charged for these calls, not an estimate. They are not the Tenant's whole bill: see What is counted.

List a Tenant's session spend

List a Tenant's session spend for OctobercURL
curl -s "$SAI_API_URL/v1/orgs/$ORG_ID/usage/sessions?tenantId=$TENANT_ID&from=2026-10-01&to=2026-10-31&limit=50" \
  -H "Authorization: Bearer $SAI_ORG_KEY"
QueryRequiredNotes
tenantIdyesThe Tenant, as tenantId in Tenants.
fromyesFirst day, YYYY-MM-DD, in UTC. Inclusive.
toyesLast day, YYYY-MM-DD, in UTC. Inclusive. On or after from. The range is at most 93 days, counting both ends.
limitnoSessions per page, 1 to 100. Default 50.
cursornoThe nextCursor of the previous page. Keep from and to the same.
200 OK · Session spendJSON
{
  "sessions": [
    {
      "sessionId": "cs_01HZY",
      "title": "Reconcile the October invoices",
      "costUsd": 0.4172,
      "modelCalls": 23,
      "firstDay": "2026-10-03",
      "lastDay": "2026-10-04"
    }
  ],
  "nextCursor": null,
  "dataThrough": "2026-10-28T09:45:00Z"
}
FieldNotes
sessionIdThe session, as in /v1/agents/events.
titleThe session's title. An empty string, or null, when it has none.
costUsdWhat the session's AI calls cost on the days inside from to to, in US dollars. Not rounded to cents.
modelCallsThe AI calls counted in costUsd, on the days inside from to to only.
firstDay, lastDayThe UTC days the session's spend was first and last counted, over its whole life, not just the range. They can fall outside from to to. A call that is charged late can count toward an earlier day without moving firstDay.
nextCursorPass as cursor for the next page. null on the last page.
dataThroughThe time the figures are complete up to. Calls after it are not counted yet. null when unknown.

Sessions come in order of firstDay, oldest first. A session that spent nothing in the range is left out. Paging never returns a session twice. But a session that starts or resumes spending while you page may be missed by that pass and show up only when you page again. For a range wholly in the past, older than the lag, the results don't change.

A page can hold fewer sessions than limit, or none at all, and still have a nextCursor. Keep paging until nextCursor is null; an empty page is not the end.

Each Tenant can be read at most 1200 pages an hour, counted from its first page in the hour. Pages read with a member's session for the same Tenant count too. Past that, requests get 429 rate_limited until the hour is up.

StatuserrorWhen
400invalid_requesttenantId is missing or sent twice; from or to is missing, sent twice, or not a real day in YYYY-MM-DD form; to is before from; the range is longer than 93 days; limit is not 1 to 100; or cursor is not one this endpoint gave.
403session_requiredA personal API key, or any credential other than a member's session or an Organisation Key.
403not_available_for_tenantA Tenant token.
403organisation_disabledAn Organisation Key of a disabled Organisation.
404not_foundNo such Organisation, not yours, or an Organisation Key of another Organisation; or no such Tenant in it.
429rate_limitedMore than 1200 pages for this Tenant within the hour.
503session_usage_unavailableSession spend can't be served right now: it isn't available yet, or spend can't be read at the moment. Try again later.
503billing_unavailableSpend could not be read right now. Try again shortly.
400 Bad Request · invalid_requestJSON
{ "error": "invalid_request", "message": "from and to are at most 93 days apart, inclusive" }

What is counted

A session's spend is its AI calls: the model calls Sai makes to do the task, choosing a model when the session uses auto, locating elements on the screen, and the calls Sai makes after a task finishes, to fill in output_schema and check success_criteria.

  • Only AI calls. Computer time, residential proxy traffic and storage are not split by session. Read them per Tenant from Organisation usage.
  • The sessions don't add up to the Tenant's bill. Adding up every session's costUsd can come to less than what the Tenant cost. Besides computer time, proxy traffic and storage, it leaves out AI calls that don't belong to a chat session, such as writing or repairing learned code, and the spend of sessions that were deleted. For the Tenant's own spend, see its entry under byTenant in Organisation usage.
  • Spend from before this endpoint shipped is not counted. Sessions that ran before then read low or are missing.
  • Locating elements on the screen is counted once the machine's Sai runtime is updated, where that work runs on the machine. Until then, those calls are missing from the sessions that ran on it.

When the figures are final

  • Days are UTC. A session that runs across the edge of your range counts only the days inside it.
  • The figures lag, usually by 15 to 20 minutes, and longer when a backlog builds. The most recent day reads low until they catch up; dataThrough says how far they go.
  • A running session's figures change each time you ask.
  • The calls after a task finishes are charged a little after the task ends, so a session can still go up for a few minutes after it goes idle.

Compared with sessionUsage on /events

sessionUsage on GET /v1/agents/events is a live count while you watch a task. It covers only the model calls Sai makes to do the task, not choosing a model, locating elements or the calls Sai makes after a task finishes, to fill in output_schema and check success_criteria. Its costUsd is also rounded to cents and this endpoint's is not, so the two won't match exactly. Use this endpoint for what a session cost.

© 2026 Simular Inc. All rights reserved.