Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: maxTotalChargeUsd
in: query
required: false
description: |
Specifies the maximum cost of the run. This parameter is
useful for pay-per-event Actors, as it allows you to limit the amount
charged to your subscription. You can access the maximum cost in your Actor
Specifies the maximum total cost of the run.
Use it to cap the total amount charged for all pricing models.
You can access the maximum cost in your Actor
by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
style: form
explode: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ get:
format: double
example: 256
- $ref: ../../components/parameters/actor-run-options/maxItems.yaml
# XXX: do we support maxTotalChargeUsd for task runs?
- $ref: ../../components/parameters/actor-run-options/maxTotalChargeUsd.yaml
- name: build
in: query
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ get:
format: double
example: 256
- $ref: ../../components/parameters/actor-run-options/maxItems.yaml
# XXX: do we support maxTotalChargeUsd for task runs?
- $ref: ../../components/parameters/actor-run-options/maxTotalChargeUsd.yaml
- name: build
in: query
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Here's a table of key system environment variables:
| `ACTOR_DEFAULT_REQUEST_QUEUE_ID` | Unique identifier for the default request queue associated with the current Actor run. |
| `ACTOR_INPUT_KEY` | Key of the record in the default key-value store that holds the [Actor input](/platform/actors/running/input-and-output#input). |
| `ACTOR_MAX_PAID_DATASET_ITEMS` | For paid-per-result Actors, the user-set limit on returned results. Do not exceed this limit. |
| `ACTOR_MAX_TOTAL_CHARGE_USD` | For pay-per-event Actors, the user-set limit on run cost. Do not exceed this limit. |
| `ACTOR_MAX_TOTAL_CHARGE_USD` | For all pricing models, the user-set limit on total run cost. Do not exceed this limit. |
| `ACTOR_RESTART_ON_ERROR` | If **1**, the Actor run will be restarted if it fails. |
| `APIFY_HEADLESS` | If **1**, web browsers inside the Actor should run in headless mode (no windowing system available). |
| `APIFY_IS_AT_HOME` | Contains **1** if the Actor is running on Apify servers. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The `eventChargeLimitReached` property checks if the user's limit allows for ano

:::info ACTOR_MAX_TOTAL_CHARGE_USD environment variable

For pay-per-event Actors, users set a spending limit through the Apify Console. This limit is available in your Actor code as the `ACTOR_MAX_TOTAL_CHARGE_USD` [environment variable](/platform/actors/development/programming-interface/environment-variables), which contains the user's maximum cost.
All pricing models support a spending limit set through the Apify Console or API. This limit is available in your Actor code as the `ACTOR_MAX_TOTAL_CHARGE_USD` [environment variable](/platform/actors/development/programming-interface/environment-variables), which contains the user's maximum total cost for the run.
The Apify SDK's `ChargeResult` respects the user set limit already.

:::
Expand Down
2 changes: 1 addition & 1 deletion sources/platform/actors/running/store.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ You can also see the cost of each run on the run detail itself.

![Pay per event Actor - run detail](./images/store/pay_per_event_price_on_run_detail.png)

#### Can I put a cap on a cost of a single Actor run?
#### Can I put a cap on the cost of a single Actor run?

Yes, when starting an Actor run, you can define the maximum limit on the cost of that run. When the Actor reaches the defined limit, it should terminate gracefully. Even if it didn't, for any reason, and kept producing results, we make always sure you are never charged more that your defined limit.

Expand Down
Loading