Norman Chat
API Reference

API Reference

All endpoints require an authenticated NextAuth.js session.


POST /api/chat

Send a chat message and receive a streaming SSE response.

Request Body

{
  "messages": [{ "role": "user", "content": "Hello" }],
  "userId": "user-123",
  "chatId": "chat-456",
  "agentMode": "v0.1"
}
FieldTypeRequiredDefaultDescription
messagesArrayYesChat messages
userIdstringYesUser identifier
chatIdstringNoauto-generatedConversation identifier
agentMode"v0.1" | "v1"YesAgent mode for routing

Response (SSE Stream)

event: token
data: {"token": "Hello"}

event: token
data: {"token": "! How can I help?"}

event: usage
data: {"promptTokens": 25, "completionTokens": 8}

event: done
data: {"chatId": "chat-456", "content": "Hello! How can I help?", "toolsUsed": []}

GET /api/chat

List recent chats for the authenticated user.

Query Parameters

ParameterDefaultDescription
userIdsession userUser identifier
limit50Max chats to return

Response

{
  "chats": [
    { "chatId": "chat-456", "title": "Hello", "agentMode": "v0.1", "updatedAt": "2026-02-21T12:00:00Z" }
  ]
}

DELETE /api/chat

Delete a chat. Query param: chatId (required).


GET /api/tasks

Proxy to Norman Agent. Query params: userId, taskId.

DELETE /api/tasks

Cancel a task. Query param: taskId (required).


GET /api/files

List files or download a single file. Query params: userId, fileId, download.

POST /api/files

Upload a file (multipart/form-data).

DELETE /api/files

Delete a file. Query param: fileId (required).


GET /api/dashboard

Dashboard statistics for the authenticated user.

Response

{
  "success": true,
  "dashboard": {
    "totalChats": 42,
    "recentChats": [
      { "id": "abc123", "title": "Hello", "updatedAt": "2026-02-21T12:00:00Z" }
    ]
  }
}

© 2026 Shell Technology. All rights reserved.