Skip to content

Commit

Permalink
Add credit pricing updates. (#1530)
Browse files Browse the repository at this point in the history
* Add credit pricing updates.

Signed-off-by: bgravenorst <[email protected]>

* Add wha's new.

Signed-off-by: bgravenorst <[email protected]>

* Fix typo.

Signed-off-by: bgravenorst <[email protected]>

* Fix broken links.

Signed-off-by: bgravenorst <[email protected]>

---------

Signed-off-by: bgravenorst <[email protected]>
  • Loading branch information
bgravenorst authored Sep 12, 2024
1 parent 1273226 commit 9439586
Show file tree
Hide file tree
Showing 22 changed files with 431 additions and 79 deletions.
31 changes: 31 additions & 0 deletions developer-tools/dashboard/how-to/credit-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
description: View your Infura credit usage stats.
---

# View credit usage

:::info

The [credit pricing model](../api/learn/pricing/) replaces request-based billing for free-tier (Core)
customers. Customers on Developer and Team plans will be transitioned to the credit model on
September 30, 2024.

**Existing customers on Growth and Custom plans will remain on request-based billing**.
:::

You can view your daily credit usage in relation to your daily credit quota limit. Daily credit usage
counts are reset everyday at 00:00 UTC for all customers.

Select **View Usage** from the **Daily Credit Usage** section on the Infura dashboard, or select
the **Usage** tab from the **Settings** > **Billing** dropdown.

View your usage for the previous 24 hours, 7 days, or 30 days by methods used, networks, or API key.

<div class="left-align-container">
<div class="img-large">
<img
src={require('../../images/credit-usage.png').default}
/>
</div>
</div>

27 changes: 19 additions & 8 deletions developer-tools/dashboard/how-to/secure-an-api/set-rate-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ description: Set rate limits to control access to the API key.

# Rate limits

Set rate limits to control access to the API key and to limit costs in case of a leaked API key. Set rate limiting in the API key's
**Settings** tab **REQUESTS** section.
:::info

The credit pricing model replaces the request-based billing for free-tier (Core) customers.
**Existing paid customers will not be immediately affected and will continue to limit the number of requests per second**.

:::

Set credit rate limits to control access to the API key and to limit costs in case of a leaked API key.
Set rate limiting in the API key's **Settings** tab **Key Credit Limits** section.

<div class="left-align-container">
<div class="img-medium">
<div class="img-large">
<img
src={require("../../../images/rate-limiting-settings.png").default}
src={require('../../../images/rate-limiting-settings.png').default}
/>
</div>
</div>

- **PER SECOND REQUESTS RATE-LIMITING** restricts requests per second for the API key. Set the maximum number of requests per second in decimals, e.g. 1.2. Whenever the rate of requests exceeds this value, requests are rejected. When the rate of requests drops below the limit again, requests are accepted again.
- **PER SECOND CREDIT RATE-LIMITING** restricts credits per second (throughput) for the API key. Set
the maximum number of credits per second in whole numbers. When credits per second rate exceeds
this value, requests are rejected. When the credit rate drops below the limit, requests
are accepted again.

Decimal value 0.0 means default limits are applied.
The value `0` means default limits are applied.

- **PER DAY TOTAL REQUESTS** restricts total daily requests for the API key. Set a limit on number of requests per day in integers, e.g. 20000. Integer value 0 means default limits are applied.
- **PER DAY TOTAL CREDITS** restricts total daily credit usage for the API key. Set a limit on number of
credits per day in integers, e.g. 20000. The value `0` means default limits are applied.

When the number of requests reach this limit, all requests will be rejected until the next day (00:00 UTC).
When the number of used credits reach this limit, all requests will be rejected until the next day (00:00 UTC).
Binary file added developer-tools/images/credit-usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified developer-tools/images/rate-limiting-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).

## September 2024

