http://localhost:3000
Most endpoints require API key authentication:
x-api-key: your-api-key-hereCheck if the API server is running.
GET /healthResponse:
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00Z"
}Get detailed system status and agent information.
GET /system/status
x-api-key: {{api_key}}Response:
{
"status": "operational",
"agents": {
"SoftwareDeveloper": "ready",
"ProjectManager": "ready"
},
"resources": {
"memory_usage": "2.1GB",
"cpu_usage": "15%"
}
}Get all available agents and their capabilities.
GET /agents
x-api-key: {{api_key}}Response:
{
"agents": [
{
"name": "SoftwareDeveloper",
"status": "ready",
"capabilities": ["code_generation", "language_detection", "testing"]
},
{
"name": "ProjectManager",
"status": "ready",
"capabilities": [
"strategic_analysis",
"task_coordination",
"risk_assessment"
]
}
]
}Get detailed status for a specific agent.
GET /agents/{agent_type}
x-api-key: {{api_key}}Parameters:
agent_type- Agent type (e.g., "SoftwareDeveloper", "ProjectManager")
Response:
{
"name": "SoftwareDeveloper",
"status": "ready",
"current_task": null,
"completed_tasks": 42,
"average_response_time": "3.2s"
}Submit a new task for agent processing.
POST /tasks
x-api-key: {{api_key}}
Content-Type: application/json
{
"agent_type": "SoftwareDeveloper",
"content": "Create a hello world function in Rust",
"priority": "Medium",
"context": {
"file_path": "src/main.rs",
"project_type": "rust"
}
}Request Body:
agent_type(required) - Type of agent to handle the taskcontent(required) - Task descriptionpriority(optional) - "Low", "Medium", "High", "Critical"context(optional) - Additional context for the task
Response:
{
"task_id": "task_123456",
"status": "queued",
"agent_type": "SoftwareDeveloper",
"estimated_completion": "2024-01-01T12:05:00Z"
}Check the status of a submitted task.
GET /tasks/{task_id}
x-api-key: {{api_key}}Parameters:
task_id- The task ID returned from submit
Response:
{
"task_id": "task_123456",
"status": "completed",
"agent_type": "SoftwareDeveloper",
"result": {
"code": "fn hello_world() { println!(\"Hello, World!\"); }",
"language": "rust",
"tests_passed": true
},
"started_at": "2024-01-01T12:00:00Z",
"completed_at": "2024-01-01T12:00:05Z"
}Submit a task for analysis without execution.
POST /tasks/analyze
x-api-key: {{api_key}}
Content-Type: application/json
{
"content": "Create a web application with user authentication",
"context": {
"tech_stack": ["rust", "postgresql", "redis"]
}
}Response:
{
"analysis": {
"complexity": "high",
"estimated_effort": "2-3 weeks",
"recommended_agents": [
"SoftwareDeveloper",
"ProjectManager",
"QualityAssurance"
],
"suggested_phases": [
"Database schema design",
"Authentication implementation",
"API development",
"Testing and security review"
]
}
}Cancel a queued or running task.
DELETE /tasks/{task_id}
x-api-key: {{api_key}}Response:
{
"task_id": "task_123456",
"status": "cancelled",
"message": "Task cancelled successfully"
}All endpoints may return error responses:
{
"error": "Invalid request",
"message": "Missing required field: agent_type"
}{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}{
"error": "Not found",
"message": "Task not found: task_123456"
}{
"error": "Rate limit exceeded",
"message": "Please wait 60 seconds before making another request"
}{
"error": "Internal server error",
"message": "An unexpected error occurred"
}- Default limit: 100 requests per minute per API key
- Burst limit: 10 requests per second
- Rate limit headers included in responses:
X-RateLimit-Limit: Maximum requests per minuteX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Unix timestamp when limit resets
The project includes Hurl test files for API testing:
# Install Hurl
cargo install hurl --locked
# Run all API tests
./scripts/test-api-hurl.sh
# Run specific test
hurl --env-file tests/api/hurl.env --test tests/api/health.hurlFuture versions will support WebSocket connections for real-time updates:
const ws = new WebSocket("ws://localhost:3000/ws");
ws.send(
JSON.stringify({
type: "subscribe",
task_id: "task_123456",
})
);use spiral_core_client::Client;
let client = Client::new("http://localhost:3000", "api_key");
let task = client.submit_task(
AgentType::SoftwareDeveloper,
"Create hello world",
Priority::Medium,
).await?;from spiral_core import Client
client = Client(base_url="http://localhost:3000", api_key="api_key")
task = await client.submit_task(
agent_type="SoftwareDeveloper",
content="Create hello world",
priority="Medium"
)The API exposes Prometheus metrics at /metrics:
GET /metricsKey metrics:
spiral_core_requests_total- Total API requestsspiral_core_task_duration_seconds- Task completion timesspiral_core_agent_utilization- Agent utilization percentage