Overview
The Smart Accounts API lets you give your users a gasless deposit and redemption experience without ever handling a private key or paying gas on their behalf. Each user gets a deterministic smart account (Kernel v3.1) derived from their EOA; once the user signs a one-time, per-chain authorization, you submit buy / sell / withdraw actions through 1tx and a relayer executes and sponsors the gas. This is the white-label / relay integration: your server authenticates with anx-api-key and names the ownerEoa it is acting for. The same routes also
back the first-party 1tx app (Privy bearer token); this page documents the
API-key path.
All Smart Accounts endpoints require an
x-api-key header. No bearer token is
needed. An action can only target an ownerEoa your key has authorized — the
session grant created at authorize time is bound to your API key.How it works
- Derive the account.
GET /accountreturns the user’s counterfactual smart-account address (the same on every chain). - Authorize, once per chain.
POST /authorize/preparereturns an EIP-712 message; your user signs it with their EOA wallet;POST /authorize/confirmstores the scoped session grant. The user signs once per chain, not per action. - Fund the smart account. The user sends USDC to the smart-account address. Deposits draw from this balance.
- Act, gasless.
POST /buyandPOST /sellare relayer-signed — no per-action signature, no gas. PollGET /actions/:idfor status. - Withdraw.
POST /withdraw/prepare+confirmreturn idle USDC to the user’s EOA. The recipient is always pinned to the owner EOA.
The owner signs only at authorize and withdraw time. Buy and sell never
require a user signature once a chain is authorized.
Base URL
Look Up Account
GET/account
Resolve a user’s smart-account address and authorization state.
Query Parameters
Response
Authorize a Chain
Establish a scoped session grant so the relayer can submit gasless actions for the user on a given chain. One signature per chain.Prepare
POST/authorize/prepare
Returns an EIP-712 message for the user to sign with their EOA wallet.
enableTypedData with eth_signTypedData_v4 on the EOA
wallet. The wallet must be connected to chainId when signing.
Confirm
POST/authorize/confirm
Submit the signature to activate the grant.
Revoke
DELETE/authorize/:ownerEoa
Off-chain revoke: the relayer stops replaying the session approval. Optionally
scope to one chain with ?chainId=.
Buy (Gasless Deposit)
POST/buy
Submit a relayer-signed, gas-sponsored deposit into an instrument. Requires an
active grant on the source chain and sufficient USDC in the smart account. For a
cross-chain buy the relayer bridges via CCTP automatically.
Request Body
Response
Sell (Gasless Redeem)
POST/sell
Submit a relayer-signed redemption of a position. Same-chain only; USDC proceeds
land in the smart account (use /withdraw to send them to the EOA).
Request Body
Get Action Status
GET/actions/:id
Track a submitted buy, sell, or withdraw by its actionId.
Response
Withdraw to Owner EOA
Return idle USDC from the smart account to the user’s own EOA. The recipient is always the owner EOA — it is never caller-supplied — so the user signs a userOp digest that commits to that calldata.Prepare
POST/withdraw/prepare
digest with an EIP-191 personal_sign
(e.g. signMessage({ message: { raw: digest } })) and return the 65-byte
signature unchanged.
Confirm
POST/withdraw/confirm
GET /actions/:id.
End-to-End Flow
GET /account→ show the user their smart-account address and which chains are authorized.- For each chain the user wants to use:
POST /authorize/prepare→ user signs EIP-712 →POST /authorize/confirm. - User funds the smart-account address with USDC.
POST /buy→ pollGET /actions/:iduntilsuccess(orconfirming_sourcethen settled, for cross-chain).POST /sellto redeem;POST /withdraw/prepare+confirmto move USDC back to the EOA.
Cross-chain sell is not supported. To move a position across chains, redeem
on its chain and withdraw, or buy fresh on the target chain.