> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lasso.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop RPC outages and rate limits from reaching your app

> Put one endpoint in front of several RPC providers so a provider outage, 429 or exhausted quota moves to the next provider instead of becoming your app's error

# Stop RPC outages and rate limits from reaching your app

A single provider URL fails whenever that provider does. This guide puts one
Lasso endpoint in front of several providers, so reads move to the next provider
when one is down or rate limited. Your app keeps standard JSON-RPC and only the
URL changes. Use it when provider errors are reaching your users.

## 1. Create an endpoint

One request returns a working key, with no signup:

```bash theme={null}
curl -sS https://lasso.sh/api/v1/keys \
  -H 'content-type: application/json' -d '{"name":"prod"}'
```

Keep the response's credentials out of source control. Replace `{chain}` in its
`rpc_url_template` with a chain such as `ethereum`, `base` or `arbitrum`, and
give that URL to viem, ethers, Foundry, Hardhat or your indexer in place of your
provider URL. See [install Lasso in your app](https://docs.lasso.sh/cloud/install.md).

## 2. Choose your providers

| Your situation | Use | Next |
| - | - | - |
| You want routing without managing provider accounts | The `premium` managed pool, which a URL with no profile uses | [Serving access and pricing](https://docs.lasso.sh/cloud/serving-access-and-pricing.md) |
| You already pay for providers or run nodes | A Custom profile over those accounts | [Trial your own providers](https://docs.lasso.sh/cloud/bring-your-own-rpc.md) |
| You need to run the proxy yourself | Lasso RPC Core, the open-source engine | [Route across your own providers](https://docs.lasso.sh/guides/route-across-providers.md) |

## 3. Pick a strategy per call site

| Workload | Strategy |
| - | - |
| Spreading load and quota across providers, such as backends and indexers | `load-balanced` |
| User-facing reads | `balanced-fast` |
| Latency-sensitive paths | `fastest` |
| A preferred primary with fallbacks | `priority` |

The strategy goes in the URL, so one app can use several. See
[routing](https://docs.lasso.sh/cloud/routing.md).

## What happens when a provider fails

| Provider behavior | What Lasso does |
| - | - |
| Answers 429 | Moves it behind healthy providers until its cooldown ends |
| Times out or fails internally on a read | Retries the read on the next provider, within the request deadline |
| Keeps failing | Opens its [circuit](https://docs.lasso.sh/concepts/circuit-breakers.md); after a cooldown, a trial request decides whether it returns |
| Refuses a method, history depth or `eth_getLogs` span | Tries the next provider and [learns the limit](https://docs.lasso.sh/concepts/provider-learning.md), moving it behind alternatives for matching requests |
| Exhausts its quota | Skips that credential until revalidation succeeds, keeping one last route if every candidate is excluded |

Lasso also moves live WebSocket `newHeads` and `logs` subscriptions to another
provider and backfills missed blocks.

## Check that it worked

Set `LASSO_RPC_URL` to `rpc_url_template` without `/{chain}`, then ask for
routing evidence on any call:

```bash theme={null}
curl -sS "$LASSO_RPC_URL/base?include_meta=body" \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
```

`lasso_meta` names the provider that served the request, the candidates and any
retries. See [routing evidence](https://docs.lasso.sh/cloud/observability.md).

## Limits

* Failover covers reads that are safe to repeat. `eth_sendRawTransaction` sends
  the same signed bytes to up to three providers in turn, and a sender fault
  such as nonce too low stops at the first. See
  [transactions](https://docs.lasso.sh/cloud/rpc-behavior.md#transactions).
* Lasso tries a bounded number of providers. If every one fails, you get one
  JSON-RPC error inside an HTTP 200, so check the body's `error`, not only the
  status. See [error handling](https://docs.lasso.sh/cloud/reference/error-handling.md).
* A profile never borrows providers from another pool. Failover is only as
  independent as the providers in that profile, so pick ones that don't share a
  failure domain.
* A pinned provider URL has no failover.

## Next

* [RPC method behavior](https://docs.lasso.sh/cloud/rpc-behavior.md): what each kind of request does.
* [Set up production RPC with an agent](https://docs.lasso.sh/cloud/guides/production-rpc-with-an-agent.md):
  hand this setup to an agent.
* [Balance and payment fallback](https://docs.lasso.sh/cloud/balance-and-fallback.md): what happens when
  a balance runs out.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.