Monetization
You can charge other accounts for running your actor. The price is per result (each item in the run's dataset) or per event that your code reports (a page opened, a profile checked, a file converted). When another account runs your actor, it pays your price on top of its usual usage, and you earn a share of what it actually paid.
Pricing model
An actor's pricing is a list of events, each with a USD price:
{
"events": {
"result_item": { "title": "Result item", "price_usd": 0.0005 },
"page_opened": { "title": "Page opened", "price_usd": 0.002 }
}
}
| Key | Meaning |
|---|---|
events.<name> | One priced event. result_item is special: it is counted from the run's results. |
title | Label shown to callers. |
price_usd | Price of one event, in USD. |
tiers | Optional: a price per plan, for example {"scale": 0.0004, "business": 0.0003}. An account pays its plan's price, or price_usd when its plan has none. A tier price of 0 makes the event free on that plan. |
Rules:
- Event names start with a letter or digit, then may also use
.,_and-, up to 60 characters. - Price caps: at most $1.00 per event and $0.10 per result item. Tier prices follow the same caps.
- Prices are fixed when a run starts. A price change applies to runs that start after it.
- Runs of your actor in your own account earn nothing.
- The Store shows the price on the actor's card, for example
$0.50 / 1k resultsorPay per event.
Set the pricing in the Console on your actor, or with the API:
curl -X PATCH "https://lantfly.com/api/v3/actors/<username>~my-actor" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pricing": {"events": {"result_item": {"title": "Result item", "price_usd": 0.0005}}}}'
Pay per result
With a result_item price, the platform counts the run's results when the run ends and charges them. You do not call anything from your code. Make each dataset item one real result, and keep diagnostic rows (the SDK's error rows) apart from results.
Pay per event
Report each event from your code while the run is active:
await Actor.charge('page_opened'); // one event
await Actor.charge('page_opened', 10); // ten events
await Actor.charge("page_opened")
await Actor.charge("page_opened", 10)
Or with the API and the run token:
curl -X POST "$LANTFLY_API_BASE_URL/runs/$LANTFLY_ACTOR_RUN_ID/charge" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"event_name": "page_opened", "count": 1}'
| Answer | Meaning |
|---|---|
201 with charged_event_counts | The events were counted. |
409 run_finished | The run already ended. |
503 charge_busy with Retry-After: 1 | Nothing was counted. Send the same request (same Idempotency-Key) again. The SDKs do this. |
422 | An invalid event name, or result_item (counted from results, not charged). |
Locally, Actor.charge does nothing.
What callers control
Callers can cap what a run may cost them:
| Run option | Meaning | Visible to your actor as |
|---|---|---|
max_items | Stop paying past this many dataset items. | LANTFLY_MAX_PAID_DATASET_ITEMS |
max_total_charge_usd | Cap on event and result charges together (events first). | LANTFLY_MAX_TOTAL_CHARGE_USD |
Charges are also limited by the caller's balance. Events past a cap or past the balance are not counted, and results past the cap are not charged. Read these variables and stop early when the cap is reached, so you do not do work nobody pays for.
Earnings
You earn a share (by default 80%) of the result and event charges that the caller actually paid with money: its paid plan's included usage, credit bought with money, or overage charged to its card. Compute and proxy usage are not shared. Charges paid with free usage, trial usage or credit that was given away earn nothing.
An earning goes through these states:
| State | Meaning |
|---|---|
pending | The caller's billing period is not closed yet. |
held | Settled; waiting out a 30-day hold. |
available | Ready to use. |
reversed | Cancelled, for example after a refund or chargeback on the caller's payment. |
Open Earnings in the Console, or use the API:
| Endpoint | What it returns |
|---|---|
GET /api/v3/earnings | Balance (pending, available, withdrawable, requested, paid, lifetime, reversed), your share, the hold days, the minimum payout, totals per actor and any open payout request. |
GET /api/v3/earnings/history | One row per charge: gross_usd, paid_usd, amount_usd, settled_at, available_at, reversed_at. |
GET /api/v3/earnings/payouts | Payouts and moves to credit. |
Use your earnings
Move to credit. Turn withdrawable earnings into prepaid credit of your account, 1:1 in USD, at once. At least $1; leave amount_usd out to move everything.
curl -X POST "https://lantfly.com/api/v3/earnings/credit" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount_usd": 25}'
Cash payouts. Cash payouts are only offered when cash_payouts is on in GET /api/v3/earnings. Then POST /api/v3/earnings/payouts with amount_usd and method (bank, PayPal or Wise details, stored encrypted) requests one: at least $50, one open request at a time. When cash payouts are off, the endpoint answers 403 payouts_disabled.
In an organization, only owners and admins can move earnings or request payouts.
See also
- Publishing: make your actor public in the Store or share it.
- Billing: how callers pay.