API Overview

Base URL

https://api.nexflow.io/v1

Quickstart Steps

  1. 1
    Get your API key

    Sign up and grab your API key from the dashboard.

  2. 2
    Create a metered endpoint

    Define your upstream URL and pricing.

  3. 3
    Route traffic through NexFlow

    Use the metered URL instead of your direct API.

  4. 4
    Receive payments

    USDC settles to your wallet automatically.

End-to-End Example

An AI agent making a metered API call with x-payment header:

Agent making paid API call
curl https://api.nexflow.io/v1/metered/ep_abc123 \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "x-payment: 0x7f8a...3b2c" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Explain quantum computing"}'

# Response
{
  "data": {
    "completion": "Quantum computing uses..."
  },
  "x402": {
    "verified": true,
    "facilitator": "cdp",
    "amount": "1000",
    "token": "USDC",
    "network": "base"
  },
  "usage": {
    "id": "usage_xyz",
    "units": 1,
    "cost": "0.001"
  }
}