Local API - Complete Endpoint Reference
Complete reference for all endpoints in the AGNT Local Backend API (http://localhost:3333/api).
Table of Contents
- Agents
- Goals
- Orchestrator
- Workflows
- Executions
- Tools
- Custom Tools
- MCP Servers
- NPM Search
- Models
- Streaming
- Speech
- Users
- Webhooks
- Tool Schemas
Agents
Local agent management and execution.
Base: /agents
List Agents
GET /agentsAuth: Required
Get Agent
GET /agents/:idAuth: Required
Save Agent
POST /agents/save
PUT /agents/:idAuth: Required
Body:
{
"name": "Local Agent",
"model": "gpt-4",
"systemPrompt": "You are a helpful assistant",
"temperature": 0.7,
"tools": ["web_search"]
}Delete Agent
DELETE /agents/:idAuth: Required
Chat with Agent
POST /agents/:id/chatAuth: Required
Body:
{
"message": "Hello, how can you help me?",
"conversationHistory": [],
"stream": false
}Response:
{
"success": true,
"response": "I can help you with various tasks...",
"tokensUsed": 150,
"model": "gpt-4"
}Stream Chat with Agent
POST /agents/:id/chat-streamAuth: Required | Content-Type: multipart/form-data
Response: Server-Sent Events stream
Get Agent Suggestions
POST /agents/:id/suggestionsAuth: Required
Body:
{
"context": "Current conversation context",
"count": 3
}Response:
{
"suggestions": ["Tell me more about...", "Can you explain...", "What about..."]
}Goals
Goal-based agent execution with evaluation and golden standards.
Base: /goals
List Goals
GET /goalsAuth: Required
Get Goal
GET /goals/:idAuth: Required
Create Goal
POST /goals/createAuth: Required
Body:
{
"description": "Research and summarize AI trends",
"agentId": "agent-123",
"successCriteria": ["Comprehensive research", "Clear summary", "Cited sources"],
"maxIterations": 10
}Response:
{
"success": true,
"goalId": "goal-456",
"status": "created"
}Execute Goal
POST /goals/:goalId/executeAuth: Required
Starts goal execution. The agent will work autonomously to achieve the goal.
Get Goal Status
GET /goals/:id/statusAuth: Required
Response:
{
"id": "goal-456",
"status": "in_progress",
"progress": 60,
"currentStep": "Analyzing data",
"iterations": 3,
"maxIterations": 10,
"startedAt": "2025-11-25T10:00:00Z"
}Pause Goal
POST /goals/:id/pauseAuth: Required
Resume Goal
POST /goals/:id/resumeAuth: Required
Delete Goal
DELETE /goals/:idAuth: Required
Evaluate Goal
POST /goals/:id/evaluateAuth: Required
Body:
{
"criteria": ["accuracy", "completeness", "clarity"],
"compareToGoldenStandard": true
}Response:
{
"score": 85,
"breakdown": {
"accuracy": 90,
"completeness": 80,
"clarity": 85
},
"feedback": "Good performance overall...",
"goldenStandardComparison": {
"similarity": 0.92,
"differences": ["Minor formatting differences"]
}
}Get Evaluation Report
GET /goals/:id/evaluationAuth: Required
Save as Golden Standard
POST /goals/:id/golden-standardAuth: Required
Saves the goal's output as a golden standard for future comparisons.
List Golden Standards
GET /goals/golden-standards/listAuth: Required
Orchestrator
Universal chat handler for all agent types (agents, workflows, tools, goals).
Base: /orchestrator
Universal Chat
POST /orchestrator/chat
POST /orchestrator/agent-chat
POST /orchestrator/workflow-chat
POST /orchestrator/tool-chat
POST /orchestrator/goal-chatAuth: Required | Content-Type: multipart/form-data
Body:
message- User message (required)files- File uploads (optional)agentId- Agent ID (for agent-chat)workflowId- Workflow ID (for workflow-chat)toolId- Tool ID (for tool-chat)goalId- Goal ID (for goal-chat)stream- Enable streaming (default: true)conversationHistory- Previous messages
Response: Server-Sent Events stream or JSON
Example:
const formData = new FormData();
formData.append('message', 'Analyze this document');
formData.append('files', fileBlob, 'document.pdf');
formData.append('agentId', 'agent-123');
formData.append('stream', 'true');
const response = await fetch('http://localhost:3333/api/orchestrator/agent-chat', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_JWT_TOKEN',
},
body: formData,
});
// Handle SSE stream
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
console.log('Received:', chunk);
}Get Suggestions
POST /orchestrator/suggestionsAuth: Required
Body:
{
"context": "Current conversation",
"type": "agent",
"id": "agent-123"
}Workflows
Workflow execution and management.
Base: /workflows
List Workflows
GET /workflowsAuth: Required
Get Workflow
GET /workflows/:idAuth: Required
Save Workflow
POST /workflows/save
PUT /workflows/:idAuth: Required
Body:
{
"name": "Content Pipeline",
"description": "Automated content creation",
"nodes": [
{
"id": "node-1",
"type": "agent",
"config": {
"agentId": "agent-123"
}
}
],
"edges": [
{
"source": "node-1",
"target": "node-2"
}
]
}Delete Workflow
DELETE /workflows/:idAuth: Required
Rename Workflow
PUT /workflows/:id/nameAuth: Required
Body: { "name": "New Workflow Name" }
Get Workflow Status
GET /workflows/:id/statusAuth: Required
Response:
{
"id": "workflow-123",
"status": "running",
"currentNode": "node-2",
"progress": 50,
"startedAt": "2025-11-25T10:00:00Z"
}Start Workflow
POST /workflows/:id/startAuth: Required
Body:
{
"inputs": {
"topic": "AI trends",
"format": "blog post"
}
}Stop Workflow
POST /workflows/:id/stopAuth: Required
Executions
Execution history and details.
Base: /executions
List Executions
GET /executionsAuth: Required
Query Params:
page- Page numberlimit- Items per pagestatus- Filter by statusagentId- Filter by agentworkflowId- Filter by workflow
Get Execution Details
GET /executions/:idAuth: Required
Response:
{
"id": "exec-123",
"type": "agent",
"agentId": "agent-456",
"status": "completed",
"startedAt": "2025-11-25T10:00:00Z",
"completedAt": "2025-11-25T10:05:00Z",
"duration": 300000,
"tokensUsed": 2500,
"cost": 0.05,
"input": "Research AI trends",
"output": "Comprehensive research report...",
"steps": [
{
"name": "Web Search",
"status": "success",
"duration": 5000
}
]
}Get Agent Activity
POST /executions/activityAuth: Required
Body:
{
"agentId": "agent-123",
"startDate": "2025-11-01",
"endDate": "2025-11-30",
"groupBy": "day"
}Response:
{
"totalExecutions": 150,
"successRate": 95,
"avgDuration": 45000,
"totalTokens": 125000,
"timeline": [
{
"date": "2025-11-25",
"executions": 10,
"tokens": 5000
}
]
}Tools
Tool management and available tools.
Base: /tools
Get Orchestrator Tools
GET /tools/orchestrator-toolsAuth: Required
Response:
{
"tools": [
{
"id": "web_search",
"name": "Web Search",
"title": "Web Search",
"description": "Search the web for information",
"category": "Data & Knowledge",
"is_builtin": true
},
{
"id": "execute_shell",
"name": "Execute Shell",
"description": "Execute shell commands",
"category": "Productivity",
"is_builtin": true
}
]
}Custom Tools
Custom tool definitions.
Base: /custom-tools
List Custom Tools
GET /custom-toolsAuth: Required
Get Custom Tool
GET /custom-tools/:idAuth: Required
Save Custom Tool
POST /custom-tools/save
PUT /custom-tools/:idAuth: Required
Body:
{
"name": "Weather API",
"description": "Fetch weather data",
"type": "api",
"config": {
"url": "https://api.weather.com/v1/current",
"method": "GET",
"headers": {
"Authorization": "Bearer API_KEY"
},
"params": {
"location": "{{location}}"
}
},
"inputSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": ["location"]
}
}Delete Custom Tool
DELETE /custom-tools/:idAuth: Required
MCP Servers
Model Context Protocol server management.
Base: /mcp
List MCP Servers
GET /mcp/serversAuth: Required
Response:
{
"servers": [
{
"name": "weather-server",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-weather"],
"env": {},
"status": "running",
"capabilities": {
"tools": ["get_weather", "get_forecast"],
"resources": []
}
}
]
}Add MCP Server
POST /mcp/serversAuth: Required
Body:
{
"name": "custom-server",
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "your-key"
}
}Update MCP Server
PUT /mcp/servers/:nameAuth: Required
Delete MCP Server
DELETE /mcp/servers/:nameAuth: Required
Get Server Capabilities
GET /mcp/servers/:name/capabilitiesAuth: Required
Response:
{
"tools": [
{
"name": "get_weather",
"description": "Get current weather",
"inputSchema": {}
}
],
"resources": [],
"prompts": []
}Test MCP Server Connection
POST /mcp/servers/:name/testAuth: Required
Response:
{
"success": true,
"status": "connected",
"latency": 45,
"capabilities": {
"tools": 5,
"resources": 2
}
}NPM Search
Search NPM for MCP server packages.
Base: /npm
Search MCP Servers
GET /npm/search?q=weatherAuth: Required
Query Params:
q- Search querypage- Page numberlimit- Results per page
Response:
{
"packages": [
{
"name": "@modelcontextprotocol/server-weather",
"version": "1.0.0",
"description": "MCP server for weather data",
"author": "MCP Team",
"downloads": 5000,
"repository": "https://github.com/..."
}
],
"total": 25
}Get Popular Servers
GET /npm/popularAuth: Required
Get Package Details
GET /npm/package/:packageNameAuth: Required
Response:
{
"name": "@modelcontextprotocol/server-weather",
"version": "1.0.0",
"description": "MCP server for weather data",
"readme": "# Weather Server\n\n...",
"dependencies": {},
"repository": "https://github.com/...",
"homepage": "https://..."
}Test Package
POST /npm/testAuth: Required
Body:
{
"packageName": "@modelcontextprotocol/server-weather",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-weather"]
}Models
AI model management and selection.
Base: /models
Get Models by Provider
GET /models/:provider/modelsAuth: Required
Path Params:
provider- Provider name (openrouter, anthropic, openai, gemini, groq, togetherai, grok)
Query Params:
category- Filter by categoryuseCache- Use cached results (default: true)format- Response format (names, full)
Example:
GET /models/openrouter/models?category=programming&format=namesResponse:
{
"success": true,
"models": ["gpt-4-turbo", "gpt-4", "claude-3-opus", "claude-3-sonnet"],
"cached": true,
"count": 4
}Refresh Models Cache
POST /models/:provider/models/refreshAuth: Required
Get Model Categories
GET /models/models/categoriesAuth: Required
Response:
{
"success": true,
"categories": [
{
"id": "all",
"name": "All Models",
"description": "All available models"
},
{
"id": "programming",
"name": "Programming",
"description": "Models optimized for code generation"
}
]
}Streaming
Real-time AI streaming.
Base: /stream
Start Tool Forge Stream
POST /stream/start-tool-forge-streamAuth: Required | Content-Type: multipart/form-data
Cancel Tool Forge Stream
POST /stream/cancel-tool-forge-streamAuth: Required
Start Chat Stream
POST /stream/start-chat-streamAuth: Required | Content-Type: multipart/form-data
Cancel Chat Stream
POST /stream/cancel-chat-streamAuth: Required
Generate Tool
POST /stream/generate-toolAuth: Required
Body:
{
"description": "A tool that converts currencies",
"requirements": ["Real-time exchange rates", "Multiple currencies"]
}Generate Workflow
POST /stream/generate-workflowAuth: Required
Generate Agent
POST /stream/generate-agentAuth: Required
Body:
{
"description": "Customer support agent",
"capabilities": ["Answer FAQs", "Escalate issues"],
"tone": "friendly and professional"
}Speech
Speech-to-text services using Whisper.
Base: /speech
Transcribe Audio
POST /speech/transcribeAuth: Required | Content-Type: multipart/form-data
Body:
audio- Audio file (webm, wav, mp3, ogg, m4a)
Example:
const formData = new FormData();
formData.append('audio', audioBlob, 'recording.webm');
const response = await fetch('http://localhost:3333/api/speech/transcribe', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_JWT_TOKEN',
},
body: formData,
});
const data = await response.json();
console.log('Transcript:', data.transcript);Response:
{
"success": true,
"transcript": "Hello, this is a test transcription."
}Get Whisper Status
GET /speech/statusAuth: Required
Response:
{
"success": true,
"initialized": true,
"modelPath": "/path/to/whisper/model",
"modelSize": "base"
}Initialize Whisper
POST /speech/initializeAuth: Required
Downloads Whisper model if not already present.
Users
User settings and preferences.
Base: /users
Get User Stats
GET /users/user-statsAuth: Required
Response:
{
"totalAgents": 10,
"totalWorkflows": 5,
"totalExecutions": 250,
"totalGoals": 3
}Get User Settings
GET /users/settingsAuth: Required
Update User Settings
PUT /users/settingsAuth: Required
Body:
{
"theme": "dark",
"defaultModel": "gpt-4",
"autoSave": true,
"notifications": {
"email": true,
"desktop": true
}
}Sync Token
POST /users/sync-tokenAuth: Required
Syncs authentication token from remote API.
Get Token Status
GET /users/token-statusAuth: Not required
Response:
{
"hasToken": true,
"isValid": true,
"expiresAt": "2025-12-25T10:00:00Z"
}Get Connection Health
GET /users/connection-healthAuth: Required
Response:
{
"providers": [
{
"id": "openai",
"name": "OpenAI",
"status": "connected",
"lastChecked": "2025-11-25T10:00:00Z"
}
]
}Get Single Provider Health
GET /users/connection-health/:providerIdAuth: Required
Connection Health Stream
GET /users/connection-health-stream?token=YOUR_JWT_TOKENAuth: Via query parameter
Response: Server-Sent Events stream with real-time health updates
Webhooks
Local webhook management.
Base: /webhooks
List Webhooks
GET /webhooksAuth: Required
Get Webhook by Workflow
GET /webhooks/workflow/:workflowIdAuth: Required
Delete Webhook
DELETE /webhooks/workflow/:workflowIdAuth: Required
Tool Schemas
Tool schema registry and metadata.
Base: /tool-schemas
Get All Schemas
GET /tool-schemas/schemasAuth: Not required
Response:
{
"Data & Knowledge": [
{
"type": "web_search",
"name": "Web Search",
"description": "Search the web",
"inputSchema": {},
"outputSchema": {}
}
],
"Productivity": []
}Get Schema by Tool Type
GET /tool-schemas/schemas/:toolTypeAuth: Not required
Get Schemas by Category
GET /tool-schemas/schemas/category/:categoryAuth: Not required
Get Registry Stats
GET /tool-schemas/statsAuth: Not required
Response:
{
"totalTools": 45,
"categories": 6,
"sources": {
"builtin": 30,
"mcp": 15
}
}Get Tool Metadata
GET /tool-schemas/metadata/:toolTypeAuth: Not required
Reload Registry
POST /tool-schemas/reloadAuth: Not required
Next Steps
- Local API Overview - Overview and setup
- Remote API Reference - Cloud API endpoints
- Authentication Guide - Auth methods
- Examples - Code examples