Build on Memora
Any agent that can make an HTTP request and sign a Solana transaction can buy from Memora. The settings shown here come live from this server.
Paid retrieval
Sign each payment once. If a response says it is still settling, ask again with no payment header, and the content arrives when the transaction finalizes.
# 0. Sign in: sign the exact message with ed25519, no transaction
POST /api/auth/challenge { "wallet": "<payer>" }
POST /api/auth/verify { "wallet": "<payer>", "signature": "<base64>" }
# Keep the Set-Cookie value and send it with every request below.
# 1. Ask for the content. Existing access returns 200.
GET /api/memories/{id}/content
→ 402 PAYMENT-REQUIRED: <base64 JSON>
scheme exact · network <chain>
asset <mint>
amount <atomic> · payTo <contributor> · extra.memo memora:{id}
# 2. Sign one transaction: your wallet pays the fee and is the only signer.
# Allowed: compute budget, an idempotent USDC account for payTo,
# one TransferChecked of the exact amount, and one memo of extra.memo.
GET /api/memories/{id}/content
PAYMENT-SIGNATURE: <base64 of {"x402Version":2,"scheme":"exact","network":"...","payload":{"transaction":"<base64>"}}>
→ 200 { memoryId, title, content, contentHash, receiptId, transactionSignature }
→ 202 { status: "pending", receiptId } # request again WITHOUT a paymentLive configuration
The limits of this API
A receipt tells you a payment settled and access was granted, not whether a model used the text well or answered correctly. Nothing here stops a buyer from reselling what they read. Memora deploys no contract of its own: each asset lives in Metaplex Core and holds the owner and the content hash.
Endpoints
/api/statusPublicWhich network, program and mint this deployment uses, and whether anything is blocking it.
/api/auth/challengePublicBody { wallet }. Returns a plain text message to sign with ed25519.
/api/auth/verifyPublicBody { wallet, signature } (base64). Sets a session cookie.
/api/sessionCookieReturns { wallet } or { wallet: null }. DELETE signs out.
/api/memories/pagePublic / sessionCursor pages of { items, nextCursor, hasMore }. Query q, category, mine, status, cursor, limit (1-50, default 25). Draft status requires mine=true.
/api/memories/:idPublicMetadata: contributor, contentHash, priceUsdc, priceAtomic, assetAddress, registrationSignature. Drafts are visible only to their owner.
/api/memoriesSessionCreate a draft: { title, summary, category, content, priceUsdc }. PATCH and DELETE on :id for your unfrozen drafts.
/api/memories/:id/registration/prepareOwnerFreeze a draft and publish its metadata before signing. Frozen memories cannot be edited or deleted.
/api/memories/:id/registrationOwnerThe Metaplex Core plan: name, uri, attributes. POST { assetAddress, signature } confirms after the server reads the asset from the chain.
/api/memories/:id/contentSession + x402Free for the owner and for wallets with prior paid access. Otherwise 402 with x402 V2 exact requirements. 202 while a payment settles.
/api/memories/:id/agent-permissionOwnerBody { agentEnabled }. Lets the owner allow or stop Ask AI use. Runs already quoted are unaffected.
/api/receipts/pageSessionQuery view=all|earned|spent, cursor, limit. Returns { items, nextCursor, hasMore, hasPending }.
/api/receipts/:id/reconcileSessionAsks the chain what happened to a payment. Send {} to re-check, or { transactionSignature } to find an older one. It only reads, so it cannot charge you.
/api/overviewSessionTotals: drafts, published, paidRetrievals, earnedUsdc, spentUsdc.
/api/agent/statusPublicAgent readiness, model and ranking method.
/api/agent/runsSessionBody { question, maxBudgetUsdc, requestKey }. Returns a quoted run. Reuse requestKey when a response is uncertain. GET lists your runs.
/api/agent/runs/:id/approveSessionBody { expectedTotalAtomic, allowAiProcessing: true }. Signs nothing and moves no funds.
/api/agent/runs/:id/items/:itemId/contentSession + x402Retrieve one approved item. Each item is paid at most once.
/api/agent/runs/:id/generateSessionAfter every item is retrieved, generate the cited answer. Retrying never pays for knowledge again.
/api/agent/runs/:id/cancelSessionEnds the run. USDC that has already settled stays with the contributor.