Environments
SafeBank has two environments. They are fully isolated — data, keys, and on-chain state never cross between them. The key you use decides the environment.
| Sandbox (TEST) | Live (LIVE) | |
|---|---|---|
| Key prefix | sb_test_… | sb_live_… |
| Base URL | https://api.sandbox.safebank.ai | https://api.safebank.ai |
| Chain | Base Sepolia (84532, testnet) | Base (8453, mainnet) |
| Funds | Test USDC via the faucet | Real USDC |
| Faucet | Enabled (rate-limited) | Disabled |
Start in sandbox. Everything in the Quickstart runs there with no real money.
Key format
Keys look like sb_<env>_<pubId>_<secret>, e.g.
sb_test_Ab12Cd34Ef56_xxxxxxxxxxxx. Only the environment prefix and the
public id (pubId) are ever shown after creation — the secret is returned
once, at creation time. In API responses the environment appears as the
uppercase environment field (TEST / LIVE).
Base URL
The SDK infers the base URL from the key prefix, so you rarely set it by hand:
new SafeBank({ apiKey: 'sb_test_...' }) // → https://api.sandbox.safebank.ai
new SafeBank({ apiKey: 'sb_live_...' }) // → https://api.safebank.ai
Override it when you need to (e.g. a local API) via the baseUrl option, the
CLI --base-url flag, or the SAFEBANK_API_URL env var.
Authentication header
Every request carries the key in one of two accepted headers:
- X-SafeBank-Api-Key
- Authorization: Bearer
curl https://api.sandbox.safebank.ai/v1/wallets \
-H "X-SafeBank-Api-Key: sb_test_..."
curl https://api.sandbox.safebank.ai/v1/wallets \
-H "Authorization: Bearer sb_test_..."
The SDK sends X-SafeBank-Api-Key (to avoid colliding with the Privy
Authorization bearer used by the dashboard). Both are equivalent for
developer keys. See Authentication for scopes
and the underlying PrincipalGuard.
The test chain (Base Sepolia)
Sandbox wallets and payments settle on Base Sepolia:
| Field | Value |
|---|---|
| Chain name | Base Sepolia |
chainId | 84532 |
| Testnet | yes |
| Test USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
Live uses Base mainnet (chainId 8453, USDC
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913). These values are also served at
runtime from GET /v1/capabilities, which is the authoritative source per
environment — read it rather than hard-coding a chain map.
Faucet caps
The sandbox faucet (Funding) is TEST-only and rate-limited:
| Asset | Default drip | Max per drip |
|---|---|---|
| USDC | 250 | 1000 |
| ETH | 0.02 | 0.02 |
Drips are additionally rate-limited per wallet and per tenant. A POST to
/v1/wallets/{id}/fund against a live key is rejected — there is no live
faucet.
Sandbox signers, wallets, and funds are for testing only. Never reuse a sandbox demo signer or its private key with real funds on live.