Deploy Agent
Docs/API Reference/API Overview
Reference

API Reference

REST API endpoints for programmatic access to your Lobstack agent. Send messages, manage sessions, configure skills, and more.

📝

Authentication

The management endpoints below are authenticated via secure session cookies (the dashboard handles this automatically). The Lobstack Gateway uses a per-agent bearer token instead — see below.

Lobstack Gateway (OpenAI-compatible)#

The primary way to call your agent's model programmatically. The Gateway speaks the OpenAI Chat Completions format, so it drops into any existing SDK or tool — just change the base URL and key. Pass "model": "auto" to run Lobstack 1.2 (Token Intelligence picks the best engine per message), or any supported model id. See the full Gateway guide.

POST /api/gateway/v1/chat/completions
curl https://lobstack.ai/api/gateway/v1/chat/completions \
  -H "Authorization: Bearer $LOBSTACK_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{ "role": "user", "content": "Summarize today’s support tickets." }]
  }'

Responses are OpenAI-shaped and include routing headers — x-lobstack-model (the engine chosen), x-lobstack-tier, x-lobstack-cost-usd, and x-lobstack-savings — so you see exactly what ran. List available models with GET /api/gateway/v1/models.

Agent Status#

Get the current status of your agent, including server details, usage metrics, and optional related data.

GET /api/agent/status
curl -b "sb-access-token=YOUR_TOKEN" \
  "https://lobstack.ai/api/agent/status?include=messages,skills,logs,health"

Response Fields#

FieldTypeDescription
agent.idstringUnique agent instance ID
agent.statusstringrunning, provisioning, or error
agent.server_ipstringVM IP address
agent.server_tierstringstarter, standard, performance, enterprise
agent.server_regionstringus-east, us-west, eu-central, eu-north, ap-south
agent.ai_modelstringCurrent AI model identifier
agent.messages_usednumberMessages used this billing period
agent.messages_limitnumberMonthly message limit for current plan
agent.plan_tierstringSubscription plan tier
messagesarrayRecent messages (when include=messages)
skillsarrayEnabled skills (when include=skills)

Chat#

Send a message to your agent and receive a response. The agent may execute tools during processing.

POST /api/agent/chat
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"message": "What is running on this server?", "session_id": "abc123"}' \
  "https://lobstack.ai/api/agent/chat"
ParameterTypeRequiredDescription
messagestringYesThe user message to send
session_idstringNoSession ID for conversation isolation
imagesarrayNoBase64 image data for multimodal analysis

Sessions#

List Sessions#

GET /api/agent/sessions
curl -b "sb-access-token=YOUR_TOKEN" \
  "https://lobstack.ai/api/agent/sessions"

Create Session#

POST /api/agent/sessions
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"title": "Debug Session", "category": "task"}' \
  "https://lobstack.ai/api/agent/sessions"

Update Session#

Update session metadata — title, category, status, icon, or pinned state. At least one field is required.

PATCH /api/agent/sessions
curl -X PATCH -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"sessionId": "abc123", "category": "research", "pinned": true}' \
  "https://lobstack.ai/api/agent/sessions"
ParameterTypeDescription
sessionIdstringSession ID to update (required)
titlestringNew session title (max 100 chars)
categorystringgeneral, task, research, support, automation, creative, or debug
statusstringactive, completed, paused, or archived
iconstringCustom icon for the session
pinnedbooleanPin session for quick access

Delete Session#

DELETE /api/agent/sessions
curl -X DELETE -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"sessionId": "abc123"}' \
  "https://lobstack.ai/api/agent/sessions"

Skills#

Get Enabled Skills#

GET /api/agent/skills
curl -b "sb-access-token=YOUR_TOKEN" \
  "https://lobstack.ai/api/agent/skills"

Enable/Disable Skill#

POST /api/agent/skills
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"skill": "discord", "enabled": true}' \
  "https://lobstack.ai/api/agent/skills"

Configure Skill Credentials#

PUT /api/agent/skills
curl -X PUT -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"skill": "discord", "config": {"discord_token": "MTk...", "discord_app_id": "123..."}}' \
  "https://lobstack.ai/api/agent/skills"

Memory#

GET /api/agent/memory
curl -b "sb-access-token=YOUR_TOKEN" \
  "https://lobstack.ai/api/agent/memory"
POST /api/agent/memory (Create)
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"key": "timezone", "value": "America/New_York", "category": "user_pref"}' \
  "https://lobstack.ai/api/agent/memory"

Token Budget#

Get token budget status or request a model routing recommendation based on message complexity.

GET /api/agent/token-budget
curl -b "sb-access-token=YOUR_TOKEN" \
  "https://lobstack.ai/api/agent/token-budget"
POST /api/agent/token-budget
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"message": "What time is it?"}' \
  "https://lobstack.ai/api/agent/token-budget"

Chat Automation#

Create workflows from natural language commands. Used by slash commands like /automate, /schedule, /trigger, and /remind.

POST /api/agent/chat-automate
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"command": "schedule", "text": "every day at 9am check inventory"}' \
  "https://lobstack.ai/api/agent/chat-automate"
ParameterTypeDescription
commandstringautomate, schedule, trigger, remind, or status
textstringNatural language description of the automation

Update Agent Settings#

Change AI model, messenger, server tier, or region. Triggers a full VM rebuild.

POST /api/agent/update
curl -X POST -H "Content-Type: application/json" \
  -b "sb-access-token=YOUR_TOKEN" \
  -d '{"aiModel": "claude-opus-4-6"}' \
  "https://lobstack.ai/api/agent/update"
ParameterTypeDescription
aiModelstringAI model to switch to
messengerTypestringMessenger channel (web, telegram, discord, slack, whatsapp)
serverTierstringServer tier (starter, standard, performance, enterprise)
serverRegionstringServer region (us-east, us-west, eu-central, eu-north, ap-south)
aiApiKeystringYour own AI provider API key (optional)