Clavem

Get started

Floating licenses

A floating license has a number of seats that any number of machines share. Your app holds a seat while it runs, keeps it with a heartbeat and gives it back when it quits, and a seat whose app crashed frees itself.

How floating seats work

Teams, studios, schools and labs often install an app on more machines than people use at once, and want to pay for the copies running at the same time. A floating license sells exactly that: a license with 10 seats lets any 10 machines run the app at once, whichever they are.

  1. The app takes a seat when it starts. It calls POST /v1/licenses/activate with the key and a fingerprint of the machine, and gets a seat for a lease of 15 minutes (you choose the length).
  2. It keeps the seat with a heartbeat. Every heartbeat_seconds (300 seconds by default, a third of the lease) it calls POST /v1/licenses/heartbeat, which renews the lease and returns a fresh token.
  3. It gives the seat back when it quits. POST /v1/licenses/deactivate frees the seat at once, for the next machine.
  4. A crash frees the seat by itself. A lease that is not renewed ends on its own, so an app that crashed or lost its network blocks a seat for at most one lease.
  5. When every seat is held, the next machine is told so. Activate answers 409 with seats_full and the counts. Nobody who is working is ever thrown out.

Clavem keeps the seat count, whichever of Stripe, Polar, Dodo Payments, Creem or Paddle sold the license. None of them has floating seats of its own.

Devices or floating seats

Each product has one license type, chosen on its License rules. Licenses already sold keep the type they were sold with.

Devices (the default)Floating seats
What is countedDevices that activated the key, until one is removed. A device that is switched off still counts.Apps running right now. A machine that is switched off holds no seat.
The limitA device limit, or no limit.Seats, 1 to 10,000. Never unlimited.
A seat is freedWhen the app, the buyer or you remove the device.When the app quits, when its lease ends, or when the buyer or you free it.
OfflineThe token is good for 14 days.The token is good until the lease, or a borrow, ends. Then the app stops.
SuitsA license for one person and their own computers.Teams, studios, classrooms, labs, render farms and build machines.

Make a product floating

In the dashboard, open the product and its License rules, and set License type to Floating seats. Three settings come with it:

  • Seats per unit. How many seats one unit of a purchase gives, 1 to 10,000. Set it to 10 to sell a 10-seat license for one price, or to 1 to sell seats one by one with the quantity the buyer picks (see selling seats). A plan of the product can have its own Seats, so a Team plan can give 5 seats and a Studio plan 20.
  • Lease in minutes. How long a seat stays held after the last heartbeat, from 2 minutes to 24 hours. 15 minutes unless you change it. See sizing the lease.
  • Longest borrow in days. How long one machine may keep its seat while it works offline, up to 30 days. 0, the default, turns borrowing off. See borrowing.

The same fields are on the product in the management API, as license_type (devices or floating), activation_limit (the seats per unit), lease_seconds (120 to 86,400) and max_borrow_hours (0 to 720), and on the create_product and update_product tools of the MCP server.

Make product 75 floating
curl -X PATCH https://clavem.io/v1/admin/products/75 \
  -H "Authorization: Bearer sk_clavem_…" \
  -H "Content-Type: application/json" \
  -d '{
    "license_type": "floating",
    "activation_limit": 1,
    "lease_seconds": 900,
    "max_borrow_hours": 72
  }'

You can change a product's type at any time. A license keeps the type it was sold with, so the device licenses you sold before stay device licenses, with the same device limit, and only new sales are floating. A free trial of a floating product is floating too, with one seat, so your app runs the same loop during the trial as after the purchase.

The app loop

A floating license is used the whole time the app runs, not once per device. The loop has three calls.

1. When the app starts: activate

Send the key, your product id, a name for the machine and its fingerprint, which a floating license requires (how to make one). The same fingerprint always gets its own seat back: an app that restarts after a crash takes over the seat it had, never a second one. A machine whose seat ended (the app quit, or the lease ran out) gets a new instance.id with its next seat, and the old one answers 404 instance_not_found from then on. Clavem keeps one record per machine, so Analytics counts machines, not launches.

curl
curl https://clavem.io/v1/licenses/activate \
  -H "Content-Type: application/json" \
  -d '{
    "license_key": "YOUR-LICENSE-KEY",
    "product_id": 75,
    "instance_name": "Studio Mac 3",
    "fingerprint": "6e1f0c55d2a94b7e"
  }'
