run the account by API, for scripts and agents
An account API key runs your account from a script or AI agent: service keys, their policies, webhooks and usage.
| service key | account API key | |
|---|---|---|
| starts with | c_serv_ | c_acct_ |
| made in | the Keys panel, or POST /v1/keys | the Account page or user menu |
| opens | RPC, DAS, WebSocket, the carbon stream and quotes on services.carbium.sh | the account API on carbium.sh |
| refused by | the account API | every plane of services.carbium.sh |
| its value | readable again in the Keys panel | shown once |
| costs | credits per call, by method | nothing |
create one
| step | what |
|---|---|
| 1 open | ACCOUNT, Create API key on the Account API keys card or the user menu |
| 2 name | 1 to 48 characters |
| 3 access | Full control, or Read only for monitoring |
| 4 expires | 90 days unless you pick 30 days, 1 year or never; expired keys answer 401 |
| 5 addresses | optional: up to 16 IPv4 or IPv6 addresses or CIDRs; others get 403 |
| 6 copy | shown once; the list shows only its prefix |
| by API | POST /v1/account/api-keys with a dashboard session and {name, access: "full" or "read", expires_in_days: 30, 90, 365 or null, ip_allow}; an agent signed in with its wallet uses its session |
send it
# 1 who am I: the key's own record (name, access, scopes, expiry)curl -s https://carbium.sh/v1/api-key -H 'Authorization: Bearer <c_acct_ key>'# -> {"api_key_id":12,"name":"ci-agent","access":"full","scopes":["keys:read","keys:write",...],"expires_at":"2027-02-16T15:10:00Z",...}# 2 make a service key for one app, RPC and WebSocket only, then lock it to the app's address# (FREE holds one service key: there this answers 409 until the starter key is revoked)curl -s https://carbium.sh/v1/keys -H 'Authorization: Bearer <c_acct_ key>' \ -H 'Content-Type: application/json' -d '{"name":"indexer","scope":["rpc","ws"]}'# -> {"key_id":13,"prefix":"c_serv_AbCd","raw_key":"c_serv_...","name":"indexer"} the value is shown once: store itcurl -s -X PATCH https://carbium.sh/v1/keys/13/allowlist -H 'Authorization: Bearer <c_acct_ key>' \ -H 'Content-Type: application/json' -d '{"ip_allow":["203.0.113.7"]}'# 3 watch it: this month's calls and credits per key, then the last day by hourcurl -s https://carbium.sh/v1/keys/usage -H 'Authorization: Bearer <c_acct_ key>'curl -s 'https://carbium.sh/v1/usage/hourly?key_id=13' -H 'Authorization: Bearer <c_acct_ key>'# 4 retire it: every door refuses the key at oncecurl -s -X POST https://carbium.sh/v1/keys/13/revoke -H 'Authorization: Bearer <c_acct_ key>'
full control and read only
| full control | read only | |
|---|---|---|
| service keys | create, rename, rotate, revoke, delete | list |
| a key's policies | planes, per-method caps, IP allowlist, connection and in-flight limits | read |
| webhooks | create, change, pause, resume, test, rotate the secret, delete; the delivery log | list, read, the delivery log |
| usage and telemetry | read | read |
| the account | plan, status, credits, payments and modules: read; add a free module plan | read |
never by key
| a key cannot | why |
|---|---|
| buy or upgrade a plan or a paid module | |
| open the billing portal, cancel or resume a renewal | changes the card or restarts charges |
| remove a module | ends it at once, no refund |
| make, list or revoke account API keys | |
| link a wallet, log out, delete the account | changes who can sign in |
| read a service key's stored value | returned only on create or rotate |
| fetch an invoice document | the link opens for anyone holding it |
limits and refusals
| http | message | what to do |
|---|---|---|
| 401 | authentication required | key unknown, revoked or expired, made on the other dashboard name, or call closed to account API keys |
| 403 | this key is read only | use a Full control key |
| 403 | this key may not be used from this address | call from an allowed address |
| 403 | account is not active | account suspended, banned or closed: see the dashboard, or contact support |
| 409 | account API key limit reached (5) | on create: revoke a key first |
| 429 | 600 calls per key per 10-minute window: retry after Retry-After seconds | |
| 429 | too many wrong keys from this address | 20 wrong keys from one address in 10 minutes block that address for the window, right key included |
| 429 | too many key changes | over 120 service-key changes per account in 10 minutes (webhooks answer "too many webhook changes" the same way): wait, then send it again |
calls
| call | request | answer |
|---|---|---|
| service keys · keys:read | ||
| GET /v1/keys | none | your service keys, oldest first, revoked ones included: key_id, prefix, name, tier, scope, status, per_method_caps, max_connections, max_inflight, ip_allow, created_at, rotated_at, revoked_at (allow_domains and allow_ips are old lists the doors do not use). Never a key's value |
| service keys and their policies · keys:write | ||
| POST /v1/keys | {name, scope}, both optional: name up to 48 characters, scope a list of rpc, ws, grpc, quote and das (rpc, ws, grpc and das when left out; quote needs the Quote module) | {key_id, prefix, raw_key, name}: the key's value, shown here once and mailed to the account's email address when it has one. 409 at your plan's count of service keys, or for quote without the module |
| POST /v1/keys/{id}/rotate | none | {prefix, raw_key}: a new value for the same key, mailed like a new key's; the old one is refused at once |
| POST /v1/keys/{id}/revoke | none | {applied}: true the first time, false on a repeat; every door refuses the key at once, and the first revoke mails a notice |
| DELETE /v1/keys/{id} | none | {deleted}: the key is gone from the list, and a live one is refused at every door; a repeat is 404 |
| POST /v1/keys/{id}/name | {name}: up to 48 characters, "" clears it | {name} |
| PATCH /v1/keys/{id}/scope | {scope}: the whole new list of planes (rpc, ws, grpc, quote, das), at least one; a plane left out is removed | {key_id, scope}; the doors follow within a second |
| PATCH /v1/keys/{id}/caps | {per_method_caps}: the whole new list of {method_class, rps_ceiling (0 or left out: no ceiling), allow (true when left out)}; [] clears every cap. method_class is o1_cached, bounded_read, bounded_slot, write_send, compute, bounded_disk, range, scan, gpa or das (the 10 DAS methods together) | the stored list; the doors follow at once |
| PATCH /v1/keys/{id}/allowlist | {ip_allow}: the whole new list of IPv4 or IPv6 addresses and CIDRs, 16 at most; [] admits any address | {key_id, ip_allow}; a call from any other address is 403 at the door |
| PATCH /v1/keys/{id}/limits | {max_connections, max_inflight}: 0 to 10,000 each; 0 or left out is the plan's own number, and both are replaced together | {max_connections, max_inflight}; the WebSocket and stream doors follow within 5 minutes |
| webhooks · webhooks:read | ||
| GET /v1/webhooks | none | your webhooks, without their address lists |
| GET /v1/webhooks/{id} | none | the webhook with its addresses |
| GET /v1/webhooks/{id}/deliveries | none; ?limit=, ?before= | its delivery log, newest first |
| webhooks · webhooks:write (fields and answers: Webhooks) | ||
| POST /v1/webhooks | the create fields | {webhook, secret}: the signing secret, shown here once |
| PATCH /v1/webhooks/{id} | any create field, status | the webhook |
| DELETE /v1/webhooks/{id} | none | {"deleted": true} |
| POST /v1/webhooks/{id}/rotate | none | {secret, secret_hint, previous_valid_until} |
| POST /v1/webhooks/{id}/test | none | how one signed test event went |
| usage and telemetry · usage:read | ||
| GET /v1/usage | none; ?from= and ?to= as YYYY-MM-DD, given together, both days included (the last 7 days when left out; over 90 days is 400), ?key_id=, ?group=key | [{utc_day, method, method_class, call_count, credits_charged}], oldest day first; with group=key each row also carries its key_id (null for calls made before a key was rotated, or by a key since deleted). A key_id that is not yours is 404, and an answer of more than 50,000 rows is 400: narrow the range or name a key. Answers are kept 15 s |
| GET /v1/keys/usage | none | {period_start, period_end, account_credits, keys: [{key_id, credits, calls}]}: this calendar month (UTC) per service key, revoked ones included. Calls made before a key was rotated, or by a key since deleted, count in account_credits only; account_credits is null when the read failed |
| GET /v1/keys/load | none | [{key_id, rps_current, class_rps}]: calls a second over the last 20 s for each live key, in all and per method class |
| GET /v1/usage/hourly | none; ?from= and ?to= as RFC 3339 times, given together (the last 24 hours when left out; over 7 days is 400), ?key_id= | [{hour, key_id, method_class, calls, credits_charged, errors, resp_bytes}], kept 90 days; the newest hour can be two hours behind. Answers are kept 60 s |
| GET /v1/usage/latency | none; the same ?from=, ?to= and ?key_id= | [{hour, key_id, method_class, calls, p50_ms, p95_ms, p99_ms}]: milliseconds with up to 3 decimals, kept 90 days. Answers are kept 60 s |
| the account · account:read | ||
| GET /v1/account | none | {account_id, email, wallet, status, created_at, tier, term, payments}: the plan and its term, and the last 24 payments |
| GET /v1/balance | none | {granted, used, remaining}, in credits |
| GET /v1/invoices | none | [{period_start, period_end, granted, used, current}]: credits per month, the running month first |
| GET /v1/payments | none | your payments, newest first, 1,000 at most: id, amount_minor, currency, status, method, tier or module and plan, months, credits_granted, reference, paid_at |
| GET /v1/modules | none | every module with its plans and what the account holds of it |
| GET /v1/billing/crypto-intent/{id} | none | one on-chain payment of yours and its status: open, paid, held or expired |
| modules · modules:write | ||
| POST /v1/modules/{module} | {plan}, or {} for the cheapest: a plan with no price (a priced one is 400 "plan '<name>' must be purchased") | the module as the account now holds it; 409 "module not available yet", 429 past the change limit |
| the key itself · any account API key | ||
| GET /v1/api-key | none | the calling key's own record |
| what a key did · a session, or the key for its own id | ||
| GET /v1/account/api-keys/{id}/activity | none; ?limit= (50, at most 200), ?before= (a Unix-ms time) | [{ts, action, request_id, detail}]: what the key changed, newest first; another key's id is 404 |
| making and revoking account API keys · dashboard session only | ||
| POST /v1/account/api-keys | {name, access, expires_in_days, ip_allow}: name 1 to 48 characters and access "full" or "read", both required; expires_in_days 30, 90 or 365 (null or left out: no expiry); ip_allow up to 16 addresses or CIDRs (left out: any address) | the new key's record with its raw_key, this once; 409 at 5 live keys, 403 while the account is not active |
| GET /v1/account/api-keys | none | the live keys' records, newest first |
| DELETE /v1/account/api-keys/{id} | none | {api_key_id, revoked}; a repeat answers the same |
if a key leaks