Would it be possible to have an ENV
# project-rentals
i
Would it be possible to have an ENV variable that tells us if the actor is in rental mode or PPE?
APIFY_PRICING_MODEL
where values can be
ppe
ppu
, or
rental
? My main reason for this is to be able to handle transition periods (aka 14migration days) correctly. But it could be useful for other use cases.
This can be retrieved through the GetActor endpoint and checking pricingInfos -> pricingModel https://docs.apify.com/api/v2/act-get But having it in an ENV var will make things much easier and avoid any HTTP requests
l
Use Actor.getChargingManager which has detailed pricing info and loads by default
i
That's an SDK thing? I'm directly using the API and ENV vars. I develop my actors in Go.
In the end, that will be making a request to the endpoint and populating some structs. What I propose is a non-request approach to knowing the current pricing model of an actor. In the same way, we can know if the actor is a paying user or not.
a
@igolaizola have you checked
APIFY_ACTOR_PRICING_INFO
, should have all info you need
i
I didn't see those in the documentation of env vars
I'm going to test it on a migrating actor
thanks!
Copy code
2026-04-30T14:58:37.728Z 2026/04/30 14:58:37 INFO actor pricing info info="{\"pricingModel\":\"FLAT_PRICE_PER_MONTH\",\"pricePerUnitUsd\":25,\"trialMinutes\":1440,\"createdAt\":\"2025-03-08T13:59:12.726Z\",\"startedAt\":\"2025-03-08T13:59:12.726Z\",\"apifyMarginPercentage\":0.2,\"notifiedAboutChangeAt\":\"2025-03-08T14:39:20.449Z\"}"
Awesome!
a
I'm afraid it's an internal env var that they've intentially left it out to prevent potential breaking changes if they decide to change, but I'm not sure..
i
Ok, let's see if @Lukas Krivka can confirm us whether it is safe to use it or not.
a
YOLO haha I'm using it accross all of my actors 😆 if it changes I'd have to adjust all of them
l
I don't think we will mess it up, will bump the team to add to docs (the SDK does fallback to the run endpoint, but there is no reason we should break it)
There is also APIFY_CHARGED_ACTOR_EVENT_COUNTS which also reflects the run endpoint
I use this once a month, hopefully we will get better at documenting it https://apify.com/lukaskrivka/print-env-vars
a
Thanks Lukas, same thing for me - I just run a dummy actor on Apify from time to time to log whatever's available as env vars and that's how I stumbled upon that one
i
What is the meaning of this one? Values are 1 or 0 I guess.
Perfect! I'll start using it.
l
It is 0 for your own events but
apify-actor-start
can be more right at start. And after resurrect, those numbers can be high
2 Views