Public API
Account
Account routes tell you whose account an API key belongs to: the plan with its limits and how much of them is used (GET /v1/account), and the requests and credits the account spent per day (GET /v1/usage). The numbers are the same as in the cabinet. All routes require signed headers (see Authentication). Base URL: see Overview. Success responses use ok: true plus the fields below. A field without a value is not written (it is never null): read a missing field as "no value".
GET /v1/account
The plan of the account with its limits and what is used of them (credits, RPS, address watch slots, payment slots, payments of the month).
レスポンスフィールド
| 名前 | 型 | 説明 |
|---|---|---|
| ok | boolean | true on success. |
| plan | object | Current plan. Absent when the account has no plan. (任意) |
| plan.slug | string | Plan slug. |
| plan.name | string | Plan display name. |
| plan.included_credits | number | Credits included in the plan period. |
| plan.credit_used | number | Credits used in the current plan period. |
| plan.rps_limit | number | Plan limit of requests per second (RPC endpoints). |
| plan.rps_used | number | Current requests per second of your endpoints (at most rps_limit). |
| plan.webhook_address_slots | number | Plan cap for concurrently watched addresses. |
| plan.address_slots_used | number | Watched addresses currently in use. |
| plan.payment_slots | number | Plan cap for payments that hold a slot at the same time. |
| plan.payment_slots_used | number | Payments currently holding a slot. |
| plan.payments_per_month | number | Plan cap for payments created per month. |
| plan.payments_per_month_used | number | Payments created in the current month. |
| plan.price_monthly_cents | number | Monthly price in cents. |
| plan.billing_period | string | Billing period of the subscription, e.g. monthly. Absent when none. (任意) |
| plan.subscription_status | string | Subscription status. Absent when none. (任意) |
| plan.started_at | string | Start of the plan period, ISO-8601 UTC without offset (e.g. 2026-08-01T00:00). Absent when none. (任意) |
| plan.expires_at | string | End of the plan period, ISO-8601 UTC without offset. Absent when none. (任意) |
- The account is the owner of the API key (the billing workspace). It takes no query parameters or body.
- plan is absent when the account has no plan. The response is then just { "ok": true }.
- There is no user_id and no plan id in the response: the plan is identified by slug.
- rps_used is the current requests-per-second load of your endpoints, never above rps_limit. rps_limit applies to RPC traffic on your endpoints; it is not the rate limit of this API (100 requests per minute per account).
- webhook_address_slots, payment_slots and payments_per_month are the caps of the plan; the matching *_used fields are the current usage. payments_per_month_used counts the payments of the current month.
- billing_period, subscription_status, started_at and expires_at are written only when the account has a subscription period. started_at and expires_at are ISO-8601 date-times in UTC written without an offset (for example 2026-08-01T00:00; seconds are dropped when zero).
リクエスト例
import { createHash, createHmac } from 'node:crypto'
const API_KEY = process.env.PUBLIC_API_KEY! // cabinet UUID
const SECRET = process.env.PUBLIC_API_SECRET! // sk_live_…
const BASE = 'https://api.rpcnode.dev'
// path: as the server receives it, with the query; body: the exact string that is sent
async function call(method: string, path: string, body = '') {
const timestamp = Math.floor(Date.now() / 1000)
const bodyHash = createHash('sha256').update(body).digest('hex')
const signature = createHmac('sha256', SECRET)
.update([timestamp, method, path, bodyHash].join('\n'))
.digest('hex')
const res = await fetch(BASE + path, {
method,
headers: {
'X-Api-Key': API_KEY,
'X-Timestamp': String(timestamp),
'X-Signature': signature,
...(body ? { 'Content-Type': 'application/json' } : {}),
},
body: body || undefined,
})
return res.json()
}
console.log(await call('GET', '/v1/account'))このスニペット内でリクエストに署名しています。署名ルールは認証をご覧ください。
レスポンス例
{
"ok": true,
"plan": {
"slug": "pro",
"name": "Pro",
"included_credits": 1000000,
"credit_used": 12000,
"rps_limit": 50,
"rps_used": 3,
"webhook_address_slots": 100,
"address_slots_used": 2,
"payment_slots": 20,
"payment_slots_used": 1,
"payments_per_month": 500,
"payments_per_month_used": 14,
"price_monthly_cents": 4900,
"billing_period": "monthly",
"subscription_status": "active",
"started_at": "2026-08-01T00:00",
"expires_at": "2026-09-01T00:00"
}
}GET /v1/usage
Requests and credits of the whole account by day over the last 7, 30 or 90 days, with the top methods and a webhook breakdown.
クエリパラメータ
| 名前 | 型 | 説明 |
|---|---|---|
| days | integer | Window length in days: 7, 30 or 90. Default 30. (任意) |
レスポンスフィールド
| 名前 | 型 | 説明 |
|---|---|---|
| ok | boolean | true on success. |
| usage.days | number | Selected window length. |
| usage.total_requests | number | Requests in the window. |
| usage.total_credits | number | Credits in the window. |
| usage.series[] | array | One point per day, oldest to newest. |
| usage.series[].date | string | Day, YYYY-MM-DD (UTC). |
| usage.series[].requests | number | Requests that day. |
| usage.series[].credits | number | Credits that day. |
| usage.methods[] | array | Top methods of the window (at most 20). |
| usage.methods[].method | string | RPC method or webhook:* kind. |
| usage.methods[].requests | number | Requests of this method. |
| usage.methods[].credits | number | Credits of this method. |
| usage.webhooks | object | Webhook delivery slice of the window. Included in total_credits. |
| usage.webhooks.requests | number | Deliveries counted, all kinds. |
| usage.webhooks.credits | number | Credits spent on deliveries, all kinds. |
| usage.webhooks.address_watch_requests | number | Address Watch deliveries (webhook:address-watch). |
| usage.webhooks.address_watch_credits | number | Credits for Address Watch deliveries. |
| usage.webhooks.payment_requests | number | Payment deliveries (webhook:payment). |
| usage.webhooks.payment_credits | number | Credits for payment deliveries. |
| usage.webhooks.block_requests | number | Block deliveries (webhook:block). |
| usage.webhooks.block_credits | number | Credits for block deliveries. |
| usage.webhooks.tx_watch_requests | number | Tx Watch deliveries (webhook:tx-watch). |
| usage.webhooks.tx_watch_credits | number | Credits for Tx Watch deliveries. |
- Any other value of days is rejected with 400 common.validation_failed and errors: [{ "field": "days", "error": "days must be 7, 30 or 90." }]; it is not replaced by the default.
- The query string is part of the signed path (see Authentication): sign /v1/usage?days=30 exactly as you send it.
- The usage covers all endpoints of the account together, including credits spent on webhook deliveries.
- series has exactly one point per day, oldest first, ending today (UTC dates). Days without usage are zeros. total_requests and total_credits are the sums of series.
- methods lists up to 20 methods, the most credits first (then requests, then name). Webhook deliveries appear there as webhook:address-watch, webhook:payment, webhook:block and webhook:tx-watch.
- webhooks covers the whole window, not only the 20 methods listed in methods. Its requests and credits are the sum of the four kinds and are already part of total_credits.
- Plan-period counters (credit_used, included_credits, slots) are not in this response: use GET /v1/account for them.
リクエスト例
import { createHash, createHmac } from 'node:crypto'
const API_KEY = process.env.PUBLIC_API_KEY! // cabinet UUID
const SECRET = process.env.PUBLIC_API_SECRET! // sk_live_…
const BASE = 'https://api.rpcnode.dev'
// path: as the server receives it, with the query; body: the exact string that is sent
async function call(method: string, path: string, body = '') {
const timestamp = Math.floor(Date.now() / 1000)
const bodyHash = createHash('sha256').update(body).digest('hex')
const signature = createHmac('sha256', SECRET)
.update([timestamp, method, path, bodyHash].join('\n'))
.digest('hex')
const res = await fetch(BASE + path, {
method,
headers: {
'X-Api-Key': API_KEY,
'X-Timestamp': String(timestamp),
'X-Signature': signature,
...(body ? { 'Content-Type': 'application/json' } : {}),
},
body: body || undefined,
})
return res.json()
}
console.log(await call('GET', '/v1/usage'))このスニペット内でリクエストに署名しています。署名ルールは認証をご覧ください。
レスポンス例
{
"ok": true,
"usage": {
"days": 7,
"total_requests": 5400,
"total_credits": 12000,
"series": [
{ "date": "2026-08-01", "requests": 0, "credits": 0 },
{ "date": "2026-08-02", "requests": 700, "credits": 1500 },
{ "date": "2026-08-03", "requests": 900, "credits": 2100 },
{ "date": "2026-08-04", "requests": 800, "credits": 1700 },
{ "date": "2026-08-05", "requests": 1000, "credits": 2300 },
{ "date": "2026-08-06", "requests": 1100, "credits": 2400 },
{ "date": "2026-08-07", "requests": 900, "credits": 2000 }
],
"methods": [
{ "method": "webhook:payment", "requests": 4, "credits": 2000 },
{ "method": "eth_getBlockByNumber", "requests": 600, "credits": 4800 },
{ "method": "webhook:address-watch", "requests": 30, "credits": 900 },
{ "method": "eth_call", "requests": 4766, "credits": 4300 }
],
"webhooks": {
"requests": 34,
"credits": 2900,
"address_watch_requests": 30,
"address_watch_credits": 900,
"block_requests": 0,
"block_credits": 0,
"payment_requests": 4,
"payment_credits": 2000,
"tx_watch_requests": 0,
"tx_watch_credits": 0
}
}
}ヒント
- Sign every request with X-Api-Key, X-Timestamp and X-Signature (see Authentication). For GET /v1/usage?days=30 the signed path includes the query string.
- Use GET /v1/account to check slot headroom before adding addresses or creating payments; manage the watches themselves under Address Watch.
- The API itself is limited to 100 requests per minute per account on every plan, separately from the RPS limit of your endpoints. On 429 wait for the Retry-After header.
- Errors use { ok: false, error_code, error } and, for a rejected request, an errors list naming each field. See Authentication for the auth errors.