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

# Credits

> RPC is prepaid in USD and drawn down per request at a rate by method; top up with a card, or let an agent top up over x402

An [endpoint](https://docs.alta.finance/network/endpoints.md) draws on the account's credit, a USD
balance each request draws down at the rate for its method. There is no
subscription and no invoice.

| Class | Per 1,000 requests | Methods |
| - | - | - |
| Base | \$0.05 | Every other method, such as `eth_blockNumber`, `eth_getBalance`, `eth_getBlockByNumber` and `eth_sendRawTransaction`, and every [indexer route](https://docs.alta.finance/network/endpoints.md#indexed-history) but `/logs` |
| Heavy | \$0.08 | `eth_call`, `eth_estimateGas`, `eth_getLogs`, `eth_getBlockReceipts`, and the indexer's `/logs` |
| Archive | \$0.20 | Reserved for archive history; no method uses it today |

A request is charged once it is answered, a JSON-RPC error from the chain
included.
A request the gateway refuses, or the chain fails to answer, costs nothing,
unless the chain received it and did not answer within 10 seconds: that is
charged, as a JSON-RPC error, since the chain may still be running it. An
indexer call follows the same rule: its answer is charged, a `4xx`
included, and an indexer failure, a `5xx` from the indexer, costs nothing.
The console's Billing page shows the balance, and tops it up from the saved
card, by hand or whenever the balance falls below a threshold you set.

## Top up as an agent

With no credit, an endpoint answers `402`, an [x402](https://docs.alta.finance/agents/x402-on-alta.md)
challenge, so an agent holding `*USDZ` tops it up without a card. A payment
buys a credit pack of \$1:

```bash theme={null}
alta-agent pay https://rpc-testnet.metalntwx.com/v1/<endpoint id> --network testnet \
  --method POST --body '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
```

`GET` on the endpoint's URL returns the challenge, and paying it tops the
endpoint up without making a call, so an agent can top up before its credit
runs out:

```bash theme={null}
alta-agent pay https://rpc-testnet.metalntwx.com/v1/<endpoint id> --network testnet
```

An agent with no endpoint of yours
[buys its own](https://docs.alta.finance/network/endpoints.md#an-endpoint-for-your-agent) at the bare
`/v1`.

> [card] [Endpoints](https://docs.alta.finance/network/endpoints.md)
>
> Create an endpoint or let an agent buy one, authenticate it, and its limits.

> [card] [Pay for an API](https://docs.alta.finance/agents/quickstart-pay.md)
>
> The agent that pays a `402`, RPC included.


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