API Reference
AxonFlow exposes two main APIs for interacting with the platform.
Services
| Service | Local Port | Description |
|---|---|---|
| Agent | 8081 | Policy enforcement, LLM routing, MCP connectors |
| Orchestrator | 8082 | Multi-agent planning, workflow coordination |
API Documentation
| Reference | Description |
|---|---|
| Agent Endpoints | Policy enforcement and LLM proxy endpoints |
| Orchestrator Endpoints | Multi-agent planning and workflow APIs |
| Error Codes | Standard error codes and troubleshooting |
Authentication
API requests require authentication via client credentials:
# Using headers
X-Client-ID: your-client-id
X-Client-Secret: your-client-secret
# Or using Authorization header
Authorization: Bearer <api-key>
Common Endpoints
Health Checks
# Agent health
curl http://localhost:8081/health
# Orchestrator health
curl http://localhost:8082/health
Policy Pre-Check (Agent)
The primary policy enforcement endpoint:
curl -X POST http://localhost:8081/api/policy/pre-check \
-H "Content-Type: application/json" \
-H "X-Client-Secret: your-secret" \
-d '{
"client_id": "my-app",
"user_token": "user-123",
"query": "What is the weather forecast?",
"context": {
"user_role": "agent",
"department": "support"
}
}'
Dynamic Policies (Orchestrator)
# List policies
curl http://localhost:8082/api/v1/policies \
-H "X-Client-Secret: your-secret"
# Create a policy
curl -X POST http://localhost:8082/api/v1/policies \
-H "Content-Type: application/json" \
-H "X-Client-Secret: your-secret" \
-d '{
"name": "block-pii",
"type": "content",
"priority": 100,
"enabled": true
}'
Response Format
All responses follow a consistent format:
{
"success": true,
"data": { ... },
"metadata": {
"request_id": "req_abc123",
"latency_ms": 4.2
}
}
Error Responses
{
"success": false,
"error": {
"code": "POLICY_VIOLATION",
"message": "Request blocked by policy: pii-detection"
}
}
See Error Codes for the complete list.
Next Steps
- Review Agent Endpoints for policy enforcement
- Review Orchestrator Endpoints for multi-agent workflows
- See Error Codes for troubleshooting