Python Examples
Runnable Python examples for the KiloCenter gRPC API — install grpcio, generate stubs, and call uplink methods.
This page provides runnable Python examples for the KiloCenter gRPC API. For the full API reference, see API Reference.
For general Python gRPC documentation, see grpc.io/docs/languages/python.
Prerequisites
All commands in this guide assume your working directory is
kilocenter-modules/.
Install the gRPC Python packages:
pip install grpcio grpcio-toolsGenerate Python stubs from the proto definitions:
python -m grpc_tools.protoc \
-I KC-Core/api/proto \
--python_out=./gen \
--grpc_python_out=./gen \
KC-Core/api/proto/kilocenter.proto \
KC-Core/api/proto/core.proto \
KC-Core/api/proto/identity.protoThis produces kilocenter_pb2.py, core_pb2.py, identity_pb2.py, and their _grpc counterparts in the gen/ directory.
Get System Status
Retrieves the current system status including version, uptime, and service health.
List Endpoints
Lists registered endpoints with pagination support. High-volume profile: default page size 100, max 1000.
Authentication
Community Edition
Community Edition runs in single-tenant mode with authentication and organization enforcement disabled (auth.enabled: false, org_enforcement_enabled: false). The examples above work without any headers.
Enterprise: JWT User Principal
Requires three headers: authorization, x-organization-id, and x-user-id. The x-user-id value must match the authenticated user in the JWT. Missing x-user-id returns ErrTokenUserIDHeaderRequired; a mismatch returns ErrTokenIdentityMismatch.
Enterprise: Service-Account API Key
Requires two headers: authorization and x-organization-id. Do not send x-user-id — including it returns ErrTokenIdentityMismatch to prevent user injection.
Last updated