Base URL: https://api.agentcommons.io
All requests require authentication via the x-api-key header (get a key from Settings → API Keys in the web app), or x-initiator (wallet address or agent ID for on-behalf-of calls).
x-api-key: your_api_key
Content-Type: application/jsonPOST /v1/agentsBody:
{
"name": "Research Bot",
"instructions": "You are a research assistant. Summarize web pages clearly.",
"persona": "Analytical and concise",
"modelProvider": "openai",
"modelId": "gpt-4o",
"temperature": 0.3,
"maxTokens": 2048
}Response:
{
"agentId": "agent_abc123",
"name": "Research Bot",
"modelProvider": "openai",
"modelId": "gpt-4o",
"createdAt": "2026-04-10T12:00:00Z"
}GET /v1/agents
GET /v1/agents?owner=0xWALLET_ADDRESSGET /v1/agents/:agentIdPUT /v1/agents/:agentIdBody — any subset of agent fields:
{
"instructions": "Updated instructions...",
"temperature": 0.7
}POST /v1/agents/runBody:
{
"agentId": "agent_abc123",
"messages": [
{ "role": "user", "content": "Summarize https://example.com" }
],
"sessionId": "optional-existing-session-id"
}Response:
{
"sessionId": "session_xyz",
"response": "The page covers...",
"usage": {
"inputTokens": 120,
"outputTokens": 85,
"totalTokens": 205
}
}POST /v1/agents/run/streamSame body as /run. Returns an SSE stream of events:
data: {"type":"token","content":"The"}
data: {"type":"token","content":" page"}
data: {"type":"tool_start","toolName":"web_scraper","input":{"url":"..."}}
data: {"type":"tool_end","toolName":"web_scraper","output":"..."}
data: {"type":"done","sessionId":"session_xyz","usage":{...}}
Consuming in JavaScript:
const response = await fetch('https://api.agentcommons.io/v1/agents/run/stream', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_KEY',
},
body: JSON.stringify({ agentId: 'agent_abc123', messages: [...] }),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
// parse SSE events from text
console.log(text);
}GET /v1/agents/sessions/:sessionId/chatResponse:
{
"sessionId": "session_xyz",
"agentId": "agent_abc123",
"history": [
{ "role": "user", "content": "Hello", "timestamp": "..." },
{ "role": "assistant", "content": "Hi there!", "timestamp": "..." }
]
}GET /v1/agents/:agentId/autonomy # get current settings
PUT /v1/agents/:agentId/autonomy # enable/configure autonomy
POST /v1/agents/:agentId/autonomy/trigger # trigger one heartbeat nowEnable autonomy:
{
"autonomyEnabled": true,
"autonomousIntervalSec": 300,
"cronExpression": "0 9 * * *"
}POST /v1/tasksBody:
{
"title": "Daily news summary",
"description": "Fetch top tech news and write a 5-bullet summary.",
"agentId": "agent_abc123",
"executionMode": "single",
"cronExpression": "0 8 * * *",
"isRecurring": true
}Execution modes:
single— run the task description as a one-shot agent promptworkflow— execute a workflow (setworkflowId)sequential— run a list of sub-tasks in order
GET /v1/tasks?agentId=agent_abc123
GET /v1/tasks?sessionId=session_xyz
GET /v1/tasks?ownerId=0xWALLET&ownerType=userGET /v1/tasks/:taskIdPOST /v1/tasks/:taskId/executeGET /v1/tasks/:taskId/streamReturns SSE with status updates as the task runs.
POST /v1/tasks/:taskId/cancelPOST /v1/workflowsBody:
{
"name": "Summarize and Tweet",
"description": "Scrape a URL, summarize it, then post to Twitter",
"definition": {
"nodes": [
{
"id": "scrape",
"type": "tool",
"toolName": "web_scraper",
"parameters": { "url": "{{inputs.url}}" }
},
{
"id": "summarize",
"type": "agent_processor",
"prompt": "Summarize this in 3 sentences: {{scrape.output}}"
},
{
"id": "tweet",
"type": "tool",
"toolName": "twitter_post",
"parameters": { "content": "{{summarize.output}}" }
}
],
"edges": [
{ "from": "scrape", "to": "summarize" },
{ "from": "summarize", "to": "tweet" }
]
},
"inputSchema": { "url": { "type": "string" } },
"isPublic": false
}POST /v1/workflows/:workflowId/executeBody:
{
"inputs": { "url": "https://techcrunch.com/latest" }
}Response:
{
"executionId": "exec_123",
"status": "running"
}GET /v1/workflows/:workflowId/executions/:executionIdReturns the current status, result/error, and per-node results. The execution ID must belong to the workflow in the URL.
GET /v1/workflows/:workflowId/executions/:executionId/streamSSE stream with status, current node, and terminal output updates:
data: {"type":"status","status":"running","currentNode":"scrape","nodeResults":{}}
data: {"type":"completed","outputData":{"summary":"Key points..."},"nodeResults":{}}
POST /v1/workflows/:workflowId/executions/:executionId/cancel
POST /v1/workflows/:workflowId/executions/:executionId/approve
POST /v1/workflows/:workflowId/executions/:executionId/rejectEvery workflow execution endpoint requires Authorization: Bearer <API_KEY> and
enforces workflow ownership. Approval and rejection bodies must include the
one-time approvalToken returned while the run is awaiting approval.
GET /v1/workflows/public
GET /v1/workflows/public?category=researchPOST /v1/workflows/:workflowId/forkCreates a copy in your account that you can modify.
GET /v1/toolsReturns built-in tools and your custom tools.
POST /v1/toolsBody:
{
"name": "Weather API",
"description": "Get current weather for a city",
"schema": {
"input": {
"city": { "type": "string", "description": "City name" }
},
"output": {
"temperature": { "type": "number" },
"conditions": { "type": "string" }
}
},
"endpoint": "https://api.weather.com/current?city={{city}}",
"method": "GET"
}POST /v1/tools/:toolId/invokeBody:
{
"input": { "city": "Nairobi" }
}POST /v1/tools/:toolId/keysBody:
{
"value": "sk-actual-api-key",
"label": "production key"
}The key is stored encrypted. Agents use it automatically when invoking the tool.
POST /v1/mcp/serversBody (SSE/HTTP transport):
{
"name": "My Tools Server",
"transportType": "sse",
"url": "https://my-mcp-server.example.com/sse"
}Body (stdio transport):
{
"name": "Filesystem Tools",
"transportType": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/data"]
}POST /v1/mcp/servers/:serverId/syncDiscovers and imports all tools the server exposes.
GET /v1/mcp/servers/:serverId/toolsGET /v1/mcp/servers/marketplaceReturns curated MCP servers you can connect with one click.
GET /.well-known/agent.json?agentId=agent_abc123Returns the agent's capability manifest:
{
"name": "Research Bot",
"description": "I can summarize web pages and answer research questions",
"url": "https://api.agentcommons.io/v1/a2a/agent_abc123",
"skills": [
{ "id": "summarize", "name": "Summarize URL", "description": "..." }
]
}POST /v1/a2a/:agentIdBody:
{
"jsonrpc": "2.0",
"id": "req_1",
"method": "tasks/send",
"params": {
"message": {
"role": "user",
"parts": [{ "type": "text", "text": "Summarize https://example.com" }]
}
}
}GET /v1/a2a/:agentId/tasks/:taskId/streamPOST /v1/walletsBody:
{
"agentId": "agent_abc123",
"walletType": "eoa",
"label": "main"
}GET /v1/wallets/agent/:agentIdGET /v1/wallets/:walletId/balanceResponse:
{
"walletId": "wallet_123",
"address": "0xABC...",
"usdc": "10.500000",
"chainId": 84532
}POST /v1/wallets/:walletId/transferBody:
{
"to": "0xDEF...",
"amount": "5.0",
"token": "USDC"
}POST /v1/memoryBody:
{
"agentId": "agent_abc123",
"memoryType": "semantic",
"content": "The user prefers concise bullet-point summaries.",
"tags": ["preferences", "formatting"]
}GET /v1/memory/agents/:agentId/retrieve?q=user+preferencesReturns memories ranked by semantic similarity to the query.
GET /v1/memory/agents/:agentIdGET /v1/oauth/providersPOST /v1/oauth/connectBody:
{
"providerKey": "google",
"agentId": "agent_abc123"
}Response:
{
"authUrl": "https://accounts.google.com/o/oauth2/auth?..."
}Redirect the user to authUrl. After they approve, they're redirected back and the token is stored.
GET /v1/oauth/connectionsGET /v1/usage/summary
GET /v1/usage/agents/:agentIdGET /v1/logs/stream
GET /v1/logs/agents/:agentIdSSE stream of log lines as they happen.
All errors follow this format:
{
"statusCode": 400,
"error": "Bad Request",
"message": "agentId is required"
}Common status codes:
| Code | Meaning |
|---|---|
400 |
Bad request — check your body/params |
401 |
Unauthorized — missing or invalid API key |
403 |
Forbidden — you don't own this resource |
404 |
Not found |
429 |
Rate limited — 120 requests/min per agent |
500 |
Server error |
- 120 requests per minute per agent
- Streaming endpoints don't count toward the rate limit
- Contact support to increase limits for production workloads