dfdimfact / docs

Getting started

No API key. No signup. Just make a request, pay per call, get your data.

1
Make a request — call any endpoint. No auth headers needed.
2
Get a 402 — the response tells you the price and how to pay.
3
Pay — choose x402 (USDC on Base, no account) or MPP (card via Stripe, stablecoins via Tempo).
4
Retry with proof — attach the payment header, get your data.
1. Make a request
curl -i "https://api.dimfact.xyz/v1/regions"
2. You get a 402 — one challenge per protocol
HTTP/1.1 402 Payment Required
Content-Type: application/problem+json
X-Price-USD: 0.001

// MPP challenge — Payment auth scheme
WWW-Authenticate: Payment id="Ab6UhSV...", realm="dimfact",
  method="evm", intent="charge", request="eyJhbW91bnQiOiIx...",
  description="All supported regions", expires="2026-07-25T00:26:16Z"

// x402 challenge — base64 offer
Payment-Required: eyJhY2NlcHRzIjpbeyJhbW91bnQiOiIxMDAwIiwi...

{
  "type": "https://paymentauth.org/problems/payment-required",
  "title": "Payment Required",
  "status": 402,
  "detail": "Payment is required (All supported regions).",
  "challengeId": "Ab6UhSV..."
}

The decoded Payment-Required offer:

{
  "x402Version": 2,
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",          // Base
    "asset": "0x8335...2913",           // USDC
    "amount": "1000",                  // atomic units, 6dp
    "payTo": "0x5Bc4...c654",
    "extra": { "assetTransferMethod": "eip3009" }
  }]
}
3a. Pay with x402
curl -H "X-PAYMENT: <signed-payload>" \
  "https://api.dimfact.xyz/v1/regions"
3b. Or pay with MPP
curl -H "Authorization: Payment <credential>" \
  "https://api.dimfact.xyz/v1/regions"

Both settle the same EIP-3009 USDC transfer. SDKs handle the signing: mppx for MPP, x402 for x402.

4. Get your data
{
  "regions": [
    { "slug": "n-virginia",
      "location": "US East (N. Virginia)",
      "providers": ["aws", "azure", "gcp"] },
    ...
  ]
}
GET /v1/regions $0.001

All supported regions with canonical slugs and locations. No parameters.

Request
curl "https://api.dimfact.xyz/v1/regions"
Response
{
  "regions": [
    { "slug": "n-virginia",
      "location": "US East (N. Virginia)",
      "providers": ["aws", "azure", "gcp"] },
    { "slug": "mumbai",
      "location": "Asia Pacific (Mumbai)",
      "providers": ["aws", "azure", "gcp"] }
  ]
}
GET /v1/cheapest $0.01

Cheapest instance for a vCPU + memory spec. Returns overall winner and cheapest per provider.

vcpurequired number Minimum vCPUs
memory_gbrequired number Minimum memory in GB
os string linux or windows
provider string aws, azure, or gcp
region string Slug or provider code
Request
curl "https://api.dimfact.xyz/v1/cheapest?vcpu=8&memory_gb=64&region=n-virginia"
Response
{
  "target": { "vcpu": 8, "memory_gb": 64, "os": "linux" },
  "cheapest": {
    "provider": "aws",
    "instance_type": "r5.2xlarge",
    "region": "n-virginia",
    "vcpu": 8,
    "memory_gb": 64,
    "price_hr_usd": 0.504
  },
  "by_provider": [ ... ]
}
GET /v1/estimate $0.01

Monthly cost estimate for a mixed fleet across providers.

instancesrequired string type:count pairs
hours number Default 730
os string linux or windows
region string Slug or provider code
Request
curl "https://api.dimfact.xyz/v1/estimate?instances=m5.xlarge:2,Standard_D4s_v5:1&hours=730"
Response
{
  "hours": 730,
  "items": [
    { "provider": "aws", "instance_type": "m5.xlarge",
      "count": 2, "monthly_usd": 280.32 },
    { "provider": "azure", "instance_type": "Standard_D4s_v5",
      "count": 1, "monthly_usd": 140.16 }
  ],
  "total_monthly_usd": 420.48
}

Payments

$0.01/call (regions $0.001). Two protocols.

x402 — USDC on Base

Stateless per-request. No sessions, no keys.

MPP — Stripe + Tempo

Session-based. Cards via Stripe, stablecoins via Tempo.

x402
curl -H "X-PAYMENT: <receipt>" \
  "https://api.dimfact.xyz/v1/cheapest?vcpu=4&memory_gb=16"
MPP
curl -H "Authorization: Payment <token>" \
  "https://api.dimfact.xyz/v1/cheapest?vcpu=4&memory_gb=16"

Errors

200Success 400Bad request 402Payment required 404Not found 429Rate limited 500Internal error
Error response
{
  "error": "vcpu and memory_gb are required"
}