Skip to main content

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 an x-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

  1. Derive the account. GET /account returns the user’s counterfactual smart-account address (the same on every chain).
  2. Authorize, once per chain. POST /authorize/prepare returns an EIP-712 message; your user signs it with their EOA wallet; POST /authorize/confirm stores the scoped session grant. The user signs once per chain, not per action.
  3. Fund the smart account. The user sends USDC to the smart-account address. Deposits draw from this balance.
  4. Act, gasless. POST /buy and POST /sell are relayer-signed — no per-action signature, no gas. Poll GET /actions/:id for status.
  5. Withdraw. POST /withdraw/prepare + confirm return 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.
Have the user sign 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

For cross-chain buys, after confirming_source you can also follow the bridge via the CCTP API using sourceTxHash.

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
Have the user sign the raw digest with an EIP-191 personal_sign (e.g. signMessage({ message: { raw: digest } })) and return the 65-byte signature unchanged.

Confirm

POST /withdraw/confirm
Track completion with GET /actions/:id.

End-to-End Flow

  1. GET /account → show the user their smart-account address and which chains are authorized.
  2. For each chain the user wants to use: POST /authorize/prepare → user signs EIP-712 → POST /authorize/confirm.
  3. User funds the smart-account address with USDC.
  4. POST /buy → poll GET /actions/:id until success (or confirming_source then settled, for cross-chain).
  5. POST /sell to redeem; POST /withdraw/prepare + confirm to 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.