API Reference
Base URL
Section titled “Base URL”- Local HTTP:
http://<host>:8092/v1 - P2P HTTP: exposed via LibP2P; use the
p2pandserviceendpoints below to reach peers and services.
Health
Section titled “Health”GET /v1/healthReturns:
{ "status": "ok" }Distributed Node Table (DNT)
Section titled “Distributed Node Table (DNT)”GET /v1/dnt/table # Full node table (CRDT view)GET /v1/dnt/peers # Currently connected peersGET /v1/dnt/peers_status # All known peers with connectednessGET /v1/dnt/bootstraps # Discoverable bootstrap multiaddrsPOST /v1/dnt/_node # Update local node entryDELETE /v1/dnt/_node # Remove local node entryNotes:
bootstrapsreturns multiaddr strings like/ip4/<ip>/tcp/43905/p2p/<peerId>for reachable bootstrap nodes.
P2P forward
Section titled “P2P forward”Forward an HTTP request directly to a specific peer over LibP2P:
GET|POST|PATCH /v1/p2p/:peerId/*pathExample:
curl -sS http://localhost:8092/v1/p2p/<PEER_ID>/v1/healthLocal service forward
Section titled “Local service forward”Forward to a local service by name (registered on this node):
GET|POST|PATCH /v1/_service/:service/*pathExample:
curl -sS http://localhost:8092/v1/_service/llm/v1/modelsGlobal service forward (load balanced)
Section titled “Global service forward (load balanced)”Forward to a provider in the network that offers the named service. Selection uses identity groups (e.g., model) parsed from the JSON body.
GET|POST|PATCH /v1/service/:service/*pathExample (OpenAI-compatible chat):
curl -sS -X POST \ http://localhost:8092/v1/service/llm/v1/chat/completions \ -H 'Content-Type: application/json' \ -d '{ "model": "gpt2", "messages": [{"role": "user", "content": "Hello"}] }'Behavior:
- The dispatcher collects all providers that registered
service=llmand whose identity groups includemodel=gpt2. - One candidate is selected at random (internal load balancing).
- The request is forwarded over LibP2P HTTP to the chosen peer’s local service endpoint:
/v1/_service/llm/*path.