Skip to main content

x402 Payment Protocol

Syra API uses the x402 payment protocol for authentication and payment. Instead of traditional API keys, you pay for each request using USDC on Solana.

How It Works

  1. Payment Required: Each API endpoint requires payment in USDC
  2. Automatic Settlement: Payments are settled automatically on-chain
  3. No API Keys: No need to manage API keys or subscriptions
  4. Pay-per-use: Only pay for the requests you make

Payment Headers

When making requests, include the x402 payment headers:

Request Headers

Payment-Required: x402-v2
Content-Type: application/json

Response Headers

Successful responses include:
Payment-Response: {settlement_details}

Using with Agent Wallet

The Syra platform provides agent wallets for seamless integration:
const response = await fetch('https://api.syraa.fun/news', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});

const data = await response.json();

Pricing

Each endpoint has a specific cost in USD, settled in USDC:
  • News, Events, Sentiment: $0.01 USD per request
  • Trading Signals: $0.01 USD per request
  • Nansen Data: $0.05 USD per request
  • Analytics Summary: $0.02 USD per request
  • DexScreener: $0.02 USD per request
See individual endpoint documentation for specific pricing.

Payment Settlement

Payments are settled using:
  • Currency: USDC (SPL token on Solana)
  • Network: Solana mainnet
  • Settlement: Automatic on successful response
  • Fallback: Facilitator failures are handled gracefully

Error Handling

Insufficient Balance

If your wallet has insufficient USDC:
{
  "success": false,
  "insufficientBalance": true,
  "usdcBalance": 0.005,
  "requiredUsdc": 0.01,
  "message": "Your agent wallet balance ($0.005 USDC) is lower than required $0.01"
}

Payment Failure

If payment settlement fails:
{
  "error": "Settlement failed",
  "message": "Unable to process payment"
}

Development Mode

In development (non-production), /dev endpoints are available without payment:
curl https://api.syraa.fun/news/dev?ticker=BTC
These endpoints are disabled in production.

Security

  • All payments are non-custodial
  • Agent wallets are controlled by users
  • Payments settle directly on-chain
  • No credit card or personal information required

Next Steps

x402 Protocol

Deep dive into x402 payment system

News API

Try your first paid API call

Build docs developers (and LLMs) love