Windfall Inference
Verified@papa-raw
npx machina-cli add skill @papa-raw/windfall-inference --openclawWindfall Inference
Spatially-routed LLM inference gateway for AI agents on Base. Routes every request to the cheapest model on the cleanest energy.
Setup
Set WINDFALL_API_KEY in your environment. Get one free at:
curl -X POST https://windfall.ecofrontiers.xyz/api/keys \
-H "Content-Type: application/json" \
-d '{"wallet_address": "YOUR_WALLET"}'
Keys with an ERC-8004 agent identity or Basename get 100 free requests. Anonymous keys get 25.
Usage
Use as an OpenAI-compatible endpoint. Set these two environment variables:
OPENAI_BASE_URL=https://windfall.ecofrontiers.xyz/v1
OPENAI_API_KEY=wf_YOUR_KEY
Or call directly:
curl https://windfall.ecofrontiers.xyz/v1/chat/completions \
-H "Authorization: Bearer $WINDFALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Hello"}]
}'
x402 Payment (No API Key Needed)
Windfall supports the x402 payment protocol. Any agent with a Base wallet can pay per-request without creating an API key. Send a request without auth and the server returns HTTP 402 with a PAYMENT-REQUIRED header containing USDC payment instructions on Base. Your x402 client handles the rest.
Routing Modes
greenest(default) — lowest carbon intensitycheapest— lowest energy costbalanced— Pareto-weighted cost + carbon
Set via "mode" in the request body or X-Routing-Mode header.
Models
Default: DeepSeek V3 (auto-selected by engagement classifier). Override with "model" field. 200+ models available via OpenRouter.
Pricing
- Standard: $0.004/request
- Premium (Claude, GPT-4): $0.008/request
- Green surcharge: +10% for
greenestmode - Cache hits: free
Response Headers
Every response includes:
X-Windfall-Cache— HIT or MISSX-Windfall-Mode— routing mode usedX-Windfall-Model— model that handled the requestX-Windfall-Node— node that executed the requestX-Windfall-Cost— cost chargedX-Windfall-Saved— savings vs direct API (cache hits)
Onchain Attestations
Every inference call produces a verifiable EAS attestation on Base with: node location, energy price, carbon intensity, model used, and response hash. Query at base.easscan.org.
Overview
Windfall Inference is a spatially-routed LLM gateway for AI agents on Base. It routes every request to the cheapest model on the cleanest energy, supporting 200+ models via OpenRouter and exposing an OpenAI-compatible endpoint, with verifiable on-chain attestations on Base.
How This Skill Works
Clients call the OpenAI-compatible endpoint at OPENAI_BASE_URL. Windfall selects the model and routing mode (greenest, cheapest, or balanced) based on energy cost and carbon intensity, defaulting to DeepSeek V3. With 200+ models available and on-chain attestations on Base, each response includes headers like X-Windfall-Cost, X-Windfall-Mode, X-Windfall-Model, and X-Windfall-Node to show provenance and savings.
When to Use It
- You aim to minimize carbon footprint and energy cost for sustainability targets.
- You need predictable pricing at $0.004 per request, with optional premium models.
- You want an OpenAI-compatible endpoint for Base-based agents without changing your client.
- You want to pay per-request using x402 on Base, without creating an API key.
- You require verifiable provenance via on-chain attestations for audits.
Quick Start
- Step 1: Set WINDFALL_API_KEY in your environment (get a free key at the provided endpoint).
- Step 2: Set OPENAI_BASE_URL=https://windfall.ecofrontiers.xyz/v1 and OPENAI_API_KEY=wf_YOUR_KEY.
- Step 3: Call the /v1/chat/completions endpoint, optionally setting mode via the request body or X-Routing-Mode header (greenest, cheapest, or balanced).
Best Practices
- Choose routing mode to match SLA: greenest for carbon, cheapest for cost, balanced for trade-offs.
- Leverage cache hits to reduce cost and latency.
- Monitor per-request costs and mode via X-Windfall-Cost and X-Windfall-Mode headers.
- Securely store and rotate WINDFALL_API_KEY and OPENAI_API_KEY in your environment.
- Use on-chain attestations (Base) to document model, energy, and provenance for compliance.
Example Use Cases
- A climate-conscious app uses greenest mode to minimize carbon footprint while serving users.
- A cost-sensitive enterprise routes to the cheapest model to lower operating expenses.
- An agent on Base with an ERC-8004 identity demonstrates 100 free requests for compliant keys.
- A developer deploys x402 payments, letting users pay in USDC on Base without API keys.
- An audit-focused workflow validates model choice, energy price, and provenance via on-chain attestations.