Skip to main content
Welcome to the technical documentation for the Otto AI Agent Swarm on x402. While our main Agent Swarm overview explains what our agents do, this page provides the specific endpoint details, request parameters, and examples needed for programmatic, agent-to-agent (A2A) integration. All endpoints are accessible via the x402 protocol, allowing any developer or AI agent to pay for and consume our services in real-time. Base URL: https://x402.ottoai.services Network: Base Mainnet Payment: USDC (via the x402 protocol)

Pricing Overview

EndpointPrice (USDC)Description
/crypto-news$0.10Real-time crypto market news with sentiment
/filtered-news$0.10AI-filtered news for specific topics
/twitter-summary$0.01Curated Twitter/X crypto digest
/token-details$0.10Token price, market cap, volume, metrics
/token-alpha$0.15Premium token intelligence with derivatives data
/kol-sentiment$0.10Top 50 KOL sentiment analysis
/yield-alpha$0.10DeFi yield opportunities
/trending-altcoins$0.10Top 3 trending altcoins
/mega-report$0.25Comprehensive daily market briefing
/generate-meme$0.25AI image generation
/llm-research$0.50AI research assistant
/video-gen1.001.00 - 7.50Video generation (dynamic pricing)

How to Make a Request (x402 Flow)

Consuming an x402-powered API is a multi-step process. The client (buyer) first makes a request, receives a payment requirement, pays, and then retries the request with proof of payment.

Step 1: Initial Request (Fails with 402)

First, the client makes a standard HTTP request to the desired endpoint. The server will reject this request with an HTTP 402 Payment Required status code. The response body contains the payment details.
# Example: Requesting crypto news
curl -i "https://x402.ottoai.services/crypto-news"

# Server Responds:
HTTP/1.1 402 Payment Required
Content-Type: application/json
...

{
  "error": "Payment required",
  "accepts": [
    {
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // Base USDC
      "maxAmountRequired": "100000", // 0.10 USDC (6 decimals)
      "network": "base",
      "payTo": "0xYourPaymentAddress",
      "scheme": "exact"
    }
  ]
}

Step 2: Client Signs & Pays

The client must now use a wallet to:
  1. Read the payment requirements from the 402 response.
  2. Construct and sign a valid payment payload (like an EIP-3009 transferWithAuthorization).
This is typically handled by an x402-compatible client library.

Step 3: Retry Request with Payment Header

The client retries the exact same request, but this time includes an X-PAYMENT header containing the signed payment payload.
# Example: Retrying the request with payment
curl "https://x402.ottoai.services/crypto-news" \
     -H "X-PAYMENT: 0x..." # The signed payment payload

Step 4: Success (Receives Data)

The server receives the request, verifies the payment payload with a Facilitator, and, if valid, settles the transaction and returns the 200 OK response with the requested data.
# Server Responds:
HTTP/1.1 200 OK
Content-Type: application/json
...

{
  "status": "success",
  "report": "Your Crypto News Brief..."
}

Understanding the Facilitator

The Facilitator is a critical component of the x402 payment flow. It acts as a trusted intermediary that:
  1. Validates Payment Signatures: Verifies that the payment authorization in the X-PAYMENT header is cryptographically valid and signed by the account with sufficient balance.
  2. Prevents Replay Attacks: Ensures each payment signature can only be used once by tracking nonces and timestamps.
  3. Executes On-Chain Settlement: Submits the validated payment transaction to the blockchain (Base network) to transfer USDC from the buyer to the service provider.
  4. Provides Instant Confirmation: Returns confirmation to the API server within milliseconds, enabling real-time service delivery.
Key Points:
  • The Facilitator is a separate service operated by the x402 protocol infrastructure
  • All payment validations happen off-chain for speed, but settlements are on-chain for security
  • Payment signatures typically expire after a short window (e.g., 60 seconds) to prevent stale transactions
  • Each payment includes a unique nonce to prevent replay attacks

Client-Side Example (Node.js / Axios)

For programmatic access, we recommend using a client library like x402-axios to handle this flow automatically.
import { withPaymentInterceptor } from 'x402-axios';
import axios from 'axios';
import { privateKeyToAccount } from 'viem/accounts';

// SECURITY WARNING: Never hardcode private keys in your source code!
// Always use environment variables or secure key management systems.
const account = privateKeyToAccount(process.env.PRIVATE_KEY);

// Create an axios client for the Otto API
const client = withPaymentInterceptor(
  axios.create({ baseURL: 'https://x402.ottoai.services' }),
  account
);

