REST APIv1

Gateway API

Send messages to your LuluClaw hosted assistant over HTTP from any language or platform. The Gateway API lets you integrate your assistant into your own product with a single endpoint.


Base URL

https://luluclaw.com/api/gateway/chat

Authentication

Pass your API key as a Bearer token in the Authorization header. You can find your key in the Account tab.

Authorization: Bearer YOUR_API_KEY

Request

POST/api/gateway/chat

Send a Content-Type: application/json body with the following fields:

FieldTypeDescription
messagestringRequired. The user message to send (max 4 000 characters).
session_idstringOptional. A string (max 128 chars) that identifies the conversation thread. Omit to start a new thread.

Response

A successful request returns 200 OK with the following JSON body:

FieldTypeDescription
replystringThe assistant's response text.
session_idstringThe session ID for this thread. Pass this back in subsequent requests to continue the conversation.
credits_usednumberCredits consumed by this request.
credits_remainingnumber | nullCredits remaining in your balance, or null if unavailable.

Error Codes

Errors are returned as JSON with an error string at the status code listed below.

StatusMeaningWhen it happens
401UnauthorizedAPI key is missing, malformed, or invalid.
402Payment RequiredYour credit balance has been exhausted. Top up or upgrade your plan.
429Too Many RequestsHourly or per-key rate limit reached. Retry after the window resets.
503Service UnavailableThe assistant service is temporarily unavailable. Retry after a short delay.

cURL Example

bash
curl -X POST https://luluclaw.com/api/gateway/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello! What can you help me with?",
    "session_id": "user-abc-session-1"
  }'

JavaScript Example

javascript
const response = await fetch("https://luluclaw.com/api/gateway/chat", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    message: "Hello! What can you help me with?",
    session_id: "user-abc-session-1", // optional — omit to start a new thread
  }),
});

const data = await response.json();
// {
//   reply: "Hi there! I can help you with ...",
//   session_id: "user-abc-session-1",
//   credits_used: 1,
//   credits_remaining: 249
// }
console.log(data.reply);
Need an API key? Sign in to your LuluClaw account and open the Account tab to generate one. Credits are consumed per request and can be topped up from the Billing tab.