Claude Multi Agent Api Server
Description
Production-ready FastAPI service for concurrent Claude Agent session management with real-time monitoring, cost tracking, and session resumption via HTTP API.
Installation
claude install-skill https://github.com/is0383kk/claude-multi-agent-api-server README
Claude Multi-Agent API Server
A production-ready FastAPI web service that enables concurrent execution and management of multiple Claude Agent sessions via HTTP API. Features advanced multi-agent session management with independent lifecycle control, real-time monitoring of each agent's progress, cost tracking per session, session resumption capabilities, and comprehensive background task orchestration for scalable AI agent deployment.
■ Available API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Basic API information and available endpoints list |
/execute/ |
POST | Start a new Claude agent session |
/status/{session_id} |
GET | Get session status, message history, and results |
/cancel/{session_id} |
POST | Cancel a running session |
/sessions/ |
GET | Get detailed information of all active sessions |
/sessions/{session_id} |
DELETE | Delete a specific session by ID |
/sessions/cleanup |
DELETE | Clean up old sessions |
■ File Structure
Claude-Multi-Agent-API-Server/
├── main.py # Main FastAPI application file
├── models.py # Pydantic model definitions and validation
├── session_manager.py # Session lifecycle management
├── examples/ # Usage examples and test files
│ ├── client_example.py # Production-ready Python client implementation example
│ └── index.html # Interactive web test interface
└── requirements.txt # Python dependency definitions
1. API Endpoints
■ Agent Execution (`POST /execute/`)
Execute agents using Claude Agent SDK.
**Request Body Example:**
{
"prompt": "Please explain Claude Agent SDK in detail",
"system_prompt": "You are an excellent system engineer",
"permission_mode": "acceptEdits",
"model": "sonnet",
"cwd": "/path/to/working/directory",
"allowed_tools": ["Read", "Write", "Bash"]
}
**Response Example:**
{
"session_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"message": "Session 123e4567-e89b-12d3-a456-426614174000 started successfully"
}
■ Status Check (`GET /status/{session_id}`)
Get the status of a running agent.
**Response Example:**
{
"session_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "running",
"messages": [
{
"type": "UserMessage",
"content": "...",
"timestamp": "2024-01-01T12:00:00.000Z"
},
{
"type": "AssistantMessage",
"content": "...",
"timestamp": "2024-01-01T12:00:01.000Z"
}
],
"result": null,
"error": null,
"duration_ms": 1000,
"total_cost_usd": 0.01
}
**Status Values:**
- undefined
Related Agents
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
Development community src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11
Development community Cavecrew Builder
>
Development community Cavecrew Investigator
>
Development community Cavecrew Reviewer
>
Development community Contributing to nanobot
Thank you for being here. nanobot is built with a simple belief: good tools should feel calm, clear, and humane. We care deeply about useful features, but we also believe in achieving more with less:
Development community