Response200 OK
{
  "activated": true,
  "error": null,
  "seat": {
    "lease_expires_at": "2026-12-05T09:15:00.000Z",
    "heartbeat_seconds": 300,
    "borrowed_until": null
  },
  "license_key": {
    "id": 4182,
    "status": "active",
    "key": "YOUR-LICENSE-KEY",
    "activation_limit": 10,
    "activation_usage": 4,
    "created_at": "2026-12-01T10:02:11.000Z",
    "expires_at": null,
    "test_mode": false,
    "plan": null,
    "entitlements": {},
    "updates_until": null,
    "license_type": "floating",
    "seats": 10,
    "seats_in_use": 4,
    "seats_borrowed": 0
  },
  "instance": {
    "id": "0b8e6f3a-5c1d-4e2b-9a7f-3d6c2e1b0a94",
    "name": "Studio Mac 3",
    "created_at": "2026-12-05T09:00:00.000Z"
  },
  "meta": { … },
  "token": "sgt1.eyJ2IjoxLCJsaWQiOjQxODIs…"
}

Keep instance.id and the token. seat.lease_expires_at is when the seat ends without a heartbeat, and seat.heartbeat_seconds how often to send one. license_key has license_type: "floating", the seats, the seats_in_use and the seats_borrowed, and repeats the seats and the seats in use as activation_limit and activation_usage, so an app written for device licenses reads them as its limit.

2. While it runs: a heartbeat every heartbeat_seconds

curl
curl https://clavem.io/v1/licenses/heartbeat \
  -H "Content-Type: application/json" \
  -d '{
    "license_key": "YOUR-LICENSE-KEY",
    "product_id": 75,
    "instance_id": "0b8e6f3a-5c1d-4e2b-9a7f-3d6c2e1b0a94"
  }'
Response200 OK
{
  "renewed": true,
  "error": null,
  "seat": {
    "lease_expires_at": "2026-12-05T09:20:00.000Z",
    "heartbeat_seconds": 300,
    "borrowed_until": null
  },
  "license_key": { "license_type": "floating", "seats": 10, "seats_in_use": 4, "seats_borrowed": 0, … },
  "instance": { "id": "0b8e6f3a-5c1d-4e2b-9a7f-3d6c2e1b0a94", … },
  "meta": { … },
  "token": "sgt1.eyJ2IjoxLCJsaWQiOjQxODIs…"
}

Each heartbeat renews the lease to the full length from now and returns a fresh token, which replaces the old one. Heartbeats are not validations: they are not counted on the Analytics page as validations, installs or live calls, and they are never charged. Send them from a timer that keeps running while the app is open.

  • A heartbeat after the lease ran out (the laptop slept, the network was down) takes the seat back when one is free and the machine holds no other seat. When every seat is taken by then, it answers 409 seats_full, and the app stops as below.
  • A seat that was given back, by your app, by the buyer on their license page or by you, answers 404 with code: "instance_not_found", and never comes back. Activate again to take a new seat.
  • No answer, a 429 or a 5xx: keep working with the seat you have, until the token's refresh_by (see offline).

A validate that sends the seat's instance_id renews a live lease as well, so an app that already validates on a timer keeps its seat. It does not take back a lease that ran out, which answers 404 instance_not_found. A validate without instance_id answers the license, its seats and the seats in use, with token: null: a floating license's token comes only with a seat.

3. When it quits: deactivate

Send the key, the product id and the instance_id. The seat is free for the next machine at once. A deactivate of a lease that already ran out gives it back for good as well, so a later heartbeat answers 404 instead of taking it again.

The whole loop in code

In JavaScript, as the Developers page of your dashboard shows it, with your product id filled in. verifyToken is the Verify offline snippet on the same page; stopLicensedWork is yours: save the user's work and show your license screen. The Developers page has the same loop in cURL, Swift, Rust, PHP and Python, shown when you pick a floating product.

floating-seat.js
const PRODUCT_ID = 75;
// Test-mode licenses come from Stripe test mode, a Polar sandbox, Dodo test mode, Creem test mode or a Paddle sandbox and end within 7 days. Accept them only in your own debug builds.
const ALLOW_TEST_LICENSES = false;

// fingerprint: a stable id of this computer. Add your own suffix to give each running copy of the app its own seat.
// A floating token's refresh_by is the end of the lease: a hard stop, never 14 days.

