FMF Credits: prepaid credits + API keys for FMF Tools

Buy prepaid credits for FMF Tools with x402 (Base USDC), MPP (Tempo) or card (Stripe Checkout). Spend them per call with an X-API-Key header.

No account and no API key. Pay per successful call with MPP on Tempo (USDC.e or pathUSD). Invalid input or an upstream failure returns 402 and is not charged.

Quickstart: Tempo Mainnet (chainId 4217) — USDC.e & pathUSD + Base x402

npx mppx account create --network mainnet
# fund it with USDC.e or pathUSD on Tempo mainnet (chainId 4217); `npx mppx account fund` is testnet-only
npx mppx https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-1 --network mainnet -J '{"key":"fmf_00000000000000000000000000000000"}'
npx mppx https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-5 --network mainnet -J '{"key":"fmf_00000000000000000000000000000000"}'

Unpaid requests get HTTP 402 with two Tempo mainnet offers (USDC.e 0x20C000000000000000000000b9537d11c60E8b50, pathUSD 0x20c0000000000000000000000000000000000000) and an x402 v2 offer on Base USDC. Recipient 0xB2070a4A874E7141E551890a3642bF7B24a1a148. Invalid input is not charged. More: docs · llms.txt · OpenAPI · all FMF Tempo mainnet APIs · comparison vs other paid APIs (llms-comparisons.txt, comparisons.json)

Routes

RoutePriceWhat you get
POST /mpp/credits/topup-1$1.00Buy $1 of FMF prepaid credits
Adds $1.00 of prepaid credit to an FMF API key (create a key: POST https://fmf-credits.fmf-x402.workers.dev/keys; keys start at $0, no free calls). Credits are spent per call on any credit-enabled FMF Tools route with header X-API-Key, no wallet needed per call. Unknown key -> not charged.
POST /mpp/credits/topup-5$5.00Buy $5 of FMF prepaid credits
Adds $5.00 of prepaid credit to an FMF API key (create a key: POST https://fmf-credits.fmf-x402.workers.dev/keys; keys start at $0, no free calls). Credits are spent per call on any credit-enabled FMF Tools route with header X-API-Key, no wallet needed per call. Unknown key -> not charged.
POST /mpp/credits/topup-20$20.00Buy $20 of FMF prepaid credits
Adds $20.00 of prepaid credit to an FMF API key (create a key: POST https://fmf-credits.fmf-x402.workers.dev/keys; keys start at $0, no free calls). Credits are spent per call on any credit-enabled FMF Tools route with header X-API-Key, no wallet needed per call. Unknown key -> not charged.

Copy-paste examples

These call POST /mpp/credits/topup-1 ($1.00) — Buy $1 of FMF prepaid credits. Swap the path for any other route in the table.

mppx CLI

npx mppx https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-1 --network mainnet -J '{"key":"fmf_00000000000000000000000000000000"}'

Create a mainnet account once with npx mppx account create --network mainnet and fund it with USDC.e or pathUSD on Tempo mainnet (chainId 4217); npx mppx account fund is testnet-only. The CLI then pays the 402 automatically. See mpp.dev/sdk.

curl (unpaid — shows the 402, not charged)

curl -i -X POST https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-1 -H 'content-type: application/json' -d '{"key":"fmf_00000000000000000000000000000000"}'

TypeScript SDK (mppx)

import { Mppx, tempo } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY) })],
})

// Global fetch now pays the 402 automatically.
const res = await fetch('https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-1', {
  method: 'POST',  headers: {
    'content-type': 'application/json',
  },
  body: JSON.stringify({"key":"fmf_00000000000000000000000000000000"}),
})
console.log(await res.json())

Python SDK (pympp)

# pip install pympp
# Docs: https://mpp.dev/sdk/python
import asyncio
from mpp.client import Mpp
from mpp.methods.tempo import TempoAccount
from mpp.methods.tempo import client as tempo

account = TempoAccount.from_key("0x...")

async def main():
    async with Mpp(methods=[tempo.charge(account=account)]) as mpp:
        response = await mpp.fetch("https://fmf-credits.fmf-x402.workers.dev/mpp/credits/topup-1", method="POST", json={"key":"fmf_00000000000000000000000000000000"})
        print(await response.json())

asyncio.run(main())

MCP config (Cursor, Claude Desktop, VS Code)

{
  "mcpServers": {
    "fmf-mpp-fmf-credits": {
      "url": "https://fmf-credits.fmf-x402.workers.dev/mcp"
    }
  }
}

Transport is Streamable HTTP at https://fmf-credits.fmf-x402.workers.dev/mcp. tools/list is free. Paid tools/call needs an MPP Payment header, or just use mppx against the HTTP route.

Sister services