x402-credits

YourAITools Credits: prepaid $1 / $5 x402 credit packs (one payment mints an API key with a USDC-denominated balance) that every YourAITools x402 tool accepts as Authorization: Bearer <key>; per-key Durable Object balances, atomic debits

Browse source · x402-credits.tar.gz · x402-credits.bundle
commit e2ef859 · e2ef859f6966098946c15f6a642a0dcc6a6ea2cf
Clone: git clone https://agentgate-source.pages.dev/x402-credits/x402-credits.git (branch main, commit e2ef859f6966098946c15f6a642a0dcc6a6ea2cf) or curl -O https://agentgate-source.pages.dev/x402-credits/x402-credits.bundle && git clone x402-credits.bundle x402-credits
Home: this repo is hosted here (it was never on GitHub).

YourAITools Credits

Prepaid credits for the YourAITools x402 agent APIs. Pay once over x402, get an API key, then call any of the tools with Authorization: Bearer <key>. Each call debits its normal per-call price, so there's no on-chain payment per call.

Live: https://api.youraitools.co/credits/ (also https://credits.agentgate.workers.dev)

Route Price What you get
GET\|POST /v1/pack/1 $1 USDC new key with $1.00 of credits
GET\|POST /v1/pack/5 $5 USDC new key with $5.50 of credits (10% bonus)
GET\|POST /v1/pack/sample $0.005 USDC new key with $0.005 of credits (try the whole flow)
GET\|POST /v1/topup/1, /v1/topup/5 $1 / $5 add $1.00 / $5.50 to an existing key (send the key)
GET /v1/balance free balance, spend per tool, recent calls (send the key)
POST /v1/key/rotate free move the balance to a new key; the old key stops working
GET /v1/preview?pack=5, /v1/prices free what a pack buys at today's prices
POST /mcp free remote MCP: credits_quote, credits_balance

You can pay in USDC on Base, Polygon, Arbitrum One or Solana with x402 v2 (PAYMENT-SIGNATURE), or on Base with v1 (X-PAYMENT). A pack is settled only when its key is delivered: if settlement fails, the key is never shown and the account is deleted.

Using a key

curl -s -H "Authorization: Bearer $KEY" "https://api.youraitools.co/payguard/v1/address?address=0x098B716B8Aaf21512996dC57EB0615e2383E2f96"
# response headers: X-Credits-Charged: 0.001000, X-Credits-Remaining: 0.999000, X-Credits-Ref: r_...

How it works

Terms

Credits are prepaid usage of the YourAITools APIs only, priced in USD at each route's normal per-call price. They are not money and not a token or investment. They have no cash value, can't be withdrawn and are not refundable. Whoever holds the key can spend the credits.

MIT licensed. npm test (node --test) · wrangler deploy.


agentgate-source: code mirror on Cloudflare Pages. All repos