Open Source

The PreTestAds Agent Toolkit

Everything you need to score ads from an AI agent without writing the x402 payment plumbing yourself: ready-made scripts for every major LLM platform, an MCP server, and a Claude plugin. All MIT-licensed on GitHub. Each scoring run costs $5 USDC, paid from your own wallet over the x402 agent API — no PreTestAds account or API key needed.


Scripts for every platform

Each agent script registers a score_ad tool with the LLM of your choice, using your own provider API key. When the model decides to score an ad, the tool signs the $5 USDC payment locally with your wallet key, submits the ad, waits for the result, and hands the score back to the model to interpret. Python pays on Solana or Base; JavaScript pays on Base via x402-fetch.

PlatformPythonJavaScript
Plain CLI (no LLM)python/score_ad.pyjavascript/score-ad.mjs
OpenAI function callingpython/openai_agent.pyjavascript/openai-agent.mjs
Anthropic Claude tool usepython/anthropic_agent.pyjavascript/anthropic-agent.mjs
Google Geminipython/gemini_agent.pyjavascript/gemini-agent.mjs
LangChainpython/langchain_tool.pyjavascript/langchainjs-tool.mjs
CrewAIpython/crewai_tool.py
Vercel AI SDKjavascript/vercel-ai-tool.mjs
Benchmark video download ($0.50)python/download_benchmark_video.pyjavascript/download-benchmark-video.mjs

The no-LLM CLIs score an ad directly from your terminal — handy for cron jobs and CI pipelines:

# Python (Solana or Base)
cd python && pip install -r requirements.txt
SOLANA_PRIVATE_KEY=<base58> python score_ad.py https://example.com/ad.mp4

# Node (Base)
cd javascript && npm install
EVM_PRIVATE_KEY=0x... node score-ad.mjs ~/Desktop/ad.mp4

Claude plugin (Claude Code & Cowork)

The fastest path if you use Claude: two commands install four skills — score-ad (submit video, image, audio, or text ads), check-score (poll a run and interpret the attention curve), pretestads-account (credits and history via API key), and pretestads-setup (save your keys once). Then just say "score my ad" in any session.

/plugin marketplace add krecicki/pretestads-claude-plugin
/plugin install pretestads@pretestads

The plugin pays per run with a crypto wallet via x402 (no account), or uses your PreTestAds API key and account credits — which also unlocks audio and text ad scoring, history, and conversion tracking.

MCP server (Claude Desktop, Cursor, and friends)

The mcp-server directory exposes ad scoring as MCP tools, so any MCP-capable client can score ads. Point your client's MCP config at it:

{
  "mcpServers": {
    "pretestads": {
      "command": "node",
      "args": ["/path/to/pretestads-agent-scripts/mcp-server/server.mjs"],
      "env": { "EVM_PRIVATE_KEY": "0x..." }
    }
  }
}

Wallet safety

  • Keys never leave your machine. The scripts use your private key only to sign the x402 payment payload locally — it is never transmitted.
  • Use a dedicated hot wallet holding only what you plan to spend, plus a little SOL (Solana) or ETH (Base) for fees.
  • One payment, one run. Replayed payment proofs are rejected, and invalid media (422) is never charged.

Want the raw API instead?

The full x402 endpoint reference — request shapes, payment flow, and response format — lives in the agent API guide. A machine-readable summary is at /llms.txt.

Read the Agent API Guide