Welcome. This is the reference for the Lazarus REST API. Every endpoint returns the same JSON envelope, authenticates the same way, and is generated from a single OpenAPI 3.1 spec so this page can never drift from the implementation.
The API exposes the same shared AI engine that powers the Telegram bot. You can list characters, start a conversation, send a message, and read the reply — all via JSON over HTTPS.
Every request must include an Authorization: Bearer <api-key> header. Contact the Lazarus operator to obtain an API key. Keys use the format LZ-RAGE-XXXXXXXXXX-XXXXXXXXXX (two 10-character blocks of uppercase alphanumeric characters) and are shown only once at creation; only a preview (LZ-RAGE-AB…WX) is stored afterwards.
curl -X POST "$BASE/api/v1/chat" \
-H "Authorization: Bearer $LAZARUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"character_id": "b7c9e21e-7f19-4a41-8b4c-4b8c8c2d3e00",
"message": "Hello!"
}'const res = await fetch(`${BASE}/api/v1/chat`, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.LAZARUS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
character_id: "b7c9e21e-7f19-4a41-8b4c-4b8c8c2d3e00",
message: "Hello!",
}),
});
const { success, data, error } = await res.json();
if (!success) throw new Error(error.message);
console.log(data.reply);import os, requests
r = requests.post(
f"{BASE}/api/v1/chat",
headers={"Authorization": f"Bearer {os.environ['LAZARUS_API_KEY']}"},
json={
"character_id": "b7c9e21e-7f19-4a41-8b4c-4b8c8c2d3e00",
"message": "Hello!",
},
)
body = r.json()
if not body["success"]:
raise RuntimeError(body["error"]["message"])
print(body["data"]["reply"])<?php
$ch = curl_init("$BASE/api/v1/chat");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("LAZARUS_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"character_id" => "b7c9e21e-7f19-4a41-8b4c-4b8c8c2d3e00",
"message" => "Hello!",
]),
]);
$body = json_decode(curl_exec($ch), true);
if (!$body["success"]) { throw new Exception($body["error"]["message"]); }
echo $body["data"]["reply"];Every response follows one of two shapes.
// Success
{
"success": true,
"data": { /* endpoint-specific payload */ }
}
// Error
{
"success": false,
"error": {
"code": "validation_error",
"message": "Request validation failed",
"status": 422,
"details": { "fields": [{ "field": "message", "message": "Required non-empty string" }] }
}
}
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | Missing or invalid API key |
forbidden | 403 | Key disabled, revoked, or expired |
not_found | 404 | Resource not found |
method_not_allowed | 405 | Wrong HTTP method for the endpoint |
invalid_json | 400 / 415 | Body was not valid JSON, or wrong Content-Type |
validation_error | 422 | One or more fields failed validation |
upstream_error | 502 | AI provider unavailable |
internal_error | 500 | Unexpected server error |
Rate limiting is not currently enforced at the API layer. Provider-side quotas still apply. Please contact the operator for high-volume usage.
/api/v1/chat./api/v1/conversations./api/v1/characters and /api/v1/models./openapi.json and /openapi.yaml.The interactive reference below is generated from the OpenAPI spec. Every endpoint, request body, response, and status code is documented there.