The Problem We Solve
Without Cinderwright Proxy
- Parse the 402 payment-required response
- Decode the base64 payment header
- Set up a USDC wallet with gas (ETH)
- Sign EIP-3009 typed data correctly
- Handle different facilitator formats
- Manage retries when services fail
- Start over for every new service
With Cinderwright Proxy
- Deposit USDC once
- Call any service with one line
- We sign, pay, and retry
- Auto-failover if service is down
- Works on 1,686 x402 services today
- No gas management ever
- Balance in every response header
Before vs After
Before — what your agent needs to do to call one paid service:
// 50+ lines of payment infrastructure...
const r1 = await fetch(serviceUrl);
// Parse 402, decode base64, find accepts array...
const payReqs = JSON.parse(Buffer.from(r1.headers.get('payment-required'), 'base64').toString());
// Configure wallet, sign EIP-3009 typed data...
const sig = await walletClient.signTypedData({ domain, types, primaryType, message });
// Build payload, encode, retry...
const r2 = await fetch(serviceUrl, { headers: { 'payment-signature': encoded } });
// Handle facilitator failures, retries, errors...
After — with Cinderwright Proxy:
const result = await fetch(
'https://api.ideafactorylab.org/proxy?url=' + serviceUrl,
{ headers: { 'X-CW-Key': 'sk_cw_yourkey' } }
);
// That's it. Data arrives. Payment handled.
Set Up in 3 Steps
1
Get a wallet and load it with USDC
You need USDC on the Base network. Full wallet setup guide →
Best wallets: Rainbow (recommended) · Coinbase Wallet · MetaMask
Get USDC on Base: Coinbase exchange → withdraw to Base network. Or bridge from another chain at bridge.base.org.
Minimum deposit: $2. Recommended starting amount: $10–20 for testing.
2
Get your API key
Run this once:
curl -X POST https://api.ideafactorylab.org/proxy/setup \
-H "Content-Type: application/json" \
-d '{"wallet": "0xYOUR_BASE_WALLET_ADDRESS"}'
Returns your key and deposit address. Send USDC to the deposit address — your balance updates automatically in ~60 seconds.
3
Call any service
Option A — proxy a specific URL:
curl "https://api.ideafactorylab.org/proxy?url=https://service.com/endpoint" \
-H "X-CW-Key: sk_cw_yourkey"
Option B — describe what you need, we pick the best service:
curl -X POST https://api.ideafactorylab.org/proxy/do \
-H "Content-Type: application/json" \
-H "X-CW-Key: sk_cw_yourkey" \
-d '{"task": "get weather for Tokyo", "max_cost_usd": 0.05}'
For AI Agents — Exact Prompts
Copy these into your agent's system prompt. Works with Claude, ChatGPT, Gemini, or any LLM agent.
SYSTEM PROMPT — give your agent proxy access:
You have access to the Cinderwright Payment Proxy, which lets you call any paid AI service without handling cryptocurrency directly.
Your proxy key: sk_cw_REPLACE_WITH_YOUR_KEY
To call any paid x402 service:
GET https://api.ideafactorylab.org/proxy?url=SERVICE_URL
Header: X-CW-Key: sk_cw_REPLACE_WITH_YOUR_KEY
To find services by task description:
POST https://api.ideafactorylab.org/proxy/do
Header: X-CW-Key: sk_cw_REPLACE_WITH_YOUR_KEY
Body: {"task": "describe what you need", "max_cost_usd": 0.05}
To find available services:
GET https://api.ideafactorylab.org/discover?q=WHAT_YOU_NEED
To check your balance:
GET https://api.ideafactorylab.org/proxy/balance?key=sk_cw_REPLACE_WITH_YOUR_KEY
Current balance is shown in the X-CW-Balance response header on every proxy call.
Use the proxy for any service costing under $5. Stay within budget.
TOOL DEFINITION — for function-calling agents (OpenAI/Anthropic format):
{"name": "call_paid_service",
"description": "Call any paid AI service through Cinderwright proxy. Handles payment automatically. Use discover_services first to find the right URL.",
"parameters": {"type": "object", "required": ["url"],
"properties": {
"url": {"type": "string", "description": "The service URL to call"},
"method": {"type": "string", "enum": ["GET","POST"], "default": "GET"},
"body": {"type": "object", "description": "Request body for POST calls"}
}},
"url": "https://api.ideafactorylab.org/proxy",
"headers": {"X-CW-Key": "sk_cw_REPLACE_WITH_YOUR_KEY"}
}
Pricing
10% markup
on whatever the service charges. That's our only fee.
Minimum markup: $0.001 per call · Maximum: $5 per call
| Service Cost | Our Markup | You Pay | What You Get |
| $0.001 | $0.001 (min) | $0.002 | Sub-cent data, images, lookups |
| $0.01 | $0.001 | $0.011 | Weather, price feeds, DNS |
| $0.05 | $0.005 | $0.055 | AI inference, translation |
| $1.00 | $0.10 | $1.10 | Heavy compute, large models |
Cache hits cost 50% less — same data served from cache charges half markup.
Response Headers
Every proxy response includes these headers so your agent knows its status:
X-CW-Service: bazaar-gateway.vercel.app ← which service we called
X-CW-Protocol: x402 ← payment protocol used
X-CW-Service-Cost: $0.0010 ← what the service charged
X-CW-Markup: $0.0010 ← our 10% fee
X-CW-Total-Cost: $0.0020 ← total deducted from balance
X-CW-Balance: $9.9980 ← your remaining balance
X-CW-Cache: miss ← or "hit age=45s saved=$0.001"
Common Questions
What if a service is down?
We return a clear error and your balance is unchanged. No charge is ever made for failed calls. We're building auto-failover (route to the next best service automatically) — coming soon.
What protocols are supported?
x402 (USDC on Base) — 1,686 services today. L402 (Lightning) and MPP (Tempo/Stripe) coming once our Lightning node channels are open.
Can I see what my agent is spending?
Yes. GET /proxy/balance?key=sk_cw_xxx returns your full call history, per-call costs, and total spent. Every call is logged.
What's the rate limit?
60 calls per minute per key. More than enough for any agent workflow. Contact us if you need higher limits.
Is my balance safe?
The proxy shuts off automatically if our operator wallet drops below $2 — that's a failsafe, not your balance. Your balance is tracked per-key and is never shared with other accounts.