REST API endpoints for submitting jobs, checking nodes, and reading network state.
Base URL
All API requests are made to the CompressNode backend. In production, the base URL is https://compressnode.io/api. All endpoints return JSON responses with an { ok, data, error } wrapper.
POST /api/jobs/submit
Submit an inference job. Request body: { modelId: string, input: string, requesterAddress: string }. Returns the assigned node address, estimated cost in ETH (wei and formatted), and on-chain instructions for calling JobRegistry.submitJob().
GET /api/jobs/submit
Returns the full model pricing table. Lists all 13 supported models with their tier requirements and ETH costs per request. Use this to display pricing to users before job submission.
GET /api/nodes/[address]
Fetch detailed info for a specific node by its Ethereum address. Returns both on-chain data (reputation, jobs completed, total earned, GPU tier) and off-chain data (last heartbeat timestamp, online status).
POST /api/nodes/heartbeat
Called by the node daemon every 30 seconds. Request body: { address, endpoint, gpuTier, timestamp, loadedModels, signature }. Confirms the node is online and reports its current state.
Explorer Endpoints
Two endpoints power the network explorer page:
- GET /api/explorer/stats - returns totalNodes, activeJobs, and network summary
- GET /api/explorer/feed - returns recent network events (job submissions, completions, node registrations)