API Reference

Member API for projects, agents, chat and sessions.

Authentication

All member endpoints require a JWT in the Authorization header.

text
Base URL: <your-server>/api
Auth:     Authorization: Bearer <member_jwt>
Format:   JSON

Projects

Projects scope all resources (agents, knowledge base, chat sessions).

List projects

bash
curl "<your-server>/api/member/projects" \
  -H "Authorization: Bearer $MEMBER_TOKEN"
json
{
  "data": [{
    "id": "prj_uuid",
    "name": "My Store",
    "website": "https://store.example",
    "industry": "e-commerce",
    "plan": "starter",
    "is_active": true,
    "usage": { "chats_used": 50, "chats_limit": 1000 },
    "created_at": "2026-08-02T00:00:00Z"
  }]
}

Create project

bash
curl -X POST "<your-server>/api/member/projects" \
  -H "Authorization: Bearer $MEMBER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Store","website":"https://store.example","industry":"e-commerce"}'

Returns 201 Created with the project object.

Agents

List agents in a project

bash
curl "<your-server>/api/member/projects/$PROJECT_ID/agents" \
  -H "Authorization: Bearer $MEMBER_TOKEN"

Create an agent

bash
curl -X POST "<your-server>/api/member/projects/$PROJECT_ID/agents" \
  -H "Authorization: Bearer $MEMBER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Bot",
    "system_prompt": "You are a friendly support assistant.",
    "model": "auto"
  }'

Chat

Send messages and manage sessions. Sessions preserve conversation context.

Send a message

bash
curl -X POST "<your-server>/api/member/projects/$PROJECT_ID/agents/$AGENT_ID/chat" \
  -H "Authorization: Bearer $MEMBER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello!"}'

List sessions

bash
curl "<your-server>/api/member/projects/$PROJECT_ID/agents/$AGENT_ID/sessions" \
  -H "Authorization: Bearer $MEMBER_TOKEN"

Tenant API (public)

Public endpoints use a tenant API key instead of a JWT. Used by your own apps, custom frontends and external clients.

text
Chat:    POST <your-server>/api/v1/tenant/chat  (SSE stream)
Agents:  GET  <your-server>/api/v1/tenant/agents
Models:  GET  <your-server>/api/v1/tenant/models

Errors

Errors return a JSON body with a message and the appropriate HTTP status code.

json
{ "error": "message" }
  • • 400 — invalid request
  • • 401 — missing / invalid auth
  • • 403 — forbidden (plan limit)
  • • 404 — not found