https://x402.ottoai.services
Network: Base Mainnet
Payment: USDC (via the x402 protocol)
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.Step 2: Client Signs & Pays
The client must now use a wallet to:- Read the payment requirements from the 402 response.
- Construct and sign a valid payment payload (like an EIP-3009 transferWithAuthorization).
Step 3: Retry Request with Payment Header
The client retries the exact same request, but this time includes anX-PAYMENT header containing the signed payment payload.
Step 4: Success (Receives Data)
The server receives the request, verifies the payment payload with a Facilitator (see Understanding the Facilitator), and, if valid, settles the transaction and returns the 200 OK response with the requested data.Understanding the Facilitator
The Facilitator is a critical component of the x402 payment flow. It acts as a trusted intermediary that:- Validates Payment Signatures: Verifies that the payment authorization in the
X-PAYMENTheader is cryptographically valid and signed by the account with sufficient balance. - Prevents Replay Attacks: Ensures each payment signature can only be used once by tracking nonces and timestamps.
- Executes On-Chain Settlement: Submits the validated payment transaction to the blockchain (Base network) to transfer USDC from the buyer to the service provider.
- Provides Instant Confirmation: Returns confirmation to the API server within milliseconds, enabling real-time service delivery.
- 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 likex402-axios to handle this flow automatically.
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. Price: 0.001 USDC Parameters: None Example Request:GET /filtered-news
Get news filtered for a specific crypto topic (e.g., “Airdrops”, “DeFi trends”, “Bitcoin ETF”). Price: 0.001 USDC Parameters:topic(string, required): The topic to filter news for.
GET /top-ten
Receive a quick digest of the 10 most important crypto news headlines, ranked by relevance and potential impact. Price: 0.001 USDC Parameters: None Example Request:GET /twitter-summary
Get curated insights and sentiment analysis from the crypto community on X (Twitter), identifying trending topics and top tweets. Price: 0.001 USDC Parameters: None Example Request:GET /historical-summaries
Access a 30-day historical news archive. This is a premium B2B service for research, backtesting, or populating a knowledge base. Price: 0.001 USDC Parameters: None Example Request:start_time/end_time: The time window coveredgenerated_at: When the summary was createdtop_ten: The 10 most important headlines for that day, ranked by impact
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.001 USDC Parameters:token(string, required): The token symbol (e.g., “SOL”, “ETH”).
GET /token-alpha
Receive a comprehensive, AI-enhanced report that combines all Token Details with filtered news, sentiment signals, and actionable insights. Price: 0.001 USDC Parameters:token(string, required): The token symbol (e.g., “SOL”, “ETH”).
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. Price: 0.001 USDC Parameters: None Example Request:GET /yield-alpha
Discover the best DeFi yield opportunities across blue-chip protocols like AAVE, Morpho, and Pendle, with APY comparisons. Price: 0.001 USDC Parameters: None Example Request:GET /trending-altcoins
Discover the top 3 trending altcoins (Rank 10-500) with a “Why it’s Trending” thesis and key metrics. Price: 0.001 USDC Parameters: None Example Request: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.001 USDC Request Body: (JSON)prompt(string, optional): A question or prompt for the AI.url(string, optional): A URL to summarize or analyze.
prompt, url, or both parameters together.
Example Request (Prompt):
POST /generate-meme
Transforms a detailed text prompt into a high-quality PNG image, perfect for memes and branding, with high-fidelity text rendering. Price: 0.001 USDC Request Body: (JSON)prompt(string, required): A detailed description of the image. Be specific and include text you want rendered.
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 ( 7.50 USDC ) ricing Tiers:| Model | 4s Price | 8s Price | 12s Price |
|---|---|---|---|
| sora-2 | $1.00 | $2.00 | $3.00 |
| sora-2-pro | $2.50 | $5.00 | $7.50 |
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)
- 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 token parameter”
Possible Causes:- Token symbol doesn’t exist or is misspelled
- Using full token name instead of symbol (e.g., “Bitcoin” instead of “BTC”)
- 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:- Check our status page: status.ottoai.services (if available)
- Review the error message: Our error responses include detailed information
- Contact support: Reach out to our developer support team
- Join our TG: Connect with other developers in our community
Additional Resources
- x402 Protocol Specification: https://x402.gitbook.io/x402
- Coinbase x402 Documentation: https://docs.cdp.coinbase.com/x402/welcome
