The two credentials
There is a third secret in play that is not a Brickken credential: your private key. It never leaves your machine and is never sent to the API. It signs the x402 payment authorization and, in
client-signed mode, the blockchain transaction itself.
Which credential works where
Sending both does not help you. If
x-api-key is present it is validated and the whole x402 path is skipped, so no payment is taken — which also means no relayed execution. To pay with x402, omit the key entirely.
Using an API key
Send it as a header on every request:tech@brickken.com.
Your signer address must be whitelisted
An API key alone is not enough to write. The wallet you pass assignerAddress must be whitelisted by Brickken before any prepare-transactions call will accept it. Ask for the whitelist in the same request as the key — the form has a field for it.
Once that wallet performs a newTokenization, it becomes the tokenizer for the resulting token. Only the tokenizer can mint it, distribute its dividends, or manage its investor whitelist.
Sandbox and production keys are separate
Sandbox and production are separate deployments with separate databases. An API key issued for one does not work on the other.
Plans and credits
Every key belongs to a plan, and the plan grants a separate credit balance for each write method — not one shared pool.
Metered methods:
newTokenization, whitelist, mintToken, burnToken, transferTo, transferFrom, approve, dividendDistribution, newSto, newInvest, claimTokens, closeOffer, and patch-token-docs. When a balance runs out, the call fails with Out of credits for <method>.
Per-tier request throttles and quotas are configured on the usage plan attached to your key and are not published here. Ask
tech@brickken.com for the limits on your tier.Your key is scoped to the tokens it created
A key may only act on token symbols whose tokenizer email matches anewTokenization performed under that same key. Anything else returns Unauthorized token symbol. This affects get-stos, get-sto-by-id, get-investor-info, get-whitelist-status, get-allowance, and get-token-info.
The payment tokens HAI, BKN, USDC, USDt, and USDT are exempt and readable by any key.
Rate limits
Rate limiting applies toPOST /prepare-transactions only.
Exceeding a limit returns
429 with Retry-After: 60.
Not every endpoint enforces a key the same way
Authentication is applied per endpoint rather than globally, and the behaviour is not uniform. Three examples from sandbox:
Treat both
400 and 401 as “you need a key here”, and do not assume a read is public because a neighbouring one is.
Using x402 payment
x402 lets a client pay per call in USDC instead of holding an account. It is the only way to usebrickken-relayed execution, where Brickken signs and broadcasts the blockchain transaction and pays the native gas.
1
Prepare — free
Call a facade such as
POST /x402/agent/register, or POST /prepare-transactions with an eligible method. No credential is required. The response returns txId, transactions, and an x402Requirements preview of what the send will cost.2
Send — get the challenge
Call
POST /send-transactions. The API answers 402 Payment Required with a PAYMENT-REQUIRED header describing the exact chain, asset, transfer method, amount, recipient, and timeout.3
Sign the payment locally
Sign the payment authorization with the payer’s private key. The key stays on your machine.
4
Retry with the payment
Repeat the send with the payment header attached.
5
Read the settlement
Brickken verifies the payment, runs the operation, and returns the settlement in the
PAYMENT-RESPONSE header.Header names
The API accepts four spellings of the payment header —X-PAYMENT, X-Payment, x-payment, and payment-signature. Use whichever your HTTP client produces.
Browser clients can read the handshake: both PAYMENT-REQUIRED and PAYMENT-RESPONSE are listed in Access-Control-Expose-Headers.
The payment is reserved, then settled
Your payment is reserved when you pay, the operation runs, and only then is it settled. If the operation reverts, errors, or its authorization expires before confirmation, the reservation is released instead of charged. Polling a relayed operation withGET /get-transaction-status needs no credential. A status: "pending" means it was broadcast but not yet confirmed — do not pay or resubmit the same txId.
Payment asset
On Base Sepolia the x402 payment asset is Circle USDC:USDC, version 2, 300-second authorization window). A live sandbox quote looks like this:
Per surface
Using the Dapp API from the CLI and MCP
The Dapp API is not only reachable over plain HTTP. This is what each client can actually do with an API key today.MCP — full Dapp API access with an API key
The hosted MCP server is the client to use when you want an AI agent to drive the Dapp API. Configure it with an API key and nothing else, and every Dapp tool works: the 13 read tools (get_stos, get_token_info, get_investor_info, and the rest) and the 11 write tools that go through prepare-transactions (create_tokenization, create_sto, mint_tokens, whitelist_investor, burn_tokens, transfer_tokens, approve_tokens, distribute_dividend, invest_in_sto, claim_sto, close_sto).
x-api-key to every outbound request when one is configured, and it only falls back to the x402 handshake when the key is absent. So a session is either API-key mode or x402 mode, never both — set "apiKey": "" to force x402.
See MCP for the connection details and the full tool list.
CLI — RAMS reads only
Set the key for RAMS reads like this:Error reference
Security rules
- Never transmit a private key or seed phrase to any Brickken endpoint.
- Keep API keys out of source control, tickets, screenshots, and chat. Use environment variables or a secret store.
- Use sandbox keys for development. A production key can move real value.
- Verify
chainId,signerAddress, the token address, and every recipient before signing — on-chain actions and x402 payments are non-refundable. - Read the amount, asset, and chain from
PAYMENT-REQUIREDrather than hardcoding them. - Rotate a key by requesting a replacement from
tech@brickken.comand retiring the old one.
Request an API key
Start here if you do not have a key yet.
Quickstart
Make your first call on any surface.