async function post(url, fields) {
  const res = await fetch(url, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ license_key: licenseKey, product_id: PRODUCT_ID, ...fields }),
  });
  return { status: res.status, data: await res.json() };
}
const leaseEnd = async (token) => (await verifyToken(token))?.refresh_by ?? 0;

// 1. When the app starts: take a seat.
const { data } = await post("https://clavem.io/v1/licenses/activate", { instance_name: "Studio Mac 3", fingerprint });
if (data.code === "seats_full") throw new Error(`All ${data.seats} seats are in use. Close the app on another computer and try again.`);
if (!data.activated) throw new Error(data.error);
if (data.meta.product_id !== PRODUCT_ID) throw new Error("This key is for another app");
if (data.license_key.test_mode && !ALLOW_TEST_LICENSES) throw new Error("This is a test license");
const instanceId = data.instance.id;
let refreshBy = await leaseEnd(data.token);

// 2. While the app runs: a heartbeat every heartbeat_seconds keeps the seat.
const timer = setInterval(async () => {
  try {
    const answer = await post("https://clavem.io/v1/licenses/heartbeat", { instance_id: instanceId });
    if (answer.data.renewed) {
      refreshBy = await leaseEnd(answer.data.token);
      return;
    }
    // 409 seats_full: the lease ran out and every seat is taken. 404 instance_not_found: the seat was freed.
    if (answer.status !== 429 && answer.status < 500) {
      clearInterval(timer);
      return stopLicensedWork(answer.data.error);
    }
  } catch {
    // No connection: keep working with the seat you have. A heartbeat that gets through later takes it back if one is free.
  }
  if (Date.now() / 1000 >= refreshBy) stopLicensedWork("Connect to the internet to keep using the app.");
}, data.seat.heartbeat_seconds * 1000);

// 3. On quit: give the seat back, so another computer can take it at once.
async function quit() {
  clearInterval(timer);
  await post("https://clavem.io/v1/licenses/deactivate", { instance_id: instanceId });
}

When every seat is taken

Activate answers 409 with code: "seats_full", the license's seats and the seats_in_use, and no token. Nobody is thrown out to make room: Clavem never takes a seat from a machine that holds one.

Response409 Conflict
{
  "activated": false,
  "code": "seats_full",
  "error": "All seats of this license key are in use. Close the app on another computer and try again.",
  "seats": 10,
  "seats_in_use": 10
}

Say so plainly, with the numbers: "All 10 seats are in use. Close the app on another computer, or ask your administrator for more seats." Offer a Try again button, since a seat frees itself when an app quits or a lease ends, and a link to buy more seats if the buyer can. Do not retry in a loop.

A seat stuck on a machine nobody can reach (a stolen laptop, a deleted virtual machine) frees itself when its lease ends. Before that, the buyer can free it on their license page with Free seat, which never counts as one of their device moves, and you can free it on the license's page in the dashboard, with DELETE /v1/admin/licenses/:id/instances/:instance_id or with the deactivate_device MCP tool. A seat freed by hand is never taken back by that machine's heartbeat.

Every refusal is counted, so the Analytics page can show you which customers need more seats.

One seat per machine or per process

A seat belongs to a fingerprint. Two copies of your app on the same machine, with the same fingerprint, share one seat, and a copy that restarts gets its seat back. When one copy quits and deactivates, the seat is given back for both: the other copy's next heartbeat answers 404 instance_not_found, and it stops like any app whose seat was given back. That suits most desktop apps: one seat per computer.

If each running copy should take its own seat (a render node that runs four jobs, a build server that runs parallel builds), add a suffix of your own to the fingerprint, such as a random id made when the process starts. Then a copy that crashed keeps its seat until its lease ends, because its restart has a new id. Cloned virtual machines and containers can share a machine id; there too, a random id per process keeps them apart.

Offline: the lease is a hard stop

The token of a floating license works like any Clavem token (see offline verification), with two claims more and one rule changed:

  • lt is "floating", and lease_exp is the end of the seat's lease or borrow, in seconds since the Unix epoch.
  • refresh_by is that same end, not 14 days from now. It is a hard stop: once it has passed without a heartbeat getting through, the app must stop licensed work.
Decoded token of a floating seat (sample values)
{
  "v": 1,
  "lid": 4182,
  "pid": 75,
  "kh": "3f9a0c1e7b2d4a68",
  "status": "active",
  "valid": true,
  "email": "studio@example.com",
  "iat": 1796461200,
  "refresh_by": 1796462100,
  "iid": "0b8e6f3a-5c1d-4e2b-9a7f-3d6c2e1b0a94",
  "fp": "6e1f0c55d2a94b7e",
  "lt": "floating",
  "lease_exp": 1796462100,
  …
}

