Skip to main content

API Quick Reference

Complete reference of all VoltAgent Server API endpoints.

Base URL

http://localhost:3141

Default port is 3141, but may vary based on configuration.

Documentation Endpoints

MethodPathDescriptionAuth
GET/Landing page with linksNo
GET/docOpenAPI 3.1 specificationNo
GET/uiSwagger UI interactive docsNo

Agent Endpoints

MethodPathDescriptionAuth
GET/agentsList all registered agentsNo
GET/agents/:idGet agent detailsNo
POST/agents/:id/textGenerate text responseYes
POST/agents/:id/streamStream text response (SSE)Yes
POST/agents/:id/objectGenerate structured objectYes
POST/agents/:id/stream-objectStream object generation (SSE)Yes
GET/agents/:id/historyGet agent execution historyNo

Common Request Format

{
"input": "string or message array",
"options": {
"userId": "string",
"conversationId": "string",
"contextLimit": 10,
"maxSteps": 5,
"temperature": 0.7,
"maxOutputTokens": 4000,
"topP": 1.0,
"frequencyPenalty": 0.0,
"presencePenalty": 0.0,
"seed": 42,
"stopSequences": ["\\n\\n"],
"providerOptions": {},
"context": {}
}
}

Workflow Endpoints

MethodPathDescriptionAuth
GET/workflowsList all workflowsNo
GET/workflows/:idGet workflow detailsNo
POST/workflows/:id/executeExecute workflowYes
POST/workflows/:id/streamStream workflow execution (SSE)Yes
POST/workflows/:id/executions/:executionId/suspendSuspend executionNo*
POST/workflows/:id/executions/:executionId/resumeResume executionNo*
GET/workflows/:id/executions/:executionId/stateGet execution stateNo

Workflow Request Format

{
"input": {},
"options": {
"userId": "string",
"conversationId": "string",
"executionId": "string",
"context": {}
}
}

Logging & Observability

MethodPathDescriptionAuth
GET/api/logsQuery system logs (filters)No
GET/observability/statusObservability statusNo
GET/observability/tracesList tracesNo
GET/observability/traces/:traceIdGet trace by IDNo
GET/observability/spans/:spanIdGet span by IDNo
GET/observability/traces/:traceId/logsLogs for a traceNo
GET/observability/spans/:spanId/logsLogs for a spanNo
GET/observability/logsQuery logs (filters)No
POST/setup-observabilityConfigure VoltAgent keysNo

System

MethodPathDescriptionAuth
GET/updatesCheck available updatesNo
POST/updates/installInstall updatesNo

WebSockets

// Connection test / echo
const ws = new WebSocket("ws://localhost:3141/ws");

// Real-time logs (supports ?level, ?agentId, ?workflowId, ?executionId, ?since, ?until, ?limit)
const logsWs = new WebSocket("ws://localhost:3141/ws/logs?level=info");

// Observability (optional filters: ?entityId=&entityType=agent|workflow)
const obsWs = new WebSocket(
"ws://localhost:3141/ws/observability?entityType=agent&entityId=assistant"
);

Response Formats

Success Response

{
"success": true,
"data": {
// Response data
}
}

Error Response

{
"success": false,
"error": "Error message"
}

SSE Event Format

event: event-type
data: {"key": "value"}
id: optional-id

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request - Invalid input
401Unauthorized - Authentication required
404Not Found - Resource doesn't exist
500Internal Server Error

Authentication

Include JWT token in Authorization header for protected endpoints:

curl -H "Authorization: Bearer YOUR_JWT_TOKEN"

cURL Examples

List Agents

curl http://localhost:3141/agents

Generate Text (Protected)

curl -X POST http://localhost:3141/agents/assistant/text \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"input": "Hello"}'

Execute Workflow

curl -X POST http://localhost:3141/workflows/my-workflow/execute \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"input": {"key": "value"}}'

Stream Response

curl -N -X POST http://localhost:3141/agents/assistant/stream \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"input": "Tell me a story"}'

JavaScript/TypeScript Client

Basic Request

const response = await fetch("http://localhost:3141/agents", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});

const agents = await response.json();

Authenticated Request

const response = await fetch("http://localhost:3141/agents/assistant/text", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({
input: "Hello",
options: { temperature: 0.7 },
}),
});

Stream Handling

const response = await fetch("http://localhost:3141/agents/assistant/stream", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({ input: "Stream this" }),
});

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);
// Process SSE chunk
}

Environment Variables

VariableDescriptionDefault
PORTServer port-
NODE_ENVEnvironment (development/production)development
JWT_SECRETJWT signing secret-
VOLTAGENT_PUBLIC_KEYVoltOps public key-
VOLTAGENT_SECRET_KEYVoltOps secret key-

Note: The server reads its port from the honoServer({ port }) config. PORT is not used by default.

Additional Resources

  • Interactive API Explorer: Navigate to /ui on your running server
  • OpenAPI Specification: Available at /doc for code generation
  • GitHub Repository: github.com/voltagent/voltagent

Footnote: * As of the current version, suspend and resume are not in the default protected route list. Secure them explicitly if needed.

Table of Contents