Organisations
Create, list, rename and delete Organisations under /v1/orgs.
These are the endpoints the portal calls to manage Organisations. They accept a signed-in person's session only. Any other credential gets 403:
The exceptions are Organisation usage and Session spend, which also take an Organisation Key of that Organisation.
A person who is not a member of the Organisation gets 404 not_found, so the routes never confirm that an Organisation exists. A member without the role a route needs gets 403 forbidden.
The Organisation object
{
"orgId": "org_3f9a1c0b7e2d4a6f8c10",
"name": "Acme Health",
"status": "active",
"role": "owner",
"createdAt": 1790000000000
}Create an Organisation
Anyone signed in. You become its owner.
curl -s "$SAI_API_URL/v1/orgs" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Acme Health" }'{
"orgId": "org_3f9a1c0b7e2d4a6f8c10",
"name": "Acme Health",
"status": "active",
"role": "owner",
"createdAt": 1790000000000
}List your Organisations
Anyone signed in. Lists every Organisation you are a member of, with your role in each.
curl -s "$SAI_API_URL/v1/orgs" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN"{
"organisations": [
{
"orgId": "org_3f9a1c0b7e2d4a6f8c10",
"name": "Acme Health",
"status": "active",
"role": "owner",
"createdAt": 1790000000000
}
]
}Get an Organisation
Owner or admin.
curl -s "$SAI_API_URL/v1/orgs/$ORG_ID" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN"200 with the Organisation, or 404 not_found.
Rename an Organisation
Owner only.
curl -s -X PATCH "$SAI_API_URL/v1/orgs/$ORG_ID" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Acme Health Group" }'200 with the renamed Organisation.
Organisation usage
Owner or admin, or an Organisation Key of this Organisation. Another Organisation's key gets 404 not_found. This is what the console's Billing page shows.
curl -s "$SAI_API_URL/v1/orgs/$ORG_ID/usage?granularity=month&from=2026-10&to=2026-10" \
-H "Authorization: Bearer $SAI_ORG_KEY"{
"granularity": "month",
"from": "2026-10",
"to": "2026-10",
"totals": {
"costCents": 1840,
"byTenant": {
"Xk2p9QzR4tLm8vNa3bCd": {
"tenantId": "Xk2p9QzR4tLm8vNa3bCd",
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"costCents": 1215,
"byCategory": { "token": { "costCents": 905 }, "compute": { "costCents": 310 } }
}
}
},
"buckets": [{ "bucket": "2026-10", "costCents": 1840, "byTenant": { "...": "..." } }]
}totals covers the whole range and buckets has the same numbers per period. byTenant holds the spend that is tied to a Tenant, with byCategory splitting it by kind, such as token for AI calls and compute for computer time. costCents can be more than the sum of byTenant: spend not tied to any Tenant is in no entry, and each period holds at most 500 Tenants. At most 500 Tenants get a name in one answer. Read the Tenant's id from tenantId, not from the map key. For what each of a Tenant's sessions spent on AI calls, see Session spend.
Delete an Organisation
Owner only. Every Tenant must be deleted first.
curl -s -X DELETE "$SAI_API_URL/v1/orgs/$ORG_ID" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN"204 No Content. Deleting an Organisation removes its keys, members and pending invitations. Unspent credit is lost.
While any Tenant exists, active or disabled, the delete returns 409 and lists them, at most 100, with more set when there are others:
{
"error": "organisation_has_tenants",
"message": "Delete every Tenant before deleting the Organisation.",
"tenants": [{ "tenantId": "Xk2p9QzR4tLm8vNa3bCd", "name": "Riverside Clinic" }],
"more": false
}