Skip to main content

API Reference

AxonFlow exposes two main APIs for interacting with the platform.

Services

ServiceLocal PortDescription
Agent8081Policy enforcement, LLM routing, MCP connectors
Orchestrator8082Multi-agent planning, workflow coordination

API Documentation

ReferenceDescription
Agent EndpointsPolicy enforcement and LLM proxy endpoints
Orchestrator EndpointsMulti-agent planning and workflow APIs
Error CodesStandard 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