basenote
Agent API

Basenote for AI Agents

Basenote is built on the x402 payment protocol — the open standard for machine-to-machine payments on Base. AI agents can discover, browse, purchase and read articles autonomously using USDC on Base mainnet.

Base Mainnetx402 ProtocolUSDC
Agent Discovery Endpoint
https://www.basenote.me/api/agent
How it works
01
Discover
Fetch /api/agent to get platform info and available endpoints.
02
Browse
List articles and authors. No authentication required.
03
Read
Pay per article with USDC, or subscribe to an author for 7-day unlimited access.
Endpoints
GET/api/agent▲

Agent discovery endpoint. Returns platform metadata, supported token, chain info and all available endpoints.

Response
{
  "name": "Basenote",
  "description": "Onchain publishing platform on Base.",
  "version": "1.0.0",
  "chain": "base-mainnet",
  "chainId": 8453,
  "token": "USDC",
  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "endpoints": { ... }
}
GET/api/articles▼
GET/api/authors▼
GET/api/agent/readx402▼
POST/api/subscribex402▼
x402 Payment Flow
1
Agent sends GET /api/agent/read?articleId=...&address=...
2
Server responds with HTTP 402 + payment-required header (base64 encoded payment details)
3
Agent decodes header, sends USDC to Treasury on Base mainnet
4
Agent resends request with x-payment: {txHash} header
5
Server verifies transaction on-chain, returns article content
Example — Python
import httpx
import json

BASE = "https://www.basenote.me"
AGENT_WALLET = "0xYourAgentWalletAddress"

# 1. Discover the platform
agent_info = httpx.get(f"{BASE}/api/agent").json()
print("Platform:", agent_info["name"])

# 2. List articles
articles = httpx.get(f"{BASE}/api/articles").json()
print(f"Found {len(articles)} articles")

# 3. Try to read an article (will return 402 if not paid)
article = articles[0]
res = httpx.get(f"{BASE}/api/agent/read", params={
    "articleId": article["id"],
    "address": AGENT_WALLET
})

if res.status_code == 402:
    payment_info = json.loads(
        base64.b64decode(res.headers["payment-required"])
    )
    amount = payment_info["accepts"][0]["amount"]
    pay_to = payment_info["accepts"][0]["payTo"]
    print(f"Payment required: {int(amount)/1e6} USDC to {pay_to}")
    
    # Send USDC payment via your agent's wallet
    # tx_hash = your_wallet.send_usdc(pay_to, amount)
    
    # 4. Read with payment proof
    content = httpx.get(f"{BASE}/api/agent/read", params={
        "articleId": article["id"],
        "address": AGENT_WALLET
    }, headers={
        "x-payment": tx_hash
    }).json()
    print("Article:", content["article"]["title"])
    print("Content:", content["content"][:200])

# 5. Subscribe to an author (optional - for unlimited 7-day access)
# tx_hash = your_wallet.send_usdc(treasury, subscription_price_in_usdc)
# httpx.post(f"{BASE}/api/subscribe", json={
#     "authorAddress": "0xAuthorAddress",
#     "readerAddress": AGENT_WALLET,
#     "txHash": tx_hash,
#     "pricePaid": 0.56,
#     "weekId": get_current_week_id()
# })
Built on x402
x402 is an open payment protocol for the web, built on Base. It enables autonomous machine-to-machine payments without API keys or subscriptions. Learn more at x402.org