Overview

Complete API documentation for NCN Network v2 services.


Overview

NCN Network exposes multiple API interfaces:

Interface
Protocol
Primary Use

Gateway gRPC

gRPC/Protobuf

Compute nodes, high-performance clients

Gateway HTTP

REST/JSON

Web clients, simple integrations

Gateway WebSocket

WebSocket

Real-time updates

Registry gRPC

gRPC/Protobuf

Gateways, validators


API Documentation

Protocol Buffer message and service definitions:

  • Complete .proto file documentation

  • Message type reference

  • Service definitions

Gateway gRPC service documentation:

  • GatewayClientService - Client-facing RPCs

  • GatewayComputeService - Compute node RPCs

  • Request/Response formats

  • Error handling

P2P Registry gRPC service documentation:

  • P2PRegistryService - All registry RPCs

  • Node management

  • Validation RPCs

  • Subnet management

Gateway HTTP REST API:

  • Inference endpoints

  • Status endpoints

  • Health checks

Gateway WebSocket API:

  • Connection management

  • Event types

  • Subscription patterns

Error code reference:

  • gRPC status codes

  • HTTP status codes

  • Application-specific errors


Quick Reference

Gateway Endpoints

Protocol
Address
Purpose

gRPC

:50051

Compute nodes, gRPC clients

HTTP

:8080

REST API

WebSocket

:9000

Real-time updates

Registry Endpoints

Protocol
Address
Purpose

gRPC

:50050

All registry operations

P2P

:8828

Peer-to-peer networking


Common Patterns

Submit Inference Request (gRPC)

Submit Inference Request (HTTP)

Response:

Subscribe to Updates (WebSocket)


Authentication

Current Status

NCN Network v2 currently uses wallet-based authentication:

  • Clients: Sign requests with wallet

  • Compute Nodes: Authenticate via signature

  • Validators: Sign validations with registered key

Future: API Keys

API key authentication is planned for HTTP endpoints:


Rate Limiting

Current Limits

Endpoint
Limit

HTTP Inference

100 req/min

gRPC Submit

1000 req/min

WebSocket

10 connections/IP

Rate Limit Headers


Versioning

API Version

Current version: v1

Version Header

Deprecation Policy

  • Breaking changes require major version bump

  • Deprecated endpoints marked in headers

  • 6-month deprecation notice


SDK Support

Official SDKs

Language
Status
Repository

Rust

✅ Built-in

test_client

Python

🚧 Planned

-

JavaScript

🚧 Planned

-

Go

🚧 Planned

-

Generate Client Code


Testing APIs

gRPC Testing (grpcurl)

HTTP Testing (curl)

WebSocket Testing (wscat)


Next Steps

Last updated