So an app that loses its network keeps working until its lease ends, 15 minutes after the last heartbeat by default, then stops, and its seat frees itself for someone else. A heartbeat that gets through later takes the seat back if one is free. For longer offline work, the machine borrows its seat first. A device license's token is unchanged: no new claims, and its refresh_by is still 14 days.

Borrowing a seat

When a product allows it (Longest borrow in days above 0, or max_borrow_hours), a machine that holds a seat can keep it for a number of hours while it works offline: on a plane, on a site visit, at home without a VPN.

curl
curl https://clavem.io/v1/licenses/borrow \
  -H "Content-Type: application/json" \
  -d '{
    "license_key": "YOUR-LICENSE-KEY",
    "product_id": 75,
    "instance_id": "0b8e6f3a-5c1d-4e2b-9a7f-3d6c2e1b0a94",
    "hours": 72
  }'
Response200 OK
{
  "borrowed": true,
  "error": null,
  "seat": {
    "lease_expires_at": "2026-12-08T09:05:00.000Z",
    "heartbeat_seconds": 300,
    "borrowed_until": "2026-12-08T09:05:00.000Z"
  },
  "license_key": { "seats": 10, "seats_in_use": 4, "seats_borrowed": 1, … },
  "instance": { … },
  "meta": { … },
  "token": "sgt1.eyJ2IjoxLCJsaWQiOjQxODIs…"
}
  • hours is a whole number from 1 to the product's max_borrow_hours. More answers 400 with code: "borrow_too_long" and max_hours. A product that does not allow borrowing answers 403 with code: "borrow_disabled".
  • Only a seat the machine holds now can be borrowed. Otherwise the answer is 404 instance_not_found: activate first, then borrow.
  • A borrowed seat is not a free seat. It stays held for the whole borrow, even if the machine never comes back, and heartbeats leave it as it is. The token's refresh_by is the end of the borrow.
  • The machine gives it back early with deactivate, and the buyer or you can free it by hand.

Sizing the lease

The lease is how long a seat stays held after the last heartbeat. The app sends a heartbeat every third of the lease, so two heartbeats can fail and the seat is still held.

  • A short lease frees the seat of a crashed app sooner, and a machine that sleeps or drops off the network loses its seat sooner too.
  • A long lease forgives a flaky network, and keeps a crashed app's seat blocked longer. A lease of 24 hours makes floating seats close to a daily checkout.

15 minutes, with a heartbeat every 5 minutes, suits most desktop apps. A product whose machines come and go quickly, such as a build pool, can go down to 2 minutes. The heartbeat is cheap: it is never counted or charged, and each seat may send 20 a minute before it is rate limited.

Selling seats