- Documented [Infura's credit pricing model](/services/get-started/pricing). ([#1530](https://github.com/MetaMask/metamask-docs/pull/1530))
- Added tutorial for [authenticating with JWT](/services/tutorials/ethereum/authenticate-with-jwt.md).
([#1528](https://github.com/MetaMask/metamask-docs/pull/1528))
- Documented [opBNB](/services/reference/opbnb) support.
Expand Down
37 changes: 4 additions & 33 deletions services/concepts/archive-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ sidebar_position: 2

Archive data is data on the blockchain that is older than 128 blocks.

Infura provides free access to archive data on Ethereum and most networks.
:::caution important
For users on [Infura's credit pricing plan](../get-started/pricing/index.md), requests for
archive data currently cost the same as non-archive data, but this might change in the future.
:::

## Infura-supported archive data

Expand Down Expand Up @@ -49,35 +52,3 @@ The following methods include a parameter for specifying a block number for the
- `eth_getTransactionCount`
- `eth_getStorageAt`
- `eth_call`

## Rate limits

Infura applies [rate limits](../how-to/avoid-rate-limiting.md) to ensure network efficiency.

Requests for Ethereum archive data are more expensive and are therefore subject to different rate limits.

### Free plan

You can make up to 25,000 archive requests and 100,000 total requests per day.
After reaching 25,000 archive requests, you can still make 75,000 additional standard requests.

:::info

If you need more archive requests, upgrade to the Developer plan.

:::

### Developer plan

You can make up to 100,000 archive requests and 200,000 total requests per day.
After reaching 100,000 archive requests, you can still make 100,000 additional standard requests.

:::info

If you need more archive requests, upgrade to the growth plan.

:::

### Custom, team, and growth plans

There is no change. The process remains the same as a standard request.
24 changes: 19 additions & 5 deletions services/concepts/websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,26 @@ Create stateful subscriptions over WebSockets to listen to specific events. Exam

## Pricing

WebSocket activity is counted toward your daily request limits. View the [Infura pricing](https://www.infura.io/pricing)
for more information about your request limits.
For users on [Infura's credit pricing plan](../get-started/pricing/index.md), subscribing and unsubscribing to
events using the `eth_subscribe` and `eth_unsubscribe` methods consume credits from your daily quota.
Credits are consumed for these actions to prevent spamming, even if no valuable data is sent.

:::info Pricing model may change
:::tip

Infura might change the pricing model and implement some limitations on subscriptions over WebSockets in the future. Before
implementing any changes, customers will receive advanced notification, so they can consider the best option for their needs.
Refer to the [credit cost table](../get-started/pricing/credit-cost.md) for more information about the
credit costs associated with the relevant method calls.

For users on the existing request-based billing system, WebSocket activity is counted toward your daily request
limits. View the [Infura pricing website](https://www.infura.io/pricing) for more information about your
request limits.

:::

Additional credit-based charges are applied for the events returned:

- `newHeads`: Each new block event consumes 50 credits from your daily quota. This event is triggered
once per announced block.
- `logs`: Depending on the filters applied, this event can consume 300 credits per block from your
daily quota. At most, one event per announced block is charged, and potentially none if filter constraints are not met.
- `newPendingTransaction`: An event is generated every 700-800ms, aggregating the total amount of
pending transactions collected during that period. Each event consumes 200 credits from your daily quota.
38 changes: 35 additions & 3 deletions services/get-started/infura.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,51 @@ Use an allowlist to restrict API key access. See to the [allowlist documentation

## 5. View your project stats

The Infura dashboard displays an overview of your daily request health and daily credit usage.
Select **View Stats** or **stats** to monitor your project request stats.

<div class="left-align-container">
<div class="img-large">
<img
src={require('../images/analytics.png').default}
/>
</div>
</div>

From the Stats page of the Infura dashboard, you can view real-time statistics about your API usage.
Optimize your app and better understand your users by
[reviewing your API request stats](../../../developer-tools/dashboard/how-to/dashboard-stats) regularly.
[reviewing your API request stats](/developer-tools/dashboard/how-to/dashboard-stats) regularly.

<div class="left-align-container">
<div class="img-large">
<img
src={require('../images/dashboard_stats.png').default}
/>
</div>
</div>

## 6. View your credit usage

The Infura dashboard provides an overview of your daily credit usage. Select **View Usage**
for a [wider view of your credit usage](/developer-tools/dashboard/how-to/credit-usage).

:::info

The credit pricing model replaces request-based billing for free-tier (Core) customers. Customers on
Developer and Team plans will be transitioned to the credit model on September 30, 2024.
**Existing customers on Growth and Custom plans will remain on request-based billing**.

:::

<div class="left-align-container">
<div class="img-large">
<img
src={require("../images/dashboard_stats.png").default}
src={require('../images/view-usage.png').default}
/>
</div>
</div>

## 6. Manage your account
## 7. Manage your account

Find additional settings in **Settings** to manage your account. You can do the following:

Expand Down
Loading

0 comments on commit 9439586

Please sign in to comment.