LFG

API Routes

The Next.js API surface backing tipping claims, IPFS pinning, AI agents, and more.

LFG's frontend is a Next.js app, and a handful of server-side routes exist specifically because they hold secrets or need Node-only APIs that must never ship to the client bundle.

POST /api/tipping/sign-claim

Signs the claim attestation digest described in Oracle Signing. A wallet recipient is signed only when tokenInfo shows that the connected wallet launched that token and the handle is that wallet. An X recipient is signed only when this server's sign-in cookie proves X returned the same account name. A pasted access token is ignored. Runs on the Node.js runtime (not Edge).

FieldTypeNotes
platformstringThe royalty platform. wallet claims use the launch wallet. twitter claims use the signed-in X account.
handlestringFor a wallet claim, the launch wallet. For X, the account that just signed in.
claimerAddress0x addressWhere claimTips will pay out. For a wallet claim this has to be the launch wallet. For a social claim it is the wallet the signed-in account chooses.
token0x address (optional)When set, that token's stored royalty must be this platform and handle. It does not authorize a social claim.
chainIdnumberRobinhood Chain mainnet, 4663. The signature is bound to that chain's OmniTippingEscrow.
accessTokenstring (optional)Ignored. Social claims use the httpOnly sign-in cookie from /api/tipping/oauth/callback.

Note

When ORACLE_SIGNER_PRIVATE_KEY isn't configured on a given deployment, this route returns { simulated: true, signature: null } rather than throwing — the same 'explicit demo mode, not a silent failure' pattern used elsewhere in the app for unconfigured integrations.

AI agent routes

The agent routes need the signed-in wallet session (the lfg_wallet_session cookie). An address typed into a request body or query string is ignored, and a wallet can only reach agents it owns. Without a session they answer 401. A browser request from another site is refused with 403. In the paths below, {id} is the agent's id.

RouteAuthWhat it does
POST /api/console/createWallet sessionCreates an agent. Needs a name of at least two characters and a mission. A repeat of the same launch within 10 minutes returns the existing agent.
GET /api/agents/modelsNoneThe model catalog: every model the x402 gateways offer right now, its price, and whether it calls tools natively.
GET /api/agents/{id}/chatWallet session, owner onlyThe agent's chats, routine runs, heartbeats and sub-agents. With ?session=, one of them with its messages and cards.
POST /api/agents/{id}/chatWallet session, owner onlysend a message (a new chat when there is no sessionId), continue, stop or resume. Answers with a server-sent event stream: text as it is written, each tool call, cards and spend.
GET / POST /api/agents/{id}/approvalsWallet session, owner onlyLists open cards, and answers one: approve, deny, keep a draft to post yourself, answer a question, or hand back the hash of a transaction you signed.
GET /api/agents/{id}/events?after=Wallet session, owner onlyEverything the agent's sessions did after an event id, for the console to follow live.
POST /api/agents/{id}/live-viewWallet session, owner onlyOpens the agent's browser to watch (view) or drive (control). Answers with a one-minute ticket for your own agent host, or a short-lived viewer link from the browser provider. Neither is ever put in a page address.
POST /api/agents/{id}/browserWallet session, owner onlytake-over the browser, so the agent leaves it alone, then hand-back with a note for the agent.
GET / POST /api/agents/{id}/providersWallet session, owner onlyWhich sandbox and browser are connected. save tests the key with the provider before storing it; remove deletes it.
GET / POST /api/agents/{id}/memoryWallet session, owner onlySearch memories with ?q=, or add, edit (including pin) and delete one.
GET / POST /api/agents/{id}/schedulesWallet session, owner onlyLists routines, and can create, update, delete or run one now.
GET /api/agents/engine?swarmId=Wallet session, owner onlyThe agent's wallet, its latest mission and its recent events.
POST /api/agents/engineWallet session, owner onlyRuns a mission step for the creator: start or advance it, approve or change a plan, answer the agent, skip a step, store the E2B key.
/api/console/settingsWallet session, owner onlyReads and saves run mode, autonomy, limits, powers, trading settings and public listing.
GET /api/agents/cronAuthorization: Bearer CRON_SECRETCalled every minute by the scheduler. Fires due routines and heartbeats, wakes agents whose wait is over, and moves running chats, sub-agents and missions forward. Not for browsers.

Why these live server-side

  • Secret custody — ORACLE_SIGNER_PRIVATE_KEY must never reach client-bundled code; only a server route can hold it.
  • Independent verification — OAuth access tokens are checked against the platform's own identity API server-side, so a compromised or spoofed client can't just assert a handle it doesn't control.
  • Node-only dependencies — signing and RPC reads use APIs that either don't exist or don't behave identically on the Edge runtime.