API Reference

Base URL

https://api.aibotiyi.com/api/v2

Rate Limits

Free: 100 req/hour
Pro: 1,000 req/hour
Enterprise: 10,000 req/hour

API Documentation

Welcome to the AIBOT IYI Protocol API. Build powerful AI trading applications with our distributed GPU network.

99.97% Uptime

Production-grade reliability

<50ms Latency

Ultra-low latency network

11 Datacenters

Global infrastructure

Authentication

All API requests require authentication using API keys. Include your API key in the Authorization header.

API Key Authentication

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Get API Key

POST /auth/api-key

Refresh Token

PUT /auth/refresh

GPU Network Management

Network Status

GET /network/status
{
  "status": "operational",
  "total_gpus": 2847,
  "active_gpus": 2734,
  "global_hashrate": "1.2 PH/s",
  "network_uptime": "99.97%",
  "datacenters": [
    {
      "location": "US-East",
      "status": "optimal",
      "gpu_count": 389,
      "latency_ms": 12
    }
  ]
}

GPU Allocation

POST /network/allocate

Request

{
  "gpu_count": 50,
  "duration_hours": 24,
  "algorithm_type": "trading",
  "priority": "high",
  "datacenter": "US-East"
}

Response

{
  "allocation_id": "alloc_abc123",
  "allocated_gpus": 50,
  "estimated_cost": "$125.00",
  "expires_at": "2024-12-10T14:30:00Z"
}

Trading Algorithms

Deploy Algorithm

POST /algorithms/deploy
{
  "name": "LSTM Trading Bot v2.1",
  "algorithm_type": "neural_network",
  "market_pairs": ["BTC/USDT", "ETH/USDT"],
  "risk_level": "moderate",
  "max_position_size": 0.05,
  "stop_loss": 0.02,
  "take_profit": 0.03,
  "model_file": "base64_encoded_model",
  "gpu_requirements": {
    "min_vram": "8GB",
    "preferred_gpu": "RTX4090"
  }
}

Algorithm Performance

GET /algorithms/{algorithm_id}/performance
{
  "algorithm_id": "algo_xyz789",
  "performance": {
    "total_return": 0.1247,
    "sharpe_ratio": 2.34,
    "max_drawdown": 0.0856,
    "win_rate": 0.68,
    "avg_trade_duration": "2h 34m",
    "total_trades": 1247
  },
  "recent_signals": [
    {
      "timestamp": "2024-12-09T14:25:00Z",
      "action": "BUY",
      "pair": "BTC/USDT",
      "confidence": 0.87,
      "price": 42150.50
    }
  ]
}

Market Data

Real-time Prices

GET /market/prices
Parameters: symbols, exchange, depth
{
  "timestamp": "2024-12-09T14:30:15.123Z",
  "data": [
    {
      "symbol": "BTC/USDT",
      "price": 42150.50,
      "change_24h": 0.0234,
      "volume_24h": 1247389.45,
      "bid": 42148.20,
      "ask": 42152.80,
      "exchange": "binance"
    }
  ]
}

Historical Data

GET /market/history
Parameters: symbol, interval (1m,5m,1h,1d), start_time, end_time, limit

Analytics & Insights

Portfolio Analytics

GET /analytics/portfolio
{
  "portfolio_value": 125000.00,
  "total_pnl": 12750.45,
  "daily_pnl": 847.32,
  "risk_metrics": {
    "var_95": 2850.00,
    "beta": 1.23,
    "correlation_btc": 0.67
  },
  "asset_allocation": [
    {"asset": "BTC", "percentage": 45.2, "value": 56500.00},
    {"asset": "ETH", "percentage": 32.1, "value": 40125.00}
  ]
}

Risk Management

Risk Assessment

POST /risk/assess
{
  "portfolio": {
    "positions": [
      {"symbol": "BTC/USDT", "size": 1.5, "entry_price": 41000},
      {"symbol": "ETH/USDT", "size": 25.0, "entry_price": 2450}
    ]
  },
  "risk_parameters": {
    "max_portfolio_risk": 0.05,
    "correlation_threshold": 0.8,
    "var_confidence": 0.95
  }
}

AI Model Training

Start Training Job

POST /ml/train
{
  "model_type": "transformer",
  "dataset": "crypto_price_prediction_v3",
  "hyperparameters": {
    "learning_rate": 0.001,
    "batch_size": 64,
    "epochs": 100,
    "hidden_layers": 256
  },
  "gpu_allocation": {
    "gpu_count": 8,
    "gpu_type": "A100",
    "max_training_time": "24h"
  }
}

Training Status

GET /ml/training/{job_id}/status
{
  "job_id": "train_abc123",
  "status": "running",
  "progress": 0.65,
  "current_epoch": 65,
  "total_epochs": 100,
  "metrics": {
    "loss": 0.0234,
    "accuracy": 0.8947,
    "val_loss": 0.0287
  },
  "estimated_completion": "2024-12-09T18:45:00Z",
  "gpu_utilization": 0.94
}

Webhooks

Configure Webhook

POST /webhooks
{
  "url": "https://your-app.com/webhook",
  "events": [
    "algorithm.signal_generated",
    "training.job_completed",
    "risk.threshold_exceeded",
    "market.significant_move"
  ],
  "secret": "webhook_secret_key",
  "active": true
}

Webhook Events

  • algorithm.signal_generated - New trading signal
  • training.job_completed - Model training finished
  • risk.threshold_exceeded - Risk limit breach
  • market.significant_move - Major price movement
  • network.status_change - Infrastructure status update

Error Codes

Client Errors (4xx)

400 Bad Request
401 Unauthorized
403 Forbidden
429 Rate Limited

Server Errors (5xx)

500 Internal Server Error
503 Service Unavailable
504 Gateway Timeout

Support & Resources

Developer Support

💬 Discord: AIBOT IYI Developers
📖 GitHub: Sample Code & SDKs
⏰ Response Time: Within 4 hours

Additional Resources

🐍 Python SDK: pip install aibot-iyi
📜 JavaScript SDK: npm install @aibot/iyi-sdk
🔧 Postman Collection: Download
📊 Status Page: status.aibotiyi.com