Files
aitbc/website/docs/api.html
oib 07f3a87328 docs: restructure website, optimize HTML, gitignore private files
Website docs (website/docs/):
- Delete 6 stale -md.html duplicates
- Rename docs-clients/miners/developers → clients/miners/developers.html
- Unify header/nav across all 15 pages (new .site-header pattern)
- Fix 34 dead href=# links with real targets
- Upgrade Font Awesome v4→v6 in index.html
- Replace search stub with live client-side search (15-page index)
- Extract all inline CSS into shared docs.css (+630 lines)
- Extract inline theme JS into shared theme.js
- Strip inline style= attributes from 10+ pages
- Add .announce-banner, .source-links, .search-results CSS classes
- Add Markdown Source links to clients/miners/developers pages
- Update components.html title to Architecture & Components
- Move browser-wallet.html to website/wallet/, leave redirect
- Update all dates to February 2026

Website root:
- Delete 6 root-level duplicate HTML files (160KB saved)
- Rewire index.html and 404.html links

Root README.md:
- Fix 8 broken doc links to new numbered folder structure
- Update copyright to 2026

.gitignore + .example files:
- Gitignore private files: .aitbc.yaml, .env, deploy scripts,
  GPU scripts, service scripts, infra configs, .windsurf/, website README
- Create 7 .example files for GitHub users with sanitized templates
- Untrack 47 previously committed private files

Live server:
- Push all website files to aitbc-cascade:/var/www/html/
- Clean stale admin.html and index.nginx-debian.html
2026-02-13 23:18:52 +01:00

220 lines
8.9 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>
<!-- Header -->
<header class="site-header">
<div class="container">
<div class="header-inner">
<a href="/" class="brand">
<i class="fas fa-cube"></i>
<span>AITBC</span>
</a>
<nav class="header-nav">
<a href="/">Home</a>
<a href="/explorer/">Explorer</a>
<a href="/Exchange/">Exchange</a>
<a href="/docs/index.html" class="active">Docs</a>
<button id="theme-toggle" class="theme-toggle" title="Toggle theme"><i class="fas fa-sun"></i></button>
</nav>
</div>
</div>
</header>
<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>
</body>
</html>