- Change file mode from 644 to 755 for all project files - Add chain_id parameter to get_balance RPC endpoint with default "ait-devnet" - Rename Miner.extra_meta_data to extra_metadata for consistency
209 lines
8.7 KiB
HTML
Executable File
209 lines
8.7 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en" data-theme="dark">
|
|
<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="css/docs.css">
|
|
<link rel="stylesheet" href="/assets/css/site-header.css">
|
|
<link rel="preload" href="/assets/css/font-awesome.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="/assets/css/font-awesome.min.css"></noscript>
|
|
<!-- Font Awesome CDN fallback -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" crossorigin="anonymous" media="print" onload="this.media='all'; this.onload=null;">
|
|
</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>© 2026 AITBC. All rights reserved.</p>
|
|
</div>
|
|
</footer>
|
|
<script src="js/theme.js"></script>
|
|
<script src="/assets/js/global-header.js"></script>
|
|
</body>
|
|
</html>
|