This is the minimal user-side bundle for giving a Codex or Claude Code agent paid access to the x402 Polymarket data seller. Users do not need to clone the full service repository.
Codex:
curl -fsSL https://raw.githubusercontent.com/celer-network/x402-polymarket-agentpay-buyer/refs/heads/main/install.sh | bash -s -- --codexClaude Code:
curl -fsSL https://raw.githubusercontent.com/celer-network/x402-polymarket-agentpay-buyer/refs/heads/main/install.sh | bash -s -- --claudeBoth:
curl -fsSL https://raw.githubusercontent.com/celer-network/x402-polymarket-agentpay-buyer/refs/heads/main/install.sh | bash -s -- --codex --claudeinstall.sh already created /tmp/buyer-agentpay.env from the template. Edit it and set:
export BUYER_KEY="<64_HEX_PRIVATE_KEY_NO_0x>"By default RPC_URL points at the public https://mainnet.base.org endpoint, which is rate-limited and flaky under load — preflight balance checks, channel ops, and on-chain withdraw confirmations will intermittently fail (in the worst case, leaving the local buyer state with a stuck "pending withdraw" flag that no amount of clicking can clear). For reliable runs, swap it for your own Base mainnet RPC from a provider like Alchemy or NodeReal:
# In /tmp/buyer-agentpay.env
export RPC_URL="https://base-mainnet.g.alchemy.com/v2/<YOUR_API_KEY>"
# or
export RPC_URL="https://base-mainnet.nodereal.io/v1/<YOUR_API_KEY>"Then re-run start-dashboard.sh. The buyer-node reads its on-chain RPC from Ethereum.Gateway in ~/.x402/buyer-profile.json — not directly from the env var — so the profile must contain your chosen RPC. start-dashboard.sh regenerates the profile on every launch (the previous file is preserved as ~/.x402/buyer-profile.json.prev), so changes to RPC_URL take effect the next time you start the dashboard. Editing ~/.x402/buyer-profile.json manually is pointless — it gets overwritten on the next launch; edit the env instead.
bash start-dashboard.shThen open http://localhost:9100. The dashboard generates the buyer profile, runs preflight, and exposes a RUN AGENT button.
The public buyer bundle does not store a standalone dashboard.html file. The local page is compiled into the bundled skills/codex-buyer-agentpay/bin/status-bridge binary from the service repository:
// x402-polymarket-data/cmd/status-bridge/main.go
//go:embed dashboard.htmlstart-dashboard.sh launches that binary and opens http://localhost:9100; the binary serves the embedded page from /.
When x402-polymarket-data/cmd/status-bridge/dashboard.html, cmd/status-bridge/main.go, or cmd/x402-client changes, rebuild the runtime binaries from x402-polymarket-data and copy them into this public bundle before publishing:
DATA_REPO=/path/to/x402-polymarket-data
BUYER_REPO=/path/to/x402-polymarket-agentpay-buyer
cd "$DATA_REPO"
go test ./...
go build -o "$BUYER_REPO/skills/codex-buyer-agentpay/bin/status-bridge" ./cmd/status-bridge/
go build -o "$BUYER_REPO/skills/codex-buyer-agentpay/bin/x402-client" ./cmd/x402-client/
chmod +x "$BUYER_REPO/skills/codex-buyer-agentpay/bin/status-bridge" \
"$BUYER_REPO/skills/codex-buyer-agentpay/bin/x402-client"
cd "$BUYER_REPO"
git status --shortCommit the updated binaries together with any bundle docs, scripts, or env template changes. This is what makes dashboard UI fixes available to users who install via install.sh.
Clicking RUN AGENT forks your local LLM CLI and prompts it to invoke skills/codex-buyer-agentpay/scripts/run-batch-export.sh. The wrapper runs x402-client in batch-export mode; paid x402 calls stream through your AgentPay channel and events feed the Payment Flow / Response panels live.
The dashboard picks codex by default; if you also have claude installed and signed in, the Agent Setup row shows a small switch to claude pill next to "codex signed in" — click it to flip the choice (the selection persists across reloads).
Requirements for RUN AGENT:
- One of
codex(brew install --cask codexornpm i -g @openai/codex) orclaude(npm i -g @anthropic-ai/claude-code) onPATH. - That CLI must be signed in (
codex loginorclaude auth login).
The dashboard's "Agent Setup → LLM CLI signed in" row reflects this. RUN AGENT requires an authenticated LLM CLI; if no CLI is available, install and sign in to Codex or Claude before starting the agent.
Paid calls spend USDC from the buyer channel.
If you don't want the dashboard, run the same steps manually:
source /tmp/buyer-agentpay.env
bash deploy/gen-buyer-profile.sh
bash skills/codex-buyer-agentpay/scripts/preflight.shThen ask your Codex / Claude Code agent to run the Polymarket data buyer flow.
- Use a dedicated buyer key for this workflow.
- Never commit
/tmp/buyer-agentpay.envorBUYER_KEY. - Treat
BUYER_DATA_DIRas sensitive local state.