Skip to content

API keys

An API key identifies the account on every request. It determines the rate limit, the chains and origins from which requests are accepted, and the account to which usage is billed. An account can have up to 25 active keys, for example one per application or environment, each with its own name and limits.

Sign in at dashboard.willow.tech and open Keys. Enter a name for the key and, optionally, limits. The key is displayed once, at creation. Willow stores only its SHA-256 hash, so a lost key cannot be displayed again and must be rotated instead.

A new key takes effect within seconds and requires no restart.

In the path, as the final segment of the URL:

https://api.willow.tech/v1/rpc/{chainId}/{YOUR_KEY}

This form is compatible with every library, since the entire endpoint is a single URL.

In a header, with the key omitted from the path:

POST https://api.willow.tech/v1/rpc/{chainId}
Authorization: Bearer {YOUR_KEY}

X-API-Key: {YOUR_KEY} is also accepted. A header keeps the key out of URLs, which are commonly written to logs, error reports, and browser history. Quick start shows the header form for each library.

Any holder of a key can spend the account balance. Keys should be kept on a server and out of client-side code, public repositories, and shared logs. If a browser application must call Willow directly, issue it a separate key restricted to the application’s origins (see below). The origin restriction prevents other websites from using a leaked key in a browser, but a script outside a browser can send any Origin header. A browser key should therefore be treated as public and given a low rate limit.

Each key can carry its own limits. A limit that is not set defaults to the plan limit or to Willow’s default.

LimitEffect
NameA label shown in the dashboard and in usage.
Requests per secondA rate limit lower than the plan’s. A key never exceeds the plan limit.
ChainsThe chains this key may call. Requests to other chains are refused with HTTP 403.
Allowed originsThe browser origins (https://app.example.com) this key accepts. Requests from other origins are refused with HTTP 403.
ProofsWhether this key may request log proofs.
Max blocks per proof jobThe maximum number of unproven blocks a single proof request from this key may queue.
Max open proof jobsThe maximum number of this key’s proof jobs that may be open concurrently on each chain.

The plan’s rate limit applies to the account: all of the account’s keys share its requests per second. A key with a lower limit of its own never exceeds that limit. Proof job limits are clamped to the plan’s limits in the same way.

Rotation creates a new key with the same name and limits and revokes the old key. The old key stops working within seconds, so the new key should be deployed first where an interruption is not acceptable. In the dashboard, use Rotate on the key.

Revocation disables a key within seconds. Subsequent requests with it are refused with HTTP 401:

{"error":{"code":-32000,"message":"invalid API key"},"id":null,"jsonrpc":"2.0"}

If a key is leaked and the dashboard is not accessible, the key can revoke itself:

Terminal window
curl -X DELETE https://api.willow.tech/account/rpc/keys/{KEY_ID} \
-H "Authorization: Bearer $LEAKED_KEY"

KEY_ID is the key’s identifier (key_…), shown in the dashboard or returned by GET https://api.willow.tech/account/rpc/keys with the same header. A key used this way can read its own account, revoke itself, and choose, cancel, or resume a plan paid from the balance, but cannot create keys, change limits, or change caps.

HTTPMessageMeaning
401invalid API keyThe key does not exist or was revoked.
401API key required: …No key was provided in the path or a header.
401this API key is suspendedThe account is suspended, for example after a failed payment and its grace period.
402payment required: …The balance is exhausted. See Limits and errors.
403this API key is not enabled for chain NThe key is restricted to other chains.
403this API key does not take requests from this originThe key is restricted to other origins.
429rate limit exceededThe key’s requests-per-second limit was exceeded.
429too many requests with an invalid API key from this addressToo many requests were sent with nonexistent keys. Wait, and correct the key.