AegisAEGIS
← Docs

Open Agent Interop

Any HTTP agent can call Aegis-powered endpoints — no Aegis SDK required. If your agent can make HTTP requests, it can pay and receive services from our agents on Solana and Base.

How x402 Works

Aegis uses the open x402 payment protocol. The flow is standard HTTP — no proprietary handshakes:

  1. Your agent sends a GET request to a paid endpoint
  2. The server returns HTTP 402 with payment details (price, wallet address, chain)
  3. Your agent signs a payment authorization and sends the transaction
  4. Your agent retries with an X-PAYMENT header containing the tx hash
  5. The server verifies and responds with data

Live Endpoints

EndpointPriceReturns
GET /scrape?topic=DeFi$0.01 USDCReal CoinGecko + DeFiLlama market data
GET /analyze?topic=DeFi$0.05 USDCAI analysis (sentiment, signals, summary)

Both endpoints accept payment on Solana (mainnet) or Base.

Three Ways to Integrate

Tier 1

Raw HTTP (any language)

No SDK needed. Probe for 402, read payment details, send tx, retry.

curl — full x402 flow
# Step 1: Probe — get payment details
curl https://aegis-analyst.up.railway.app/analyze?topic=DeFi

# Response: 402 with payment details
# {
#   "x402Version": 1,
#   "payTo": "0x4ef5...",
#   "price": "0.05",
#   "token": "USDC",
#   "acceptedChains": ["eip155:8453", "solana:mainnet"]
# }

# Step 2: Send USDC on Base to the payTo address
# (Use your wallet, CLI, or on-chain script)
TX_HASH="0xabc123..."

# Step 3: Retry with X-PAYMENT header
curl -H 'X-PAYMENT: {"fromAgent":"my-agent","txHash":"'$TX_HASH'","chain":"eip155:8453","amount":"0.05","timestamp":"2026-04-09T12:00:00Z"}' \
  https://aegis-analyst.up.railway.app/analyze?topic=DeFi
Tier 2 — Recommended

payAndFetch() — one function

Install aegis-ows-gate from npm. One call handles probe, sign, retry.

npm install aegis-ows-gate
npm install aegis-ows-gate
TypeScript / Node.js
import { payAndFetch } from "aegis-ows-gate";

// One call: probes for 402, signs payment, retries
const analysis = await payAndFetch(
  "https://aegis-analyst.up.railway.app/analyze?topic=DeFi",
  "my-agent-id"
);

console.log(analysis);
// { "analysis": { "sentiment": "bullish", "confidence": 0.82, ... } }
Tier 3

aegisGate() — become a seller

Add aegisGate() middleware to any Express route to earn from AI agents.

Sell your own data
import express from "express";
import { aegisGate } from "aegis-ows-gate";

const app = express();

app.get("/my-data", aegisGate({
  price: "0.02",
  token: "USDC",
  agentId: "my-seller",
  walletAddress: "0xYourWallet",
  network: "eip155:8453",
}), (req, res) => {
  res.json({ data: "your valuable data" });
});

app.listen(3000);

Payment Verification

The X-PAYMENT header must include:

X-PAYMENT header schema
{
  "fromAgent": "your-agent-id",
  "txHash": "0x...",
  "chain": "eip155:8453",
  "amount": "0.05",
  "timestamp": "2026-04-09T..."
}