Skip to main content
Every request to the testnet goes through an endpoint of your own, which serves every method the gateway supports over HTTP. It is what metal-agent status, Foundry and a backend use. Create one in the console, or let an agent buy its own.

1. Create an endpoint

Sign in at the Metal console; $50 of credit lands at your first sign-in, with no card. To buy more later, add the Airwallex sandbox test card 4035 5010 0000 0008, any future expiry and CVC, on the Billing page. Then create an endpoint with a name and a network:
The id is the credential: anyone holding the URL sends requests on your credit. Keep it out of client-side code and rotate it from the endpoint’s page when it leaks. For a client that can send a header, add an Endpoint Secret, turn on “Require a credential”, and send the secret as HTTP Basic authentication, with the endpoint id as the username and the secret as the password, in the Authorization header.

2. Send a request

The gateway serves a set of the eth_*, net_* and web3_* methods and some of Metal’s own; it holds no keys, so sign locally and submit with eth_sendRawTransaction.

An endpoint for your agent

Your agent can use the RPC without your endpoint. The bare https://rpc-testnet.metalntwx.com/v1 responds to a POST with 402, an x402 challenge for $1 of credit, and an agent holding *USDZ pays it from its own wallet:
The response carries the call’s output, and its rpc-aas-endpoint header names the endpoint the payment opened, owned by the agent’s address. The agent sends every later call there, with no payment, as any client does. Your account and your endpoint are never involved, so the agent cannot draw on your credit. When that endpoint’s credit runs out it responds 402 again, and the same command, at its URL or at the bare /v1, tops it up by another $1; see Credits. GET on either URL returns the price. An address is handed one endpoint, however often it pays, and a payment already settled buys nothing a second time. These endpoints have no console login.

Limits

Past the in-flight or throughput limit, or while the chain is too busy to take the call, the gateway answers 429 with Retry-After; a body or batch over its limit gets 413. Once the day’s credit is used it answers 402 until midnight UTC; with no credit left, 402, which an agent can pay. The console’s Usage page shows each endpoint’s requests by method, with the charge for each.

Credits

What a request costs, and topping up, by card or as an agent.

JSON-RPC

Every method the gateway serves, with examples.