API
Server
Documentation · Version 1.0 · Updated November 8, 2025

YunaraX402 Developer Documentation

Integrate the yunarax402 SDK, automate token analysis, and manage compute units through the Yunara platform.

Getting Started

Every Yunara account includes an on-chain wallet and access to the yunarax402 SDK. Follow these steps to begin:

  1. Sign in with Google from the Yunara dashboard.
  2. Activate a subscription plan from Wallet → Subscription to credit Compute Units (CU).
  3. Generate an API key under Wallet → SDK API Keys. Copy and store it securely—the full key is shown once.
  4. Send authenticated requests to https://yunarax402.com/api/sdk/analyze.

All SDK requests consume Compute Units. Each AI token analysis deducts 1 CU from your active plan.

Authentication

Authenticate by sending your API key in the X-API-Key header (preferred) or via bearer token.

curl -X POST https://yunarax402.com/api/sdk/analyze \
  -H "Content-Type: application/json" \
  -H "X-API-Key: x402_XXXXXXXXXXXXXXXX" \
  -d '{ "tokenData": { "name": "Example", "symbol": "EXMPL", "address": "0x...", "chain": "base" } }'

Unauthorized requests return 401 invalid_api_key. If you exceed 60 requests per minute, the API responds with 429 rate_limited.

API Endpoints

EndpointMethodDescription
/api/sdk/analyze POST Generates a full AI analysis for the provided token data. Response includes risk metrics, performance summary, and social insights.
/api/subscriptions/status GET Returns active plan details, remaining CU, renewal date, and recent usage history.
/api/subscriptions/purchase POST Initiates on-chain plan activation using x402 payments. Called automatically from the dashboard.

The tokenData payload accepts any metadata you already possess (symbol, launchpad, liquidity, etc.). Missing fields are auto-filled from Yunara’s data sources when available.

{
  "tokenData": {
    "name": "Example Token",
    "symbol": "EXMPL",
    "address": "0x1234...abcd",
    "chain": "base",
    "marketCap": 1250000,
    "volume24h": 420000,
    "liquidity": 165000
  }
}

SDK Usage

Use the SDK from any environment that can issue HTTPS requests. Examples for Node.js and Python:

Node.js

import fetch from 'node-fetch';

const API_KEY = process.env.yunarax402_API_KEY;
const API_BASE = 'https://yunarax402.com';

export async function analyzeToken(token) {
  const res = await fetch(`${API_BASE}/api/sdk/analyze`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': API_KEY
    },
    body: JSON.stringify({ tokenData: token })
  });

  if (!res.ok) {
    const err = await res.json().catch(() => ({}));
    throw new Error(`Analysis failed (${res.status}): ${err.message || err.error}`);
  }

  return res.json();
}

Python

import requests

API_BASE = "https://yunarax402.com"
API_KEY = "x402_..."

payload = {"tokenData": {"name": "Example", "symbol": "EXMPL", "address": "0x...", "chain": "base"}}
headers = {"Content-Type": "application/json", "X-API-Key": API_KEY}

response = requests.post(f"{API_BASE}/api/sdk/analyze", json=payload, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()

Automation & Webhooks

You can poll /api/sdk/analyze on a schedule or trigger it whenever a new token is detected in your pipeline. Recommended patterns:

  • Cron polling: Run analyses at fixed intervals and store JSON output in your analytics warehouse.
  • Event-driven: Combine with launchpad webhooks to automatically analyze new listings.
  • Discord/Slack alerts: Pipe significant AI insights directly to trading chats.

Webhook delivery of AI analyses is on the roadmap. Contact support to join the beta.

Compute Units

Compute Units (CU) meter usage across the ecosystem:

  • 1 CU deducted per successful AI analysis.
  • Failed or rate-limited calls do not consume CU.
  • Subscription renewals reset balances monthly; unused CU do not roll over.
  • Monitor remaining CU via /api/subscriptions/status or the Wallet dashboard.

Support & Resources

Need help integrating the SDK or interpreting results?

We welcome feature requests and feedback—let us know how to improve your workflows.