Tenants
Create, list, update, disable and delete Tenants under /v1/tenants with an Organisation Key.
A Tenant is one of your customers. It has its own machines, files and sessions, kept apart from every other Tenant's. Your backend manages Tenants with an Organisation Key. The Organisation comes from the key, never from the request. Any other credential gets 403:
{ "error": "organisation_key_required", "message": "Tenant routes take an Organisation Key." }A Tenant token gets 403 not_available_for_tenant instead. A Tenant of another Organisation is 404 not_found. The console's Tenants page in the portal does the same things for a signed-in owner or admin.
The Tenant object
{
"tenantId": "Xk2p9QzR4tLm8vNa3bCd",
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" },
"status": "active",
"createdAt": 1790000000000,
"disabledAt": null,
"storageBytes": 52428800,
"monthlyBudgetCents": 5000,
"cloudMachineLimit": 10,
"residentialProxy": false,
"ownComputerAccess": false,
"cloudMachineCount": 3,
"machineCount": 2
}Create a Tenant
curl -s "$SAI_API_URL/v1/tenants" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" }
}'{
"tenantId": "Xk2p9QzR4tLm8vNa3bCd",
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" },
"status": "active",
"createdAt": 1790000000000,
"disabledAt": null,
"storageBytes": 0,
"monthlyBudgetCents": null,
"cloudMachineLimit": null,
"machineCount": 0
}List Tenants
curl -s "$SAI_API_URL/v1/tenants?status=active&limit=50" \
-H "Authorization: Bearer $SAI_ORG_KEY"{
"tenants": [{ "tenantId": "Xk2p9QzR4tLm8vNa3bCd", "name": "Riverside Clinic", "...": "..." }],
"nextCursor": null
}Newest first. nextCursor is null on the last page. With externalId, the list has zero or one Tenant, so you can map your own customer to a Tenant without storing tenantId:
curl -s "$SAI_API_URL/v1/tenants?externalId=clinic-4821" \
-H "Authorization: Bearer $SAI_ORG_KEY"Get a Tenant
curl -s "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY"200 with the Tenant, or 404 not_found.
Update a Tenant
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Riverside Clinic East",
"metadata": { "plan": "enterprise" }
}'Send at least one field. 200 with the updated Tenant.
Only an Organisation Key, or an owner of the Organisation, can set cloudMachineLimit, residentialProxy or ownComputerAccess. An admin can read them but not change them.
Budgets
A Tenant can have a monthly budget, so one customer can't run up your Organisation's balance. It covers the Tenant's model and tool spend. The money always comes from the Organisation's balance; the budget is only a limit. A Tenant has no budget until you set one.
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{ "monthlyBudgetCents": 5000 }'monthlyBudgetCents is an integer from 1 ($0.01) to 100000000 ($1,000,000), or null to remove the budget. Set it with an Organisation Key, or as an owner on the console's Tenants page. Admins can see a budget but not change it, and a Tenant cannot change its own.
Spend counts per calendar month in UTC. Once a Tenant reaches its budget, its new model and tool calls and new messages are refused with 403:
{
"error": "spend_cap_reached",
"scope": "tenant",
"message": "This Tenant has reached the monthly budget its Organisation set. ...",
"resetsAt": "2026-11-01T00:00:00.000Z"
}resetsAt is the start of the next UTC month. Raising or removing the budget reopens the Tenant sooner. The budget is soft: calls already running when it is reached finish, so a Tenant can go slightly past it. See Spend limits.
A Tenant's cloud machines count toward its budget too. At its budget, the Tenant cannot create a cloud machine or wake a hibernated one. Machines that are on keep running until they hibernate.
Limit a Tenant's cloud machines
A Tenant can have any number of cloud machines until you set a limit.
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{ "cloudMachineLimit": 2 }'cloudMachineLimit is an integer from 0 to 1000, or null to remove the limit. 0 stops new creates. Enrolled machines don't count toward it.
Once the Tenant has that many cloud machines, a create answers 409 machine_limit_reached. Lowering the limit below the Tenant's count deletes nothing. Creates are refused until the count is under the limit.
Own computers
A Tenant's token can start learn jobs and open direct control on the Tenant's computers. On a cloud machine that works at once. On an enrolled machine, the Tenant's own computer, both run code with its real screen, mouse and keyboard, so they stay off until you turn them on. Get your end user's consent first:
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{ "ownComputerAccess": true }'Until then, both answer 403 own_computer_access_off on an enrolled machine. Send false to turn it off again. Only an Organisation Key or an owner of the Organisation can change it; a Tenant cannot change its own. Messages to Sai are not affected. You can also flip the switch on the Tenant's page in the console.
Disable a Tenant
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "disabled" }'200 with the Tenant, status now disabled. A disabled Tenant cannot run anything:
- Its Tenant tokens are refused, and the exchange returns
403 tenant_disabled. - Its machines stay enrolled but cannot connect.
- No enrollment code can be created for it.
{ "status": "active" } brings it back with its machines and data.
A disabled Tenant's cloud machines hibernate within 30 minutes and cannot be woken or created. They stay listed, and you can still delete them. Once the Tenant is enabled again, the next message wakes a machine.
A disabled Tenant keeps its files until it is erased. The console lists disabled Tenants with their storage and spend.
Delete a Tenant
curl -s -X DELETE "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY"204 No Content. The Tenant is disabled and every machine is revoked. The machines must be enrolled again if the Tenant is enabled later.
This call revokes enrolled machines only. The Tenant's cloud machines hibernate and keep their disks. Delete them first if you don't want to keep them, or erase the Tenant.
To erase a Tenant's data, delete it from the console's Tenants page. Erasure removes the Tenant's machines, sessions, files, memory and search history, and frees its externalId. It cannot be undone. The Tenant must be disabled for an hour first.
Until a deleted Tenant is erased, its files are kept. The console lists it with its storage and spend.