Skip to content
FluxusDocs
Fluxus DocumentationFluxus Documentation

Developer API and MCP

Developer

Fluxus exposes the shipped backend surface behind Phase 4: free REST reads, an authenticated send endpoint, an MCP tool layer for AI agents, and monetized machine-payment routes over HTTP 402.

Developer API and MCPDeveloper API and MCP

Designed for backends, automations, and agent runtimes that need Tempo-native payments.

Architecture

REST API

Free read endpoints for balances, history, and .pay name resolution, plus one authenticated send route for production integrations.

MPP Gateway

Machine-to-machine endpoints monetize send, streaming, and scheduled payment flows with HTTP 402 pricing in pathUSD.

MCP Server

A compact 12-tool surface lets Claude Code style agents inspect accounts, initiate payments, and prepare Tempo-native intents.

REST API

The public REST layer is intentionally small: four free read routes and one authenticated write route for sending TIP-20 payments.

MethodEndpointAccessNotes
GET/api/v1/balance/:addressFreeReturns balances for all supported Tempo stablecoins.
GET/api/v1/resolve/:nameFreeResolves a .pay name to a Tempo address.
GET/api/v1/reverse/:addressFreePerforms reverse lookup for registered .pay names.
GET/api/v1/history/:addressFreeReturns indexed activity with a recent-block fallback when needed.
POST/api/v1/sendBearer authSigns and submits a TIP-20 transfer with optional memo.

Auth: POST /api/v1/send expects an Authorization: Bearer <FLUXUS_API_KEY> header and signs with the configured sender wallet.

MCP server

Fluxus exposes a compact MCP surface tuned for agent workflows: read account state, resolve names, prepare requests, and trigger payment actions without surfacing unrelated app features.

ToolInputReturns
get_balanceaddressStablecoin balances for the requested account
resolve_namename.pay resolution result
reverse_lookupaddressReverse name record for an address
get_historyaddressRecent on-chain history for an account
get_name_infonameRegistration metadata for a .pay name
check_name_availabilityname, duration_years?.pay availability and registration fee
get_tx_statushashPending, success, or reverted transaction status
send_paymentto, amount, token, memo?Authenticated single transfer result
batch_sendrecipients[].{to, amount, memo?}Client-side batch payment orchestration
create_requestamount, token, memo?Shareable payment request intent
start_streamto, amount, duration_minutesStreaming payment setup URL (no on-chain action)
create_scheduledto, amount, delay_minutes, window_minutesScheduled payment setup URL (no on-chain action)

Claude Code JSON config

{
  "mcpServers": {
    "fluxus": {
      "command": "npx",
      "args": ["fluxus-mcp"],
      "env": {
        "FLUXUS_BASE_URL": "https://your-domain.com",
        "FLUXUS_API_KEY": "your-bearer-token"
      }
    }
  }
}

MPP

Machine Payments Protocol adds paid agent routes. Read endpoints stay free, while send and intent-creation endpoints challenge with HTTP 402 and settle in pathUSD. /api/mpp/send is the one route that executes a transfer end to end; the stream and scheduled routes sell an intent link, not an executed payment. A machine-readable description of all of them lives at /openapi.json.

MethodEndpointPriceNotes
GET/api/mpp/balance/:addressFreeMachine-readable balance lookup for agent clients.
GET/api/mpp/resolve/:nameFreeMachine-readable .pay resolution.
GET/api/mpp/history/:addressFreeMachine-readable history lookup.
POST/api/mpp/send0.01 pathUSDPaid direct send execution.
POST/api/mpp/stream0.02 pathUSDIntent handoff: returns a deep link a human completes in the app. No channel is opened and no funds stream server-side.
POST/api/mpp/scheduled0.02 pathUSDIntent handoff: returns a deep link a human completes in the app. The payment is scheduled in the app, not by this endpoint.

Step 1 — get the challenge (runnable, no credentials needed)

curl -i -X POST https://fluxuspay.app/api/mpp/send \
  -H 'content-type: application/json' \
  -d '{"to":"0x000000000000000000000000000000000000aBcd","amount":"1.50","token":"pathUSD"}'

The server answers 402 Payment Required with the challenge in the WWW-Authenticate: Payment ... header and Cache-Control: no-store. The body describes what to pay:

HTTP/1.1 402 Payment Required
www-authenticate: Payment <challenge>
cache-control: no-store

{ "amount": "0.01", "currency": "pathUSD", "recipient": "0x..." }

Step 2 — pay and retry

A Credential must be signed by a Tempo account, so plain curl cannot produce one. Any MPP client can: the payment-aware fetch below settles the charge in pathUSD and replays the request with Authorization: Payment <credential>.

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

const mppx = Mppx.create({
  methods: [tempo({ account: privateKeyToAccount(process.env.AGENT_PRIVATE_KEY) })],
});

// mppx.fetch handles the 402 round-trip: challenge -> credential -> retry
const res = await mppx.fetch("https://fluxuspay.app/api/mpp/send", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ to: "0xRecipient", amount: "1.50", token: "pathUSD" }),
});

console.log(res.status);                              // 200
console.log(res.headers.get("payment-receipt"));      // signed Receipt
console.log(await res.json());                        // { hash, explorerUrl, ... }

On success the response carries a signed Payment-Receipt header and Cache-Control: private. A replayed or tampered Credential is rejected with a fresh 402 rather than a 200.

Bearer alternative — /api/v1/send (fully runnable with curl)

curl -X POST https://fluxuspay.app/api/v1/send \
  -H "authorization: Bearer $FLUXUS_API_KEY" \
  -H 'content-type: application/json' \
  -d '{"to":"0xRecipient","amount":"1.50","token":"pathUSD","memo":"invoice-42"}'

# → {"amount":"1.50","amountUnits":"1500000","explorerUrl":"https://explore.tempo.xyz/tx/0x...",
#    "hash":"0x...","memo":"invoice-42","to":"0xRecipient","token":"pathUSD"}

Environment variables

VariableRequiredNotes
FLUXUS_API_KEYRequired for /api/v1/sendBearer token checked before authenticated send execution.
FLUXUS_SENDER_PRIVATE_KEYRequiredSigning key used by authenticated send and MPP paid routes.
MPP_SECRET_KEYRequired for /api/mpp/*Enables HTTP 402 challenge and receipt handling.
NEXT_PUBLIC_TEMPO_RPC_URLOptionalOverrides the selected Tempo network's default RPC endpoint.

Network info

  • Chain ID: 4217
  • RPC: https://rpc.tempo.xyz
  • Explorer: https://explore.tempo.xyz
  • Settlement token: pathUSD (6 decimals)