Some checks failed
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Production Tests / Production Integration Tests (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
CLI Tests / test-cli (push) Failing after 3s
- Added /v1 prefix to all business logic routers in coordinator-api (analytics, portfolio, reputation, rewards, staking) - Updated agent-coordinator to include /v1 prefix for all routers - Changed agent-management API prefix from /api/v1 to /v1 - Updated api-gateway service prefixes to include /v1 for all proxied services - Fixed coordinator-api routers to use correct service imports (AgentServiceMarketplace instead
AITBC API Gateway
Routes requests to AITBC microservices.
Service Registry
The gateway routes requests to the following services:
- GPU Service (port 8101):
/gpu/*→ GPU resource management - Marketplace Service (port 8102):
/marketplace/*→ GPU marketplace - Agent Service (port 8103):
/agent/*→ Agent operations - Trading Service (port 8104):
/trading/*→ Trading operations - Governance Service (port 8105):
/governance/*→ Governance operations - Coordinator API (port 8000):
/coordinator/*→ Coordinator API (default)
Installation
cd /opt/aitbc
poetry install --with api-gateway
Running
# Development
python -m api_gateway.main
# Production (systemd)
sudo systemctl start api-gateway
sudo systemctl enable api-gateway
Testing
Prerequisites
- All microservices installed via Poetry
- At least one microservice running (e.g., GPU service)
- Microservice database created (if testing that service)
Start Gateway (Development)
python -m api_gateway.main
Health Check
curl http://localhost:8080/health
Expected response:
{"status": "healthy", "service": "api-gateway"}
Service Registry
curl http://localhost:8080/services
Expected response:
{
"services": [
{
"name": "gpu",
"url": "http://localhost:8101",
"health_check": "/health",
"routes": ["/gpu/*"]
},
{
"name": "marketplace",
"url": "http://localhost:8102",
"health_check": "/health",
"routes": ["/marketplace/*"]
},
{
"name": "trading",
"url": "http://localhost:8104",
"health_check": "/health",
"routes": ["/trading/*"]
},
{
"name": "governance",
"url": "http://localhost:8105",
"health_check": "/health",
"routes": ["/governance/*"]
}
]
}
Test Routing to GPU Service
-
Start GPU service in another terminal:
python -m gpu_service.main -
Test through gateway:
curl http://localhost:8080/gpu/health
Expected response:
{"status": "healthy", "service": "gpu-service"}
Test Routing to Marketplace Service
-
Start Marketplace service in another terminal:
python -m marketplace_service.main -
Test through gateway:
curl http://localhost:8080/marketplace/health
Expected response:
{"status": "healthy", "service": "marketplace-service"}
Test Routing to Trading Service
-
Start Trading service in another terminal:
python -m trading_service.main -
Test through gateway:
curl http://localhost:8080/trading/health
Expected response:
{"status": "healthy", "service": "trading-service"}
Test Routing to Governance Service
-
Start Governance service in another terminal:
python -m governance_service.main -
Test through gateway:
curl http://localhost:8080/governance/health
Expected response:
{"status": "healthy", "service": "governance-service"}
For comprehensive testing procedures, see MICROSERVICES_TESTING_GUIDE.md.
Endpoints
GET /health- Health checkGET /services- List registered services/*- Proxy all other requests to appropriate microservice
Configuration
Service URLs are configured in main.py under the SERVICES dictionary.