Back to Documentation

# API Documentation

Complete API reference for the AITBC platform. All APIs are RESTful and use JSON for request/response format.

### Client API

Endpoints for job submission, status checking, and receipt retrieval.

POST/v1/jobs

Submit a new AI compute job

GET/v1/jobs/{job_id}

Get job status and results

GET/v1/jobs/{job_id}/receipt

Get computation receipt

### Miner API

Endpoints for miner registration, job assignment, and result submission.

POST/v1/miners/register

Register as a miner

POST/v1/miners/{address}/heartbeat

Send miner heartbeat

POST/v1/jobs/{job_id}/complete

Submit job results

### Admin API

Administrative endpoints for system management and monitoring.

GET/v1/admin/miners

List all registered miners

GET/v1/admin/jobs

List all jobs in system

GET/v1/admin/stats

Get system statistics

### Marketplace API

Endpoints for the compute marketplace and trading functionality.

GET/v1/marketplace/offers

List available compute offers

POST/v1/marketplace/offers

Create a new compute offer

POST/v1/marketplace/trades

Execute a trade

### Exchange API

Endpoints for token exchange and trading operations.

GET/v1/exchange/ticker

Get current ticker prices

GET/v1/exchange/orderbook

Get order book

POST/v1/exchange/orders

Place a new order

### Explorer API

Endpoints for blockchain exploration and data retrieval.

GET/v1/explorer/blocks

List recent blocks

GET/v1/explorer/transactions

List recent transactions

GET/v1/explorer/address/{address}

Get address details

## Authentication

All API requests must include an API key in the header:

    X-Api-Key: your_api_key_here

### Getting API Keys

- Clients: Register through the web interface or contact support
- Miners: Generated upon registration
- Admin: Pre-configured secure keys

## Base URL

All API endpoints are relative to the base URL:

    https://aitbc.bubuit.net/api

For development:

    http://localhost:18000

## WebSocket API

Real-time updates are available through WebSocket connections:

    ws://aitbc.bubuit.net:18001/ws

Subscribe to events:

    {
      "method": "subscribe",
      "params": ["job_updates", "miner_heartbeats"]
    }