Skip to content

Agent API Reference

Technical reference for AI agents calling monetized APIs programmatically. For a visual walkthrough, see Browse and Use APIs.

Discovery

Find APIs via Discovery Endpoint

Browse all published APIs from the platform's discovery endpoint. Returns a Markdown catalog with slugs, descriptions, and pricing.

bash
curl https://monetize.fluxapay.xyz/api/discover?type=api
markdown
# FluxA Discovery

## API Servers

**Access endpoints:** `curl https://proxy-monetize.fluxapay.xyz/api/{slug}`
**Integration guide:** `curl https://monetize.fluxapay.xyz/browse-servers/{slug}/skills.md`

| Slug | Name | Description | Price | Tags |
|------|------|-------------|-------|------|
| kling-video-generation | Kling Video Generation | AI video generation powered by Kling | $0.50 | video, ai, kling |
| nano-banana-pro-image-generation | Nano Banana Pro Image Generation | High-quality AI image generation | $0.01 | image, ai |
| video-generation-with-veo | Video Generation with Veo | Google Veo video generation | $0.50 | video, ai, veo |
| rapid-bird-api | Rapid Bird API | APIs for searching and viewing on Bird | $0.01-$0.10 | twitter, social |

Query parameters:

ParamDefaultDescription
typeapiFilter by type: api, skill, or comma-separated api,skill
limit50Results per page (max 100)
offset0Pagination offset
tagsComma-separated tag filter

For a specific API's integration guide:

bash
curl https://monetize.fluxapay.xyz/browse-servers/{slug}/skills.md

Discover Endpoints on a Specific API

Once you have a slug, GET the proxy root to see that API's endpoints and pricing. No authentication required.

bash
curl https://proxy-monetize.fluxapay.xyz/api/{slug}
json
{
  "name": "Weather API",
  "description": "Real-time weather data",
  "endpoints": [
    {
      "path": "/forecast",
      "method": "POST",
      "description": "Get weather forecast for a city",
      "price": 0.01,
      "currency": "USDC",
      "enabled": true,
      "inputSchema": { ... }
    }
  ],
  "paymentRequired": true,
  "networks": ["base", "fluxa-monetize-credits"],
  "payTo": "0x1234..."
}

Making Calls

Make a Paid Call

Include X-Agent-ID and X-Payment:

bash
curl -X POST https://proxy-monetize.fluxapay.xyz/api/{slug}/forecast \
  -H "X-Agent-ID: a6aa03b9-7228-47ca-b168-41c7166a9ea9" \
  -H "X-Payment: <x402-payment-token>" \
  -H "Content-Type: application/json" \
  -d '{"city": "San Francisco"}'

The proxy verifies your payment, calls the backend, and settles the payment only after the backend responds. If the backend errors, you're not charged.

Response

The backend's response is returned directly. On successful payment, a settlement header is added:

X-Payment-Settlement: {"success":true,"transaction":"0xabc...","network":"base","payer":"0x..."}

Headers

Required

HeaderDescription
X-Agent-IDYour agent ID (plain string) or JWT (if API requires agent auth). Get it from fluxa-wallet status

Required for Paid Endpoints

HeaderDescription
X-Paymentx402 payment token. Generated by FluxA Agent Wallet or x402-fetch

Optional

HeaderDescription
X-Creator-Uid8-char hex creator ID for revenue attribution. Can also be in URL path: /api/{slug}/{creatorUid}/path
X-Skill-NameSkill name for analytics tracking
X-Task-IdTask ID for execution tracing

Agent Authentication

Some APIs require verified agent identity. If the API has agent auth enabled:

  • Pass your full JWT (not plain agent ID) in X-Agent-ID
  • Get your JWT from fluxa-wallet status or the AGENT_JWT environment variable
  • If your JWT is expired, refresh it with fluxa-wallet refresh
bash
# Plain agent ID (most APIs)
-H "X-Agent-ID: a6aa03b9-7228-47ca-b168-41c7166a9ea9"

# JWT (APIs with agent auth enabled)
-H "X-Agent-ID: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."

If you're unsure, try the plain agent ID. The proxy returns 401 with a clear message if a JWT is required.

Payment

Paid endpoints return 402 Payment Required with x402 payment details when called without payment:

json
{
  "x402Version": 1,
  "error": "X-PAYMENT header is required",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "10000",
      "payTo": "0x...",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "resource": "https://proxy-monetize.fluxapay.xyz/api/{slug}/forecast",
      "description": "API access: /forecast"
    }
  ]
}

Payment amounts are in USDC smallest units (6 decimals). 10000 = $0.01 USDC.

Currently supported networks: Base (on-chain USDC) and FluxA Credits.

Pricing

Each endpoint has its own price set by the seller (minimum $0.01). Prices are shown in the discovery response and on the marketplace page.

Errors

StatusMeaning
400Missing X-Agent-ID header
401Agent auth failed — JWT invalid, expired, or missing
402Payment required or payment settlement failed
404Endpoint not found or not published
502Backend API error — no payment was taken

Released under the MIT License.