Agent Payments API
Premium API access for AI agents. Paid in USDC on Base, settled in seconds. No accounts, no API keys, no traditional payment processors.
Send USDC, get a bearer token, call premium endpoints. Each call decrements credits from your token. When credits run out, top up. The token is the only credential the API ever sees from you.
Payment Wallet
Address
0x549c82e6bfc54bdae9a2073744cbc2af5d1fc6d1View on BasescanNetwork
Base mainnet
Currency
USDC (Circle native)
USDC contract
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913Cross-check this address before sending funds: /llms.txt, /api/payment/info, GitHub README, and the @tensorfeed bio. If any source disagrees, do not send.
Pricing
Base rate: 50 credits per $1 USDC (about $0.02 per credit). Volume discounts apply automatically when you buy larger bundles.
| Send | Credits | Discount |
|---|---|---|
| $1.00 | 50 | base |
| $5.00 | 275 | 10% off |
| $30.00 | 1,950 | 25% off |
| $200.00 | 16,000 | 40% off |
Credits do not expire. Each premium call costs 1 to 5 credits depending on the tier. Tier 2 routing is currently 1 credit per call.
Two Payment Flows
Credits-first (recommended)
Buy a batch of credits once, use a bearer token for all subsequent calls. About 50ms per call.
- POST
/api/payment/buy-creditswithamount_usd - Send USDC on Base to the returned wallet (memo optional)
- POST
/api/payment/confirmwith the tx hash - Receive a
tf_live_*token; pass it asAuthorization: Bearer
x402 fallback (one-off)
For agents that want to discover and pay in a single retry. About 3 to 4 seconds total latency on the first call.
- GET
/api/premium/*with no auth - Receive 402 with payment instructions in headers and body
- Send USDC on Base to the wallet
- Retry with
X-Payment-Txheader; receive data plus a token inX-Payment-Tokenheader
Endpoints
/api/payment/infoFreePublic. Returns wallet address, pricing tiers, supported flows, and verification metadata.
Example response
{
"ok": true,
"wallet": {
"address": "0x549c82e6bfc54bdae9a2073744cbc2af5d1fc6d1",
"currency": "USDC",
"network": "base",
"contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"pricing": { "base_rate": "50 credits per $1 USDC", "volume_bundles": [...] },
"flow": { "with_quote": [...], "x402_fallback": [...] },
"verification": { ... }
}/api/payment/buy-creditsFreeGenerate a 30-minute payment quote. Returns wallet, memo (nonce), and credit count.
Example response
// Body: { "amount_usd": 1.00 }
{
"ok": true,
"wallet": "0x549c82e6bfc54bdae9a2073744cbc2af5d1fc6d1",
"memo": "tf-abc123",
"amount_usd": 1.00,
"credits": 50,
"currency": "USDC",
"network": "base",
"expires_at": "2026-04-27T22:30:00Z",
"ttl_seconds": 1800
}/api/payment/confirmFreeVerify a USDC tx on Base and mint a bearer token. Idempotent: same tx submitted twice is rejected.
Example response
// Body: { "tx_hash": "0x...", "nonce": "tf-abc123" }
{
"ok": true,
"token": "tf_live_<64-hex-chars>",
"credits": 50,
"balance": 50,
"tx_amount_usd": 1.00,
"rate": "base"
}/api/payment/balanceToken requiredCheck remaining credits for the current bearer token.
Example response
// Header: Authorization: Bearer tf_live_...
{
"ok": true,
"balance": 47,
"created": "2026-04-27T22:00:00Z",
"last_used": "2026-04-27T22:14:23Z",
"total_purchased": 50
}/api/preview/routingFree (5/day/IP)Free routing preview, top-1 model only, no score breakdown. Rate-limited to 5 calls per UTC day per IP.
Example response
{
"ok": true,
"preview": true,
"task": "code",
"rate_limit": { "limit": 5, "remaining": 4, "scope": "per IP per UTC day" },
"recommendation": { "model": "Claude Opus 4.7", "provider": "anthropic" },
"upgrade": { "premium_endpoint": "/api/premium/routing", ... }
}/api/premium/routing1 credit per callTier 2 routing engine. Top-N ranked models with full composite score breakdown, pricing, status, and live data freshness. Custom weights via query params.
Example response
// Header: Authorization: Bearer tf_live_...
// Query: ?task=code&budget=5.0&top_n=3&w_quality=0.6&w_cost=0.3
{
"ok": true,
"task": "code",
"weights": { "quality": 0.6, "availability": 0.0, "cost": 0.4, "latency": 0.0 },
"recommendations": [
{
"rank": 1,
"model": { "id": "claude-opus-4-7", "name": "Claude Opus 4.7", ... },
"pricing": { "input": 15, "output": 75, "currency": "USD" },
"status": "operational",
"composite_score": 0.87,
"components": { "quality": 0.94, "availability": 1.0, "cost": 0.65, "latency": 0.5 }
}
],
"billing": { "credits_charged": 1, "credits_remaining": 49 }
}Code Examples
from tensorfeed import TensorFeed
tf = TensorFeed()
# 1. Quote a credit purchase (30-minute TTL)
quote = tf.buy_credits(amount_usd=1.00)
print(f"Send {quote['amount_usd']} USDC on Base to {quote['wallet']}")
print(f"Memo: {quote['memo']}")
# 2. Send the USDC tx with your own wallet (Rabby, Coinbase, etc.)
# then confirm with the tx hash:
result = tf.confirm(tx_hash="0xYOUR_TX_HASH", nonce=quote["memo"])
# The token is auto-stored on the client; routing() uses it automatically.
# 3. Call premium endpoints
rec = tf.routing(task="code", budget=5.0, top_n=3)
for r in rec["recommendations"]:
print(f"#{r['rank']}: {r['model']['name']} (score: {r['composite_score']:.2f})")
# 4. Check remaining credits
print(tf.balance())# Free preview (5 calls/day per IP)
curl "https://tensorfeed.ai/api/preview/routing?task=code"
# 1. Quote a purchase
curl -X POST https://tensorfeed.ai/api/payment/buy-credits \
-H "Content-Type: application/json" \
-d '{"amount_usd": 1.00}'
# 2. Send USDC on Base to the wallet, then confirm
curl -X POST https://tensorfeed.ai/api/payment/confirm \
-H "Content-Type: application/json" \
-d '{"tx_hash": "0xYOUR_TX", "nonce": "tf-abc123"}'
# 3. Use the token on premium endpoints
curl -H "Authorization: Bearer tf_live_..." \
"https://tensorfeed.ai/api/premium/routing?task=code&top_n=5"
# 4. Check balance
curl -H "Authorization: Bearer tf_live_..." \
https://tensorfeed.ai/api/payment/balance# Single-retry x402 flow (no pre-flight) curl https://tensorfeed.ai/api/premium/routing # 402 Payment Required + payment instructions in headers and body # Send USDC on Base to the wallet, then retry with the tx hash: curl -H "X-Payment-Tx: 0xYOUR_TX" \ "https://tensorfeed.ai/api/premium/routing?task=code" # Returns the data + a fresh token in X-Payment-Token header for future calls
Free Preview Tier
Every paid endpoint has a free preview at /api/preview/*. The free tier returns the top recommendation only (no score breakdown) and is rate-limited to 5 calls per UTC day per IP. The counter resets at UTC midnight.
Use the preview to validate the endpoint before committing credits. After 5 calls in a day, the response is a 429 with a hint to use the paid endpoint and the number of hours until reset.
Terms and Refunds
- No-training license: Premium API responses are licensed for inference use only. Use for training, fine-tuning, evaluation, or distillation of ML models is prohibited.
- Refunds: Email [email protected] with the tx hash within 24 hours of the charge. Manual USDC refund to the originating address within 5 business days.
- Best-effort, no SLA: We aim for high uptime but offer no service guarantee. Credits do not expire but specific premium endpoints may be modified or discontinued with reasonable notice.
- Replay protection: Each USDC tx can be used to mint credits exactly once. Re-submitting the same tx hash is rejected.
Full legal terms are in the Terms of Service.