A purchase of a floating product gives one license key, whatever the quantity. Its seats are the units bought times the seats per unit (the plan's Seats, or else the product's), at most 10,000. Several lines of the same product in one purchase add up into the one key. Device products keep their rule: on Stripe, one key per unit, up to 100; on Polar, Dodo Payments, Creem and Paddle, one license per product.

  • Fixed seats. Set the seats per unit (or the plan's seats) to the size of the license, say 10, and sell it for one price. One purchase gives one key with 10 seats. This works with every provider.
  • Seats by quantity. Set the seats per unit to 1 and let the quantity decide: a quantity of 25 gives one key with 25 seats. Sell it with a price per unit; package and tiered prices, where the quantity is not the number of units, are not supported.

Who can pick the quantity depends on the provider. Each provider's page says how in its Quantity and seats section:

ProviderThe buyer picks the quantityDetails
StripeYes, for a one-time purchaseTurn on adjustable quantity on the Checkout Session or the Payment Link. For a subscription, check that your Stripe account's checkout offers it, or set the quantity when you create the Checkout Session.
PolarYesA seat-based or unit-based price.
PaddleYesGive the price a quantity range. Without one, Paddle allows 1 to 100.
Dodo PaymentsNoUse fixed seats, or a checkout link you make with a quantity.
CreemNoUse fixed seats, or a checkout you make with a number of units.
  • Subscriptions follow their quantity. When the buyer or you change the quantity of a subscription, the license's seats follow, each unit with the seats per unit the license was sold with. More seats count at once. Fewer seats never throw anyone out: machines that hold a seat keep it, and new activations wait until fewer seats are in use than the new number.
  • A quantity that does not arrive. If a sale of a floating product comes without a quantity, the license gets 1 unit and your activity feed says "Quantity not received, check the seats". A subscription update without one leaves the seats as they are. A sale above 10,000 seats is cut to 10,000, and the activity feed says so too.
  • More seats for a one-time license. A second purchase gives a second key with its own seats. To grow the first key instead, raise its seats by hand.
  • Seats by hand. On the license's page choose Change limits, or send activation_limit with PATCH /v1/admin/licenses/:id, or use set_license_limit in MCP: 1 to 10,000 seats. Your number stays until the subscription's quantity really changes.
  • Refunds work as for any license: a full refund of a one-time purchase disables the key. A partial refund changes no seats.

Update renewals of a floating license

A paid update renewal renews the whole license, so the buyer pays the renewal price for each unit the license has. Stripe Checkout, Dodo Payments and Paddle sell the license's units in the renewal checkout. A Paddle price allows 1 to 100 units unless you widen its quantity range, so for a bigger license widen it or renew by hand.

Polar, Creem and a Stripe Payment Link (the only way the Stripe App sells a renewal) cannot set a quantity. A floating license of more than one unit that renews there is renewed through you: its order page tells the buyer to contact you, and once they have paid, you set its Updates until under Change limits. A license of one unit renews as usual. A renewal that paid for fewer units than the license has extends nothing, and your activity feed says "Renewal paid for too few units".

Pay As You Go and plans

  • Pay As You Go charges $0.30 per seat of a floating license, once, when it is issued: a 10-seat license costs $3.00. A device license stays $0.30 whatever its device limit.
  • More seats later are charged when they are added, and only above the most seats the license has been charged for. A subscription that goes from 5 to 10 seats, back to 5 and up to 10 again pays for the 5 added seats once.
  • Fewer seats, refunds and cancellations credit nothing. Renewals, test-mode licenses, activations, validations, heartbeats and downloads are never charged or counted.
  • When the balance cannot cover it, a sale or a seat increase is held, as any sale is: the account pauses and you get one email. The buyer of a new license gets the key once you top up; a license that grows keeps its seats until then, and the machines using it keep working. A top-up releases what was held, oldest first. While a seat increase of a working license waits, the account cannot switch to Free; one of a license that was refunded, disabled or has ended is dropped without a charge and does not hold the account back.
  • On the Free, Indie, Studio and Scale plans each seat of an active floating license counts as one license toward the plan's license limit: a 10-seat license counts as 10. Sales and subscription changes are never refused for the limit; licenses and seats you add by hand are.

The pricing page has the plans.

Seat analytics

When you have floating licenses, the Analytics page has a Floating seats section for the days you chose:

  • In use now, against the seats your customers own, with how many are borrowed.
  • Peak in use: the busiest day. A day's peak adds up each license's own busiest moment, which may have come at different hours, so it is an upper bound of the seats in use at one time.
  • Turned away: requests refused because every seat was taken, an activate or a heartbeat after its lease ran out. It counts requests, not different machines: one machine that tries three times counts three.
  • At their limit: the licenses that turned a machine away, most first, with their peak against their seats. These are the customers who may want more seats.
  • The peak seats in use per day as a chart and, with more than one floating product, the seats by product.

Test-mode licenses are left out. Heartbeats never show up as installs, validations or calls in the live view, and a machine that starts the app every day is one device, not one per launch. More on the Analytics page.

Seats in the dashboard, API and MCP

A floating license's page in the dashboard lists the seats in use, held or borrowed, with when each was taken, its last heartbeat and when its lease or borrow ends, then the newest seats that ended. Free seat frees one, and Change limits sets the seats. The license list shows the seats in use.

The management API and the MCP server give a floating license license_type, seats, seats_in_use, seats_borrowed, seat_units, seats_per_unit and pending_seat_units (units of a subscription increase that wait for the balance), and its instances are the seats held now, each with lease_expires_at, borrowed_until, last_heartbeat_at and a state of held or borrowed. A device license gains only license_type.

Buyers see their seats too: the license email says "10 seats", the order page shows "Seats 3 of 10", and their license page lists the seats in use, with Free seat for one that is stuck. Freeing a seat there never counts as one of their device moves.