NewAgent payments over x402

    A ledger for the credits your app sells.

    Define a credit, issue it, deduct it, let users buy more through Stripe. Cred keeps the balances, the history and the webhooks so you don't have to build a ledger.

    100 free API credits · No card to start · One call per credit

    Ledgerproj_ai-studio · credit type: tokens · usr_7f3a
    Your server
    Response
    waiting—
    timeentryamountbalance
    • 10:42:01issue welcome_bonus+500500
    • 10:42:07deduct inference · gpt-4o−12488
    • 10:42:09deduct inference · gpt-4o−12476
    • 10:43:15purchase Stripe · Starter pack+2,0002,476
    Balance
    0
    tokens
    Issued
    0
    lifetime
    Spent
    0
    lifetime
    Webhook
    —
    Every write is atomic and idempotent. Balances never go negative, and every row is kept for audit.

    One ledger for anything your app meters, in any unit you name.

    • AI appsper token
    • APIsper call
    • Gamesin-game coin
    • Marketplacesbuyer credit
    • Loyaltypoints
    How it works

    Three calls.
    A working credit economy.

    From naming a credit to a user paying for more, without writing a ledger, a checkout, or a webhook signer.

    1 min
    New credit type
    NameTokens
    SymbolTKN
    Price$0.01 / credit
    Starter pack2,000 · $19

    01Name a credit

    • Tokens, coins, points — any unit
    • Set a price per credit or per pack
    • One project can hold several types
    10 min
    $ curl -X POST api.cred.diy/v1/credits/deduct \
        -H "Authorization: Bearer sk_live_…" \
        -d '{"user_id":"usr_7f3a","amount":12}'
    
    {
      "balance": 476,
      "transaction_id": "txn_01HX…"
    }

    02Issue and deduct from your server

    • Two REST calls, one API key
    • Atomic writes, idempotency keys
    • Balances can't go below zero
    0 min
    Checkout · ai-studio
    Starter pack2,000 TKN
    Card•••• 4242
    Pay $19.00
    credits.purchased → your webhook

    03Users top up through Stripe

    • Hosted checkout, your Stripe or Connect
    • Paid invoice credits the ledger
    • Signed webhook tells your app
    1 CRD

    Per API call. No seats, no monthly minimum.

    100

    Free calls on every new account.

    0%

    Platform fee when payments run on your own Stripe keys.

    5

    EVM chains your credit can mint to, when you want it.

    What's inside

    Everything between
    a purchase and a balance.

    The parts of a credit system that are boring to build and easy to get wrong, done once.

    Every issue and deduct is one atomic row with a reason, metadata and an idempotency key. Query a balance, page the history, export it for audit.

    Hosted checkout for one-time packs or recurring plans. Use your own Stripe keys or Stripe Connect; each paid invoice credits the ledger exactly once.

    credits.issued, credits.deducted, credits.purchased and more, HMAC-signed, retried with backoff, every delivery logged with its response.

    A user's balances across your projects roll up to one email-keyed wallet. Let them swap one credit for another at a rate you set.

    Deploy a credit as an ERC-20 on Ethereum, Base, Polygon, Arbitrum or Optimism. Turn on mint-on-issue and the ledger stays the source of truth.

    The ledger
    issuewelcome_bonus+500
    deductinference−12
    deductinference−12
    refundretry · idem:ab12+12
    Why not build it

    A counter is easy.
    A ledger is not.

    Most credit systems start as an integer on a user row. They stop working the first time two requests land at once or a refund has to be explained.

    Rolling your ownWith Cred
    A balance column on the users tableA ledger: every change is a row with a reason and an idempotency key
    Race conditions on concurrent deductsAtomic writes; a balance never goes below zero
    Stripe webhook handler you wrote at 2amPaid invoice credits the ledger once, retried safely
    Notify your app… somehowSigned webhooks with delivery logs and backoff
    Rebuild it for the next projectUnlimited projects and credit types on one key
    Tokens on-chain means a rewriteFlip mint-on-issue; the ledger stays the source of truth
    Your users' money

    Built so you can
    show your work.

    Credits are money your users already paid for. Every part of Cred assumes someone will ask where a balance came from.

    Hashed API keys

    Keys are stored hashed, scoped to one project, and show last use so you can rotate with confidence.

    Signed webhooks

    Every delivery carries an HMAC signature and a timestamp. Verify in two lines; replay is rejected.

    Encrypted everywhere

    TLS in transit, AES-256 at rest. Stripe credentials are linked by OAuth and never pass through you.

    A full record

    Every credit movement is kept with who, when, why and the request that caused it. Export any time.

    Pricing

    Buy calls.
    Spend them whenever.

    One CRD per API call. Packs never expire and there is no monthly fee. Your users' payments go to your Stripe, not ours.

    Starter

    $10
    1,000 calls · $0.010 / call
    • 1 project, 1 credit type
    • Unlimited end users
    • REST API and dashboard
    Buy 1,000 calls

    Growth

    Most chosen
    $79
    10,000 calls · $0.0079 / call
    • Unlimited projects and credit types
    • Stripe Connect and subscriptions
    • Signed webhooks and analytics
    Buy 10,000 calls

    Scale

    $499
    100,000 calls · $0.005 / call
    • Everything in Growth
    • ERC-20 deployment
    • Dedicated support and SLA
    Talk to us

    Need more than 100k calls a month? Volume pricing

    Your first credit is
    one request away.

    No card needed to start.

    ai-studio · tokens · last 30 days+146k issued