API Reference
REST API endpoints for programmatic access to Tekton AI services.
Authentication
API requests require a valid JWT token obtained via the /auth/login endpoint. Include the token in the Authorization header:
Authorization: Bearer <your-jwt-token>
API access is available on Professional and Enterprise plans.
Endpoints
POST /api/chat
Send a message to the AI assistant. Returns a Server-Sent Events (SSE) stream.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The user message/prompt |
documentContent | string | No | Document context for DocMan |
caseDescription | string | No | Case description for context |
jsonData | string | No | JSON data for context |
model | string | No | Override the AI model |
systemPrompt | string | No | Custom system prompt |
Response (SSE stream)
data: {"type": "delta", "text": "Here is "}
data: {"type": "delta", "text": "the response..."}
data: {"type": "done"}
data: [DONE]
Example
curl -X POST http://localhost:8051/api/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"message": "Create a bar chart of sales by region"}'
POST /api/transform
Transform document content using AI. Returns an SSE stream.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Transformation instruction |
documentContent | string | No | Current document content |
model | string | No | Override the AI model |
Example
curl -X POST http://localhost:8051/api/transform \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"prompt": "Make this more formal", "documentContent": "Hey, here is the report..."}'
POST /api/suggest
Get AI suggestions for a placeholder field. Returns JSON (not streaming).
| Parameter | Type | Required | Description |
|---|---|---|---|
placeholder | string | Yes | Placeholder name (e.g., "client_name") |
documentContent | string | No | Document context |
caseDescription | string | No | Case description |
jsonData | string | No | Case data as JSON string |
Response
{
"suggestions": [
"Acme Corporation",
"Global Industries Ltd",
"TechCorp Inc"
]
}
GET /api/status
Check the status of the AI backend.
Response
{
"status": "ok",
"backend": "claude-code",
"version": "1.0.0",
"model": "(default)"
}
Possible backend values: "claude-code", "direct-api"
GET /api/logs
Retrieve recent server log entries (admin only).
| Parameter | Type | Required | Description |
|---|---|---|---|
lines | number | No | Number of log lines to return (default: 50) |
Response
{
"logs": ["[2026-01-15T10:00:00Z] [INFO] [startup] Server started..."],
"total": 1250
}
Error Handling
Errors return standard HTTP status codes with a JSON body:
{
"error": "message is required"
}
400— Bad request (missing required parameters)401— Unauthorized (invalid or missing token)403— Forbidden (insufficient permissions)500— Internal server error
Rate Limits
API rate limits depend on your plan:
- Starter — 50 AI calls/month
- Professional — Unlimited
- Enterprise — Unlimited with priority processing
Tip: Monitor your usage via the account dashboard. Rate limit headers (
X-RateLimit-Remaining) are included in API responses.