API Reference
The L0NG API lets you integrate the L0NG-1 intelligence engine into your applications. Send messages, switch reasoning modes, and maintain conversation history. All requests and responses are JSON over HTTPS.
Base URL
https://l0ng-backend.monyephoyn.workers.dev

All endpoints are relative to this base URL. No authentication is required for the current public build.

Chat
POST /api/chat
Send a message to L0NG-1 and receive a response. Optionally include conversation history and select a reasoning mode.
Parameter Type Required Description
message string required The user's message.
mode string optional Reasoning mode. Default: standard. See Modes section.
history array optional Previous messages. Each item: {"role": "user"|"assistant", "content": "..."}
// Request
POST /api/chat
Content-Type: application/json

{
  "message": "Explain pathfinding in Roblox",
  "mode": "standard",
  "history": [
    { "role": "user", "content": "Hey" },
    { "role": "assistant", "content": "Hey! What can I help with?" }
  ]
}
Response
{
  "response": "PathfindingService in Roblox lets you...",
  "mode": "standard",
  "tokens": 312
}
Health
GET /api/health
Check if the API is online and responding.
Response
{
  "status": "ok",
  "model": "L0NG-1",
  "version": "1.0.0"
}
Modes

The mode parameter controls how L0NG-1 approaches your request.

"standard"
Fast, direct answers. Default behavior.
"think"
Shows step-by-step reasoning before the answer.
"deep_think"
Maximum analytical depth. Decomposes and examines edge cases.
"www"
Fetches Wikipedia context before answering. Grounded output.
Errors

All errors return a JSON body with an error field and a standard HTTP status code.

Status Meaning
400 Bad request — missing or empty message field.
405 Method not allowed — use POST for /api/chat.
500 Internal server error — model inference failed.