Skip to main content
Brickken accepts two credentials, and they are alternatives rather than layers. Which one you use decides which parts of the platform you can reach and who pays for the transaction.

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.
Never send a private key or seed phrase to the Brickken API, and never paste one into a ticket, a shared terminal, or a chat. No Brickken endpoint or employee will ever ask for one.

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.
brickken-relayed sends reject API keys outright, with brickken-relayed execution requires x402 payment; API keys are not accepted. Because the /x402/... facades force relayed mode, the facade → send round trip cannot be paid for with a key at all. If you want to use a key on an agentic method, prepare it in client-signed mode.

Using an API key

Send it as a header on every request:
No key yet? Request one — the form opens a prefilled email to tech@brickken.com.

Your signer address must be whitelisted

An API key alone is not enough to write. The wallet you pass as signerAddress 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.
There is no environment flag on a key. Separation comes from the deployment: a key issued against sandbox is unknown to production and vice versa. Request both if you need both.

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 a newTokenization 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 to POST /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 use brickken-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 with GET /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:
It has 6 decimals and uses the EIP-3009 transfer method (EIP-712 name USDC, version 2, 300-second authorization window). A live sandbox quote looks like this:
Read the chain, asset, transfer method, amount, and recipient from the PAYMENT-REQUIRED header of the live 402 response. Never hardcode the values above — they are an illustration, not a contract.

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).
The MCP server attaches 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

The CLI cannot drive the legacy Dapp API. It sends x-api-key only on RAMS reads and typed-data fetches (brickken rams inspect, status, can-execute, compliance-status, executor-action, sign). Every other command goes out without a key, and the CLI has no commands for the Dapp methods at all — there is no newTokenization, newSto, mintToken, or get-stos mapper. brickken tx prepare --method newTokenization forwards the method name but the backend rejects it with API key is required for this method.For Dapp API work from an agent or a script, use MCP or call the REST API directly.
Set the key for RAMS reads like this:

Error reference

Security rules

  1. Never transmit a private key or seed phrase to any Brickken endpoint.
  2. Keep API keys out of source control, tickets, screenshots, and chat. Use environment variables or a secret store.
  3. Use sandbox keys for development. A production key can move real value.
  4. Verify chainId, signerAddress, the token address, and every recipient before signing — on-chain actions and x402 payments are non-refundable.
  5. Read the amount, asset, and chain from PAYMENT-REQUIRED rather than hardcoding them.
  6. Rotate a key by requesting a replacement from tech@brickken.com and 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.