Agent CommonsAgent Commons

REST API Reference

All API endpoints with request/response examples. Base URL — https://api.agentcommons.io

REST API Reference

Base URL: https://api.agentcommons.io

Authentication

All requests require an API key header:

x-api-key: your_api_key
Content-Type: application/json

Get a key from Settings → API Keys in the web app.


Agents

MethodPathDescription
POST/v1/agentsCreate an agent
GET/v1/agentsList agents
GET/v1/agents/:agentIdGet an agent
PUT/v1/agents/:agentIdUpdate an agent
GET/v1/agents/:agentId/autonomyGet autonomy settings
PUT/v1/agents/:agentId/autonomySet autonomy settings
POST/v1/agents/:agentId/autonomy/triggerTrigger a heartbeat
GET/v1/agents/:agentId/knowledgebaseGet knowledge base
PUT/v1/agents/:agentId/knowledgebaseUpdate knowledge base
GET/v1/agents/:agentId/toolsList agent tools
POST/v1/agents/:agentId/toolsLink a tool
DELETE/v1/agents/tools/:idUnlink a tool
GET/v1/agents/tts/voicesList TTS voices

Create an agent

curl -X POST https://api.agentcommons.io/v1/agents \
  -H "x-api-key: YOUR_KEY" \
  -d '{
    "name": "Research Bot",
    "instructions": "You are a research assistant. Be concise.",
    "modelProvider": "openai",
    "modelId": "gpt-4o",
    "temperature": 0.3,
    "maxTokens": 2048
  }'

Model providers: openai · anthropic · google · groq · mistral · ollama


Sessions & Running

MethodPathDescription
POST/v1/agents/runRun agent (blocking)
POST/v1/agents/run/streamRun agent (SSE stream)
GET/v1/agents/sessions/:sessionId/chatGet session history

Run (blocking)

curl -X POST https://api.agentcommons.io/v1/agents/run \
  -H "x-api-key: YOUR_KEY" \
  -d '{
    "agentId": "agent_abc123",
    "messages": [{ "role": "user", "content": "Hello!" }],
    "sessionId": "optional-session-id"
  }'
{
  "sessionId": "session_xyz",
  "response": "Hi there!",
  "usage": { "inputTokens": 24, "outputTokens": 8 }
}

Run (streaming)

Same body as /run. Returns an SSE stream:

data: {"type":"token","content":"Hi"}
data: {"type":"token","content":" there!"}
data: {"type":"tool_start","toolName":"web_scraper","input":{...}}
data: {"type":"tool_end","toolName":"web_scraper","output":"..."}
data: {"type":"done","sessionId":"session_xyz","usage":{...}}

Stream event types:

TypeDescription
tokenA chunk of response text
tool_startAgent is invoking a tool
tool_endTool returned a result
doneRun completed
errorAn error occurred

Tasks

MethodPathDescription
POST/v1/tasksCreate a task
GET/v1/tasksList tasks
GET/v1/tasks/:idGet a task
PUT/v1/tasks/:idUpdate a task
DELETE/v1/tasks/:idDelete a task
POST/v1/tasks/:id/executeExecute a task
POST/v1/tasks/:id/cancelCancel a task
GET/v1/tasks/:id/streamStream task status

Create a task

{
  "title": "Daily briefing",
  "description": "Summarize overnight news.",
  "agentId": "agent_abc123",
  "executionMode": "single",
  "cronExpression": "0 8 * * 1-5",
  "isRecurring": true
}

Execution modes: single · workflow · sequential


Workflows

MethodPathDescription
POST/v1/workflowsCreate a workflow
GET/v1/workflowsList your workflows
GET/v1/workflows/publicDiscover public workflows
GET/v1/workflows/:idGet a workflow
PUT/v1/workflows/:idUpdate a workflow
DELETE/v1/workflows/:idDelete a workflow
POST/v1/workflows/:id/forkFork a workflow
POST/v1/workflows/:id/executeExecute a workflow
GET/v1/workflows/:executionId/streamStream execution
GET/v1/workflows/:id/executionsExecution history

Execute a workflow

curl -X POST https://api.agentcommons.io/v1/workflows/workflow_abc123/execute \
  -H "x-api-key: YOUR_KEY" \
  -d '{ "inputs": { "url": "https://example.com" } }'

Tools

MethodPathDescription
GET/v1/toolsList tools
POST/v1/toolsCreate a tool
GET/v1/tools/:idGet a tool
PUT/v1/tools/:idUpdate a tool
DELETE/v1/tools/:idDelete a tool
POST/v1/tools/:id/invokeInvoke a tool
GET/v1/tools/permissionsList permissions
POST/v1/tools/:id/permissionsGrant a permission
GET/v1/tools/:id/keysList tool API keys
POST/v1/tools/:id/keysAdd an API key
DELETE/v1/tools/:id/keys/:keyIdDelete a key

MCP Servers

MethodPathDescription
POST/v1/mcp/serversConnect a server
GET/v1/mcp/serversList your servers
GET/v1/mcp/servers/marketplaceBrowse marketplace
GET/v1/mcp/servers/:idGet a server
PUT/v1/mcp/servers/:idUpdate a server
DELETE/v1/mcp/servers/:idDelete a server
POST/v1/mcp/servers/:id/connectConnect
POST/v1/mcp/servers/:id/disconnectDisconnect
GET/v1/mcp/servers/:id/statusConnection status
POST/v1/mcp/servers/:id/syncSync tools
GET/v1/mcp/servers/:id/toolsList tools
GET/v1/mcp/servers/:id/resourcesList resources
GET/v1/mcp/servers/:id/resources/readRead a resource
GET/v1/mcp/servers/:id/promptsList prompts
POST/v1/mcp/servers/:id/prompts/:nameRender a prompt

Agent-to-Agent (A2A)

MethodPathDescription
GET/.well-known/agent.json?agentId=xGet agent card
POST/v1/a2a/:agentIdSend a task (JSON-RPC 2.0)
GET/v1/a2a/:agentId/tasksList A2A tasks
GET/v1/a2a/:agentId/tasks/:taskId/streamStream a task

JSON-RPC methods

MethodDescription
tasks/sendSend a task synchronously
tasks/sendSubscribeSend a task with streaming subscription
tasks/getGet task status
tasks/cancelCancel a task

Wallets

MethodPathDescription
POST/v1/walletsCreate a wallet
GET/v1/wallets/agent/:agentIdList agent wallets
GET/v1/wallets/agent/:agentId/primaryGet primary wallet
GET/v1/wallets/:idGet a wallet
GET/v1/wallets/:id/balanceCheck balance
POST/v1/wallets/:id/transferTransfer funds
POST/v1/wallets/agent/:agentId/x402-fetchx402 payment fetch
DELETE/v1/wallets/:idDelete a wallet

Memory

MethodPathDescription
POST/v1/memoryCreate a memory
GET/v1/memory/agents/:agentIdList memories
GET/v1/memory/agents/:agentId/statsMemory statistics
GET/v1/memory/agents/:agentId/retrieve?q=...Semantic search
GET/v1/memory/:idGet a memory
PATCH/v1/memory/:idUpdate a memory
DELETE/v1/memory/:idDelete a memory

OAuth

MethodPathDescription
GET/v1/oauth/providersList all providers
POST/v1/oauth/connectStart an OAuth flow
GET/v1/oauth/callback/:providerKeyOAuth callback
GET/v1/oauth/connectionsList your connections
DELETE/v1/oauth/connections/:idRemove a connection
POST/v1/oauth/connections/:id/refreshRefresh token

Skills

MethodPathDescription
GET/v1/skillsList skills
GET/v1/skills/indexPublic skill index
POST/v1/skillsCreate a skill
GET/v1/skills/:idGet a skill
PUT/v1/skills/:idUpdate a skill
DELETE/v1/skills/:idDelete a skill

Usage & Logs

MethodPathDescription
GET/v1/usage/summaryOverall usage
GET/v1/usage/agents/:agentIdAgent usage
GET/v1/logs/agents/:agentIdAgent logs
GET/v1/logs/streamLive log stream (SSE)

Errors

All errors return:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "agentId is required"
}
CodeMeaning
400Bad request — check your body/params
401Unauthorized — missing or invalid API key
403Forbidden — you don't own this resource
404Not found
429Rate limited — 120 requests/min per agent
500Server error

On this page