Files
aitbc/website/docs/api.html
oib fdc3012780 feat: add skeleton loaders to marketplace and integrate global header across docs
Marketplace:
- Add skeleton loading states for stats grid and GPU offer cards
- Show animated skeleton placeholders during data fetch
- Add skeleton CSS with shimmer animation and dark mode support
- Wrap stats section in #stats-grid container for skeleton injection

Trade Exchange:
- Replace inline header with data-global-header component
- Switch GPU offers to production API (/api/miners/list)
- Add fallback to demo
2026-02-15 20:44:04 +01:00

204 lines
8.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Documentation - AITBC</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="css/docs.css">
</head>
<body>
<div data-global-header></div>
<main>
<div class="container">
<!-- Back Button -->
<a href="../docs/index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-code"></i> API Documentation</h1>
<p>Complete API reference for the AITBC platform. All APIs are RESTful and use JSON for request/response format.</p>
</div>
<!-- API Endpoints -->
<div class="api-grid">
<!-- Client API -->
<div class="api-card">
<h3><i class="fas fa-users"></i> Client API</h3>
<p>Endpoints for job submission, status checking, and receipt retrieval.</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/jobs
</div>
<p>Submit a new AI compute job</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/jobs/{job_id}
</div>
<p>Get job status and results</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/jobs/{job_id}/receipt
</div>
<p>Get computation receipt</p>
</div>
<!-- Miner API -->
<div class="api-card">
<h3><i class="fas fa-hammer"></i> Miner API</h3>
<p>Endpoints for miner registration, job assignment, and result submission.</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/miners/register
</div>
<p>Register as a miner</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/miners/{address}/heartbeat
</div>
<p>Send miner heartbeat</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/jobs/{job_id}/complete
</div>
<p>Submit job results</p>
</div>
<!-- Admin API -->
<div class="api-card">
<h3><i class="fas fa-shield-alt"></i> Admin API</h3>
<p>Administrative endpoints for system management and monitoring.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/miners
</div>
<p>List all registered miners</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/jobs
</div>
<p>List all jobs in system</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/stats
</div>
<p>Get system statistics</p>
</div>
<!-- Marketplace API -->
<div class="api-card">
<h3><i class="fas fa-store"></i> Marketplace API</h3>
<p>Endpoints for the compute marketplace and trading functionality.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/marketplace/offers
</div>
<p>List available compute offers</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/marketplace/offers
</div>
<p>Create a new compute offer</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/marketplace/trades
</div>
<p>Execute a trade</p>
</div>
<!-- Exchange API -->
<div class="api-card">
<h3><i class="fas fa-exchange-alt"></i> Exchange API</h3>
<p>Endpoints for token exchange and trading operations.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/exchange/ticker
</div>
<p>Get current ticker prices</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/exchange/orderbook
</div>
<p>Get order book</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/exchange/orders
</div>
<p>Place a new order</p>
</div>
<!-- Explorer API -->
<div class="api-card">
<h3><i class="fas fa-search"></i> Explorer API</h3>
<p>Endpoints for blockchain exploration and data retrieval.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/blocks
</div>
<p>List recent blocks</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/transactions
</div>
<p>List recent transactions</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/address/{address}
</div>
<p>Get address details</p>
</div>
</div>
<!-- Authentication -->
<section class="content-section">
<h2>Authentication</h2>
<p>All API requests must include an API key in the header:</p>
<pre class="code-inline"><code>X-Api-Key: your_api_key_here</code></pre>
<h3>Getting API Keys</h3>
<ul>
<li>Clients: Register through the web interface or contact support</li>
<li>Miners: Generated upon registration</li>
<li>Admin: Pre-configured secure keys</li>
</ul>
</section>
<!-- Base URL -->
<section class="content-section">
<h2>Base URL</h2>
<p>All API endpoints are relative to the base URL:</p>
<pre class="code-inline"><code>https://aitbc.bubuit.net/api</code></pre>
<p>For development:</p>
<pre class="code-inline"><code>http://localhost:18000</code></pre>
</section>
<!-- WebSocket -->
<section class="content-section">
<h2>WebSocket API</h2>
<p>Real-time updates are available through WebSocket connections:</p>
<pre class="code-inline"><code>ws://aitbc.bubuit.net:18001/ws</code></pre>
<p>Subscribe to events:</p>
<pre class="code-inline"><code>{
"method": "subscribe",
"params": ["job_updates", "miner_heartbeats"]
}</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2026 AITBC. All rights reserved.</p>
</div>
</footer>
<script src="js/theme.js"></script>
<script src="../assets/js/global-header.js"></script>
</body>
</html>