trackmcp
Back to directory
krecicki

pretestads-agent-scripts

View on GitHub

Score video/image ads with the PreTestAds neural model from OpenAI, Claude, Gemini, LangChain, CrewAI, Vercel AI SDK, or any x402-capable agent — pay-per-request in USDC, no API key needed.

0 stars PythonOthers Updated Jul 18, 2026

Documentation

PreTestAds Agent Scripts

Open-source scripts for scoring video/image ads with the PreTestAds neural model (AdCortex™, trained on fMRI brain-response data) — from any popular LLM platform using your own API key, or from any x402-capable agent with a crypto wallet.

No PreTestAds account. No PreTestAds API key. Each scoring run costs $5.00 USDC, paid per-request over the x402 protocol (HTTP 402) on Solana or Base.

What the API does

`POST https://pretestads.com/api/v1/score` — submit a video (MP4/MOV/AVI) or image (JPG/PNG/WebP) ad by URL or file upload. You get back a job id; 5–8 minutes later, `GET https://pretestads.com/api/v1/score/{id}` (free) returns:

  • Score 0–100 (percentile vs. 76 top-performing TikTok ads) with a label: weak ( python score_ad.py https://example.com/ad.mp4

or a local file:

EVM_PRIVATE_KEY=0x... python score_ad.py ~/Desktop/ad.mp4

code
Node:

cd javascript && npm install

EVM_PRIVATE_KEY=0x... node score-ad.mjs https://example.com/ad.mp4

code
## Quickstart (LLM agent with your API key)

cd python && pip install -r requirements.txt openai

OPENAI_API_KEY=sk-... SOLANA_PRIVATE_KEY= \

python openai_agent.py "Score this ad and tell me how to improve it: https://example.com/ad.mp4"

code
The LLM decides when to call the `score_ad` tool; the tool pays $5 USDC via x402, waits for the result, and hands the score back to the model to interpret.

## How the x402 flow works

1. `POST /api/v1/score` with no payment → **HTTP 402** with an `accepts` array (price, USDC asset, network, payTo for Solana and Base).
2. Your x402 client SDK signs a USDC payment authorization with your local key.
3. Retry the POST with the payment header → server verifies + settles via the facilitator → **HTTP 202** with `{id, status_url, payment}`.
4. Poll `GET /api/v1/score/{id}` (free) until `status` is `complete` (~5–8 min).

One payment = one run. Replayed payment proofs are rejected. Invalid media (422) is never charged.

## Wallet setup

- **Solana**: a wallet holding USDC and a little SOL. Export the base58 secret key.
- **Base**: a wallet holding USDC and a little ETH on Base. Export the 0x private key.
- Use a dedicated hot wallet with only what you intend to spend — these scripts read the key from an environment variable.

## Environment variables

See [`.env.example`](.env.example). Never commit a real `.env`.

## License

MIT — see [LICENSE](LICENSE).

Frequently asked questions

What is pretestads-agent-scripts?

pretestads-agent-scripts is Score video/image ads with the PreTestAds neural model from OpenAI, Claude, Gemini, LangChain, CrewAI, Vercel AI SDK, or any x402-capable agent — pay-per-request in USDC, no API key needed.

How do I install pretestads-agent-scripts?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is pretestads-agent-scripts open source?

Yes — it is hosted on GitHub at https://github.com/krecicki/pretestads-agent-scripts.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP