Agent402 API
Local Dev: http://localhost:8000
API Prefix: /api/v1
Auth: JWT Bearer (email/password login)
Source: github.com/AINative-Studio/agent402
Agent402 is not yet publicly deployed. Run locally with Docker or connect to the AINative-hosted instance when available.
git clone https://github.com/AINative-Studio/agent402.git
cd agent402 && docker-compose up
# API: http://localhost:8000
# Docs: http://localhost:8000/docs
Agent402 uses email/password JWT (its own user system). AINative API keys are not accepted. Register at POST /api/v1/auth/register, then log in at POST /api/v1/auth/login.
Agent402 (AgentClaw backend) is an autonomous agent orchestration platform. Agents get persistent personalities, pluggable skills, multi-channel comms (Slack, email, Zalo), WireGuard mesh networking, swarm coordination, and x402 HTTP payment rails.
Authentication
Register
POST /api/v1/auth/register
Content-Type: application/json
{
"email": "dev@example.com",
"password": "SecurePass123!",
"name": "Dev User",
"workspace_id": "your-workspace-id"
}
Login
POST /api/v1/auth/login
Content-Type: application/json
{"email": "dev@example.com", "password": "SecurePass123!"}
Returns {"access_token": "...", "refresh_token": "..."}.
Other Auth Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/v1/auth/me | Current user |
POST | /api/v1/auth/refresh | Refresh JWT |
POST | /api/v1/auth/logout | Logout |
POST | /api/v1/auth/change-password | Change password |
Agents
| Method | Path | Description |
|---|---|---|
GET | /api/v1/agents | List agents |
POST | /api/v1/agents | Create agent |
GET | /api/v1/agents/{id} | Get agent |
PUT | /api/v1/agents/{id} | Update agent |
DELETE | /api/v1/agents/{id} | Delete agent |
POST | /api/v1/agents/{id}/provision | Provision agent (allocate resources) |
POST | /api/v1/agents/{id}/message | Send message to agent |
POST | /api/v1/agents/{id}/pause | Pause agent |
POST | /api/v1/agents/{id}/resume | Resume agent |
POST | /api/v1/agents/{id}/heartbeat | Agent heartbeat |
GET | /api/v1/agents/{id}/settings | Get agent settings |
Agent Personality
| Method | Path | Description |
|---|---|---|
GET | /api/v1/agents/{id}/personality | Get personality config |
POST | /api/v1/agents/{id}/personality/initialize | Initialize personality |
GET | /api/v1/agents/{id}/personality/context/system | System context |
GET | /api/v1/agents/{id}/personality/context/task | Task context |
GET | /api/v1/agents/{id}/personality/context/minimal | Minimal context |
Swarms
Multi-agent coordination.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/swarms | List swarms |
POST | /api/v1/swarms | Create swarm |
GET | /api/v1/swarms/{id} | Get swarm |
PATCH | /api/v1/swarms/{id} | Update swarm |
DELETE | /api/v1/swarms/{id} | Delete swarm |
POST | /api/v1/swarms/{id}/agents | Add agents to swarm |
DELETE | /api/v1/swarms/{id}/agents | Remove agents |
POST | /api/v1/swarms/{id}/start | Start swarm |
POST | /api/v1/swarms/{id}/pause | Pause swarm |
POST | /api/v1/swarms/{id}/resume | Resume swarm |
GET | /api/v1/swarm/health | Swarm health |
GET | /api/v1/swarm/timeline | Activity timeline |
GET | /api/v1/swarm/monitoring/status | Monitoring status |
GET | /api/v1/swarm/alerts/thresholds | Alert thresholds |
PUT | /api/v1/swarm/alerts/thresholds | Update thresholds |
Skills
Pluggable capabilities for agents.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/skills | List installed skills |
GET | /api/v1/skills/installable | Available skills |
GET | /api/v1/skills/ready | Ready skills |
GET | /api/v1/skills/missing | Skills with missing dependencies |
GET | /api/v1/skills/{name} | Get skill details |
POST | /api/v1/skills/{name}/install | Install skill |
DELETE | /api/v1/skills/{name}/install | Uninstall skill |
GET | /api/v1/skills/{name}/install-info | Installation requirements |
GET | /api/v1/skills/{name}/installation-status | Installation status |
GET | /api/v1/agents/{id}/skills | Agent skill list |
POST | /api/v1/agents/{id}/skills | Attach skill to agent |
DELETE | /api/v1/agents/{id}/skills/{name} | Detach skill |
POST | /api/v1/agents/{id}/skills/{name}/configure | Configure skill |
Tasks
| Method | Path | Description |
|---|---|---|
GET | /api/v1/tasks | List tasks |
POST | /api/v1/tasks | Create task |
GET | /api/v1/tasks/{id} | Get task |
DELETE | /api/v1/tasks/{id} | Delete task |
GET | /api/v1/tasks/{id}/history | Task history |
GET | /api/v1/tasks/stats | Task statistics |
GET | /api/v1/tasks/queue | Task queue |
GET | /api/v1/tasks/active-leases | Active task leases |
Conversations
| Method | Path | Description |
|---|---|---|
GET | /api/v1/conversations | List conversations |
POST | /api/v1/conversations | Create conversation |
GET | /api/v1/conversations/{id} | Get conversation |
DELETE | /api/v1/conversations/{id} | Delete conversation |
GET | /api/v1/conversations/{id}/messages | Get messages |
POST | /api/v1/conversations/{id}/messages | Add message |
POST | /api/v1/conversations/{id}/attach-agent | Attach agent |
GET | /api/v1/conversations/{id}/context | Context window |
GET | /api/v1/conversations/{id}/search | Search messages |
POST | /api/v1/conversations/{id}/archive | Archive |
Channels (OpenClaw)
Multi-channel communication: Slack, email, Zalo, bot tokens.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/openclaw/channels/available | Available channel types |
GET | /api/v1/openclaw/channels/configured | Configured channels |
POST | /api/v1/openclaw/channels/login | Authenticate channel |
POST | /api/v1/openclaw/channels/add/slack | Add Slack channel |
POST | /api/v1/openclaw/channels/add/bot-token | Add bot token channel |
DELETE | /api/v1/openclaw/channels/remove | Remove channel |
GET | /api/v1/openclaw/channels/{channel}/status | Channel status |
GET | /api/v1/agents/{id}/channels | Agent's channels |
Zalo
| Method | Path | Description |
|---|---|---|
POST | /api/v1/zalo/connect | Connect Zalo |
GET | /api/v1/zalo/oauth/authorize | OAuth authorize |
GET | /api/v1/zalo/status | Zalo status |
Networking (WireGuard Mesh)
Secure agent mesh networking.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/network/peers | List peers |
GET | /api/v1/network/topology | Network topology |
GET | /api/v1/network/ip-pool | IP pool |
POST | /api/v1/wireguard/provision | Provision WireGuard peer |
GET | /api/v1/wireguard/peers | List WireGuard peers |
GET | /api/v1/wireguard/health | WireGuard health |
GET | /api/v1/wireguard/quality | Connection quality |
GET | /api/v1/wireguard/pool/stats | Pool statistics |
Security & API Keys
| Method | Path | Description |
|---|---|---|
GET | /api/v1/api-keys | List configured service API keys |
POST | /api/v1/api-keys/{service} | Store API key for service |
POST | /api/v1/api-keys/{service}/verify | Verify API key |
GET | /api/v1/settings/api-keys | Settings: API keys |
POST | /api/v1/settings/api-keys | Add key |
DELETE | /api/v1/settings/api-keys/{id} | Remove key |
POST | /api/v1/settings/api-keys/test | Test key |
GET | /api/v1/security/audit-logs | Audit logs |
GET | /api/v1/security/tokens | Active tokens |
POST | /api/v1/security/tokens | Issue token |
POST | /api/v1/security/tokens/{jti}/rotate | Rotate token |
Team
| Method | Path | Description |
|---|---|---|
GET | /api/v1/team/members | List members |
POST | /api/v1/team/members/invite | Invite member |
PATCH | /api/v1/team/members/{id}/role | Update role |
DELETE | /api/v1/team/members/{id} | Remove member |
POST | /api/v1/team/members/accept-invite/{token} | Accept invite |
Templates
| Method | Path | Description |
|---|---|---|
GET | /api/v1/templates | List agent templates |
GET | /api/v1/templates/{id} | Get template |
POST | /api/v1/templates/seed | Seed default templates |
Health & Metrics
| Method | Path | Description |
|---|---|---|
GET | /health | Service health |
GET | /metrics | Prometheus metrics |
GET | /rate-limit-status | Rate limit status |
GET | /api/v1/db/health | DB health |
GET | /api/v1/db/pool-stats | DB pool stats |
GET | /api/v1/metrics | App metrics |