// Make the request with error handling
try {
  const response = await client.get('/crypto-news');
  console.log('Response data:', response.data);
} catch (error) {
  if (error.response?.status === 402) {
    // Payment flow failed - check balance or payment authorization
    console.error('Payment failed:', error.response.data);
    console.error('Required amount:', error.response.data.accepts[0].maxAmountRequired);
  } else if (error.response?.status === 400) {
    // Invalid request parameters
    console.error('Invalid request:', error.response.data);
  } else if (error.response?.status === 500) {
    // Server error
    console.error('Server error. Please try again later.');
  } else if (error.code === 'ECONNREFUSED' || error.code === 'ETIMEDOUT') {
    // Network error
    console.error('Network error. Check your connection.');
  } else {
    // Unknown error
    console.error('Unexpected error:', error.message);
  }
}

API Endpoint Reference

News & Social

AI-curated crypto market news, headlines, and social sentiment.

GET /crypto-news

Fetches a comprehensive, AI-curated summary of the latest market news, including top stories, regulatory updates, and DeFi trends. Now includes top headlines (previously separate endpoint). Price: $0.10 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/crypto-news" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "report": "Your Crypto News Brief\n\nOverview: Cryptocurrency markets experienced increased activity today, driven by easing macroeconomic conditions, regulatory developments, and notable shifts in market structure and technology.\n\nMarket Sentiment:\nOverall Bull/Bear Score: 78\n\nKey Developments:\n* Crypto M&A activity reached a record $10 billion in Q3 2025, fueled by easing macroeconomic conditions boosting demand for both Bitcoin and gold as alternative assets.\n* News regarding a potential end to the US-China trade war has influenced global market sentiment, contributing to a crypto market rally.\n* Speculation around a potential pardon by Trump has spurred plans for Binance to re-enter the U.S. market, potentially reshaping the competitive landscape.\n* Hong Kong approved Asia's first Solana ETF, signaling growing institutional acceptance, while Russia and Kyrgyzstan are integrating crypto into their national financial systems.\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /filtered-news

Get news filtered for a specific crypto topic (e.g., “Airdrops”, “DeFi trends”, “Bitcoin ETF”). Price: $0.10 USDC Parameters:
  • topic (string, required): The topic to filter news for.
Example Request:
curl "https://x402.ottoai.services/filtered-news?topic=AI%20Agents" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "report": "FILTERED CRYPTO NEWS: AI AGENTS\nConfidence Score: High\nSources: Twitter (Yes), News (Yes), Historical (Yes)\nGenerated: Oct 26, 06:14 PM\n\nFellow traders and DeFi users, the 'AI Agents' narrative is undeniably heating up, and we're seeing tangible signs of capital flowing into this nascent but rapidly evolving sector.\n\n**Coinbase x402 transactions are up a staggering 10,000% as AI agents go live.** This explosion in transaction volume for a micro-transaction layer token directly linked to AI agent operations indicates real-world utility and increasing adoption on the blockchain.\n\n[Powered by $OTTO AI | @OttoWallet]",
  "topic": "AI Agents",
  "source_count": 15
}

GET /twitter-summary

Get curated insights and sentiment analysis from the crypto community on X (Twitter), identifying trending topics and top tweets. Price: $0.01 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/twitter-summary" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "digest": "CRYPTO TWITTER DIGEST - Oct 26, 06:16 PM\n\nCRITICAL ALERTS\nVitalik warns off-chain security not guaranteed even with blockchain's 51% attack protection.\n\nDEFI ECOSYSTEM\nAdvisor adds $10K of $VALOR to Meteora liquidity pool.\n\nOTHER NEWS\nSmart trader with 100% win rate increases $BTC and $ETH long positions.\nBinance paid $450k for lobbying the White House in September.\nKraken's Q3 revenue hits all-time high, driven by 2025 acquisitions and IPO prep.\nWhale accumulated 3,195 $BTC in 3 hours.\n\n[Powered by $OTTO AI | @OttoWallet]",
  "timestamp": "2025-10-26T18:16:19.356Z"
}

Market Intelligence

Access real-time token metrics, market analysis, and sentiment.

GET /token-details

Get a snapshot of a token’s core metrics, performance, and trading data. Price: $0.10 USDC Parameters:
  • symbol (string, required): The token symbol (e.g., “SOL”, “ETH”, “BTC”).
Example Request:
curl "https://x402.ottoai.services/token-details?symbol=SOL" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "details": "=== TOKEN DATA INTELLIGENCE: SOL ===\nGenerated: Sat, 26 Oct 2025 18:00:00 GMT\n\nToken Overview\n- Name: Solana (SOL)\n- Rank: #5\n- Price: $145.20\n- Market Cap: $65.00B\n- FDV: $82.15B\n\nPrice Performance\n- 1h: 0.50%\n- 24h: 2.10%\n- 7d: -3.40%\n- 30d: 12.50%\n\nVolume Review\n- Volume (24h): $1.20B\n- Volume/MCap Ratio: 1.85%\n- Liquidity Score: Excellent\n\nMomentum Signal\n- Momentum: Building Momentum (DYOR)\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /token-alpha

Receive a comprehensive, AI-enhanced report that combines all Token Details with filtered news, Twitter sentiment, Coinglass derivatives data, and actionable insights. Price: $0.15 USDC Parameters:
  • symbol (string, required): The token symbol (e.g., “SOL”, “ETH”, “BTC”).
Example Request:
curl "https://x402.ottoai.services/token-alpha?symbol=ETH" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "alpha_report": "=== OTTO TOKEN ALPHA: ETH ===\nGenerated: Sat, 26 Oct 2025 18:00:00 GMT\n\nMARKET DATA\n- Price: $2,847.32\n- Market Cap: $342.00B\n- 24h Change: +1.80%\n- 7d Change: +4.20%\n\nDERIVATIVES CONTEXT (Coinglass)\n- Funding Rate: 0.0045%\n- Open Interest: $12.5B\n- Long/Short Ratio: 1.15\n- Fear & Greed: 72 (Greed)\n\nNEWS SENTIMENT\nEthereum's 'supercycle' thesis is gaining traction, with projections of ETH reaching $21,000 anchored in institutional RWA tokenization...\n\nTWITTER PULSE\nKOLs are predominantly bullish on ETH, citing institutional adoption and L2 scaling success...\n\nALPHA SIGNAL: BULLISH\nConfidence: 78%\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /kol-sentiment

Analyzes tweets from the top 50 crypto Key Opinion Leaders (KOLs) to provide a market sentiment score, key narratives, and trending tokens. Includes broader Twitter pulse. Price: $0.10 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/kol-sentiment" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "report": "=== OTTO KOL ALPHA ===\nGenerated: 2025-10-26T18:48:48.495Z\n\nOVERALL SENTIMENT\nBULLISH\nScore: 78%\n\nKEY NARRATIVES\n1. The Resurgence of Privacy: Zcash Leads the Charge in a Post-Surveillance World\n2. Base Layering Up: x402 Protocol Catalyzing Mainstream Adoption\n3. Ethereum's Supercycle Thesis: Institutional Tokenization Fuels a $21K Vision\n\nTRENDING TOKENS\n- Hottest Major: BTC\n- Trending Altcoins: ZEC, SEDA, PAYAI, ARB, GRNY, BMNR, IWM\n\nTOP KOL INSIGHTS\n- @fundstrat (1623 engagement)\n  \"Positive development USA - China trade relations\n  - Up for equities $SPY $QQQ $IWM\n  - Up for supercycle Ethereum $ETH\n  - Up for Bitcoin $BTC\"\n\nSUMMARY\nThe crypto market intelligence gathered from recent KOL activity points towards a distinctly bullish sentiment, underscored by a blend of macro catalysts, significant institutional interest, and emerging narratives driving specific altcoin rallies.\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /yield-alpha

Discover the best DeFi yield opportunities across blue-chip protocols like AAVE, Morpho, and Pendle, with APY comparisons. Price: $0.10 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/yield-alpha" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "opportunities": "=== OTTO YIELD ALPHA OPPORTUNITIES ===\nUpdated: October 26, 6:37 PM GMT\n\n=== BLUE-CHIP YIELDS (Low Risk, Best of the Best) ===\nFiltered for highest quality DeFi: High TVL, Pendle Prime, Blue Chip Protocols\n\nBest Stablecoin: Morpho - USDC (Arbitrum)\n   * APY: 10.40%\n   * TVL: $13,528,117\n   * Blue chip crypto + RWA collateral strategy\n   * Market: https://app.morpho.org/arbitrum/vault/0x5c0C306Aaa9F877de636f4d5822cA9F2E81563BA/steakhouse-high-yield-usdc\n\nBest ETH: Morpho - WETH (Ethereum)\n   * APY: 3.81%\n   * TVL: $17,480,478\n   * Morpho vault with $17M TVL\n\nBest BTC: Pendle Prime - eBTC (Ethereum)\n   * APY: 1.78%\n   * TVL: $1,731,713\n   * Pendle Prime PT market (expires Dec 18, 2025)\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /trending-altcoins

Discover the top 3 trending altcoins (Rank 10-500) with a “Why it’s Trending” thesis and key metrics. Price: $0.10 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/trending-altcoins" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "report": "=== OTTO TOP 3 TRENDING ALTCOINS ===\nGenerated: Sun, 26 Oct 2025 18:05:00 GMT\n\n**1. HYPE (Hyperliquid) - CMC Rank #11**\nWHY IT'S TRENDING:\n* A 'digital Nasdaq' disrupting derivatives by listing equity and commodity perps - a true game-changer!\n* A 'Giant Company' is pursuing a monumental $1 Billion acquisition, mirroring MicroStrategy's Bitcoin strategy for altcoins!\n* Explosive rally with a 143.79% surge in 24h volume and 'insane' monthly candles, signaling massive retail and institutional FOMO.\nKEY METRICS: Price: $47.50 | Market Cap: $15.99B | 24h Volume: $635.52M | 24h Change: 13.56%\nBULLISH THESIS: HYPE is a crypto powerhouse at the nexus of institutional validation and a rapidly expanding derivatives market.\n\n**2. ZEC (Zcash) - CMC Rank #24**\nWHY IT'S TRENDING:\n* Leading the charge in the \"Q4: ZEC szn\" narrative, as privacy coins make a dramatic resurgence!\n* Rapidly surging with a 531.85% gain in 30 days and a stunning 26.06% increase today, nearing an all-time high!\nKEY METRICS: Price: $347.89 | Market Cap: $5.66B | 24h Volume: $1.08B | 24h Change: 26.91%\n\n**3. AAVE (Aave) - CMC Rank #32**\nWHY IT'S TRENDING:\n* Aave V4 is set to unify liquidity, positioning the protocol to bring \"the next trillion dollars onchain\"!\n* Commanding leadership in Real-World Assets (RWAs) with over $350 million in net deposits.\nKEY METRICS: Price: $236.60 | Market Cap: $3.61B | 24h Volume: $240.03M | 24h Change: 4.90%\n\n[Powered by $OTTO AI | @OttoWallet]"
}

GET /mega-report

Your comprehensive daily crypto market intelligence briefing. Combines top headlines, Twitter sentiment, KOL alpha, trending altcoins, yield opportunities, AND Coinglass derivatives context (Fear & Greed, ETF flows, funding arbitrage) into one executive summary with a link to a full HTML report. Price: $0.25 USDC Parameters: None Example Request:
curl "https://x402.ottoai.services/mega-report" -H "X-PAYMENT: 0x..."
Sample Response:
{
  "status": "success",
  "summary": "=== OTTO MEGA REPORT ===\nYour Daily Market Intelligence Briefing\n\nMARKET OVERVIEW\nOverall Sentiment: BULLISH (Score: 78%)\nFear & Greed Index: 72 (Greed)\n\nTOP HEADLINES\n- Crypto M&A activity hits record $10B in Q3 2025\n- Hong Kong approves Asia's first Solana ETF\n- JPMorgan now accepting BTC/ETH as loan collateral\n\nTRENDING TOKENS\nHYPE, ZEC, AAVE leading altcoin momentum\n\nTOP YIELD: 10.40% APY on USDC (Morpho)\n\nFull report: See report_url for complete analysis\n\n[Powered by $OTTO AI | @OttoWallet]",
  "report_url": "https://market-alpha-agent.up.railway.app/reports/mega-1730000000000.html"
}

AI Tools Agent

Advanced AI for knowledge, research, and creativity.

POST /llm-research

Get instant, reliable answers to any question, or summarize a webpage/document from a URL. Powered by Google’s Gemini 2.5 Pro with live web search. Price: $0.50 USDC Request Body: (JSON)
  • prompt (string, optional): A question or prompt for the AI (max 180 characters).
  • url (string, optional): A URL to summarize or analyze.
  • confirm_180_char_limit (boolean, required): Confirm you understand the 180 character limit.
Note: You can provide prompt, url, or both parameters together. Example Request (Prompt):
curl -X POST "https://x402.ottoai.services/llm-research" \
     -H "Content-Type: application/json" \
     -H "X-PAYMENT: 0x..." \
     -d '{"prompt": "Explain Base Chain in simple terms.", "confirm_180_char_limit": true}'
Example Request (URL):
curl -X POST "https://x402.ottoai.services/llm-research" \
     -H "Content-Type: application/json" \
     -H "X-PAYMENT: 0x..." \
     -d '{"url": "https://some-crypto-news-site.com/article", "confirm_180_char_limit": true}'
Sample Response:
{
  "status": "success",
  "result": "Base Chain is a Layer 2 (L2) blockchain built on Ethereum, developed by Coinbase. It offers faster and cheaper transactions compared to Ethereum's main network while inheriting Ethereum's security. Base is designed to make decentralized applications more accessible and affordable for everyday users."
}

POST /generate-meme

Transforms a detailed text prompt into a high-quality PNG image, perfect for memes and branding, with high-fidelity text rendering. Powered by Google’s Nano Banana model. Price: $0.25 USDC Request Body: (JSON)
  • prompt (string, required): A detailed description of the image. Be specific and include text you want rendered (100+ characters recommended).
  • does_this_prompt_meet_nano_banana_safety_guidelines (boolean, required): Confirm the prompt meets safety guidelines.
Example Request:
curl -X POST "https://x402.ottoai.services/generate-meme" \
     -H "Content-Type: application/json" \
     -H "X-PAYMENT: 0x..." \
     -d '{"prompt": "A photorealistic image of a golden Bitcoin rocket launching into space with the text TO THE MOON in bold letters at the top", "does_this_prompt_meet_nano_banana_safety_guidelines": true}'
Sample Response:
{
  "status": "success",
  "imageUrl": "https://tools-agent.up.railway.app/images/1761442152697.png",
  "expiresAt": "2025-11-02T18:00:00.000Z"
}

POST /video-gen

Generates high-quality video from text or image using OpenAI’s Sora 2 models. Pricing is dynamic based on the selected model and duration. Price: Dynamic (1.001.00 - 7.50 USDC) Pricing Tiers:
Model4s Price8s Price12s Price
sora-2$1.00$2.00$3.00
sora-2-pro$2.50$5.00$7.50
Request Body: (JSON)
  • prompt (string, required): A detailed description of the video.
  • model (string, required): Model to use: sora-2 (Standard) or sora-2-pro (Pro).
  • seconds (number, required): Duration of the video: 4, 8, or 12.
  • orientation (string, optional): Video aspect ratio: portrait or landscape (default: ‘portrait’).
  • image_url (string, optional): Source image URL for image-to-video generation.
Example Request:
curl -X POST "https://x402.ottoai.services/video-gen" \
     -H "Content-Type: application/json" \
     -H "X-PAYMENT: 0x..." \
     -d '{"prompt": "A futuristic cityscape with flying cars and neon signs", "model": "sora-2", "seconds": 4, "orientation": "landscape"}'
Sample Response:
{
  "status": "success",
  "videoUrl": "https://tools-agent.up.railway.app/videos/1761442152697.mp4",
  "model": "sora-2",
  "duration": 4,
  "price": "$1.00"
}

Deprecated Endpoints

The following endpoints have been removed and are no longer available:
EndpointReasonAlternative
/top-tenAbsorbed into /crypto-newsUse /crypto-news (now includes top headlines)
/historical-summariesLow demand, service discontinuedN/A

Troubleshooting - Common Issues and Solutions

Issue: “Payment verification failed”

Possible Causes:
  • Insufficient USDC balance in your wallet
  • Payment signature has expired (signatures are valid for ~60 seconds)
  • Invalid or corrupted payment signature
  • Payment already used (replay attack prevention)
Solutions:
  • Verify your USDC balance on Base network
  • Ensure your system clock is synchronized (NTP)
  • Regenerate the payment signature and retry immediately
  • Check that you’re not reusing old payment signatures

Issue: “Invalid symbol parameter”

Possible Causes:
  • Token symbol doesn’t exist or is misspelled
  • Using full token name instead of symbol (e.g., “Bitcoin” instead of “BTC”)
Solutions:
  • Use standard token symbols: BTC, ETH, SOL, etc.
  • Ensure the token symbol is uppercase
  • Check CoinMarketCap for the correct symbol

Still Having Issues?

If you’re experiencing problems not covered here:
  1. Review the error message: Our error responses include detailed information
  2. Contact support: Reach out to our developer support team
  3. Join our TG: Connect with other developers in our community

Additional Resources

[Powered by $OTTO AI | @OttoWallet]