Skip to main content

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:

pricing
{
"events": {
"result_item": { "title": "Result item", "price_usd": 0.0005 },
"page_opened": { "title": "Page opened", "price_usd": 0.002 }
}
}
KeyMeaning
events.<name>One priced event. result_item is special: it is counted from the run's results.
titleLabel shown to callers.
price_usdPrice of one event, in USD.
tiersOptional: 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 results or Pay per event.

Set the pricing in the Console on your actor, or with the API:

Set the pricing
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:

Node.js
await Actor.charge('page_opened'); // one event
await Actor.charge('page_opened', 10); // ten events
Python
await Actor.charge("page_opened")
await Actor.charge("page_opened", 10)

Or with the API and the run token:

Report an event
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}'
AnswerMeaning
201 with charged_event_countsThe events were counted.
409 run_finishedThe run already ended.
503 charge_busy with Retry-After: 1Nothing was counted. Send the same request (same Idempotency-Key) again. The SDKs do this.
422An 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 optionMeaningVisible to your actor as
max_itemsStop paying past this many dataset items.LANTFLY_MAX_PAID_DATASET_ITEMS
max_total_charge_usdCap 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:

StateMeaning
pendingThe caller's billing period is not closed yet.
heldSettled; waiting out a 30-day hold.
availableReady to use.
reversedCancelled, for example after a refund or chargeback on the caller's payment.

Open Earnings in the Console, or use the API:

EndpointWhat it returns
GET /api/v3/earningsBalance (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/historyOne row per charge: gross_usd, paid_usd, amount_usd, settled_at, available_at, reversed_at.
GET /api/v3/earnings/payoutsPayouts 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.

Move earnings to credit
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.