Overview
Complete API documentation for NCN Network v2 services.
Overview
NCN Network exposes multiple API interfaces:
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
.protofile documentationMessage type reference
Service definitions
Gateway gRPC service documentation:
GatewayClientService- Client-facing RPCsGatewayComputeService- Compute node RPCsRequest/Response formats
Error handling
P2P Registry gRPC service documentation:
P2PRegistryService- All registry RPCsNode 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
gRPC
:50051
Compute nodes, gRPC clients
HTTP
:8080
REST API
WebSocket
:9000
Real-time updates
Registry Endpoints
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
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
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
Protobuf Definitions - Complete proto documentation
Gateway gRPC API - Gateway RPC reference
HTTP Endpoints - REST API reference
Error Codes - Error handling
Last updated
