Skip to content

SDK Server

Hono-based HTTP server with REST, SSE streaming, and WebSocket endpoints.

import { createAgentServer } from '@agntk/server';
import { createAgent } from '@agntk/core';
const agent = createAgent({ name: 'server-agent', instructions: 'You are a helpful assistant.' });
const server = createAgentServer({ agent, port: 3000 });
server.start();
MethodPathDescription
GET/healthHealth check
GET/statusAgent info (name, tools, model)
GET/queueConcurrency queue stats
GET/configRead config file
PUT/configUpdate config file
GET/logsSSE stream of log entries
POST/generateSynchronous generation
POST/streamSSE streaming generation
POST/chatSSE streaming via agent.stream()
GET/hooksList workflow hooks (filterable by status)
GET/hooks/:idGet specific hook details
POST/hooks/:id/resumeResume a suspended hook
POST/hooks/:id/rejectReject a suspended hook
WS/ws/browser-streamReal-time browser viewport streaming

Middleware: CORS, body size limits (1MB), rate limiting (100 req/min on generation endpoints), optional API key auth, optional concurrency queue.