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.
/
Authorization: Bearer LZ-RAGE-XXXXXXXXXX-XXXXXXXXXX
v1.0.0
Lazaarus is a multimodal AI platform. The same shared AI engine powers the Telegram bot and the public REST API. Every capability β text chat, voice understanding, and image generation β is available via JSON (or multipart for voice) over HTTPS, using a single authentication scheme and response envelope.
| Endpoint | Capability | Cost |
|---|---|---|
POST /api/v1/chat | Text chat | 1 credit |
POST /api/v1/voice | Voice understanding | 2 credits |
POST /api/v1/images/generations | Image generation | 2 credits |
POST /api/v1/images/analyze | Image analysis (vision, OCR) | 1 credit |
GET /api/v1/characters | List active characters | Free |
GET /api/v1/balance | Balance snapshot | Free |
Lazarus runs on a credits-only model. Every request must have enough credit balance for the cost listed above, or you'll receive a 402 insufficient_credits before the request is processed. Daily usage is tracked for rate-limit and abuse-prevention purposes.
Every request must include an Authorization: Bearer <api-key> header. Keys use the format LZ-RAGE-XXXXXXXXXX-XXXXXXXXXX (two 10-character blocks of uppercase alphanumeric characters). Generate your key inside the official Telegram bot: @Lazaarus_ai_bot β /account β βοΈ Get API Key. Keys are shown once β store them somewhere safe.
Lazarus runs on a single credits-only model. Every request deducts the number of credits listed in the pricing table above. Buy more credits any time via /buycredits in the Telegram bot β including the π Dev Mode pack (1,000 credits) for heavy API use.
Poll GET /api/v1/balance to see remaining credits and today's usage.
Retrieve the current balance and today's usage for the authenticated API key. Perfect for showing a live meter in your own site, app, or bot.
curl "$BASE/api/v1/balance" \
-H "Authorization: Bearer $LAZARUS_API_KEY"
// Response
{
"success": true,
"data": {
"api_key": { "id": "β¦", "name": "my-app" },
"balance": 87,
"credit_pass": { "active": false, "expires_at": null },
"trial_active": false,
"today": { "api_requests": 12, "usage_count": 12 }
}
}
// JavaScript
const r = await fetch(BASE + "/api/v1/balance", {
headers: { Authorization: "Bearer " + API_KEY },
});
const { data } = await r.json();
console.log("Balance: " + data.balance + " Β· Today: " + data.today.api_requests + " requests");
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"];POST /api/v1/voice β transcribe an audio note and reply in-character. Multipart form fields: audio (file, required), character_id (UUID, required), conversation_id (UUID, optional). Supported formats: wav, mp3, webm, m4a, ogg, flac, aac. Max size: 20 MiB. Cost: 2 credits.
curl -X POST "$BASE/api/v1/voice" \
-H "Authorization: Bearer $LAZARUS_API_KEY" \
-F "audio=@note.wav" \
-F "character_id=b7c9e21e-7f19-4a41-8b4c-4b8c8c2d3e00"
// Response
{
"success": true,
"data": {
"conversation_id": "β¦",
"character": { "id": "β¦", "name": "Nova" },
"transcript": "Hey, what's the weather like today?",
"reply": "Around here it's usuallyβ¦",
"credits_charged": 2,
"duration_ms": 1420
}
}
POST /api/v1/images/generations β generate an image from a text prompt. The Lazaarus platform handles model selection and failover automatically. Cost: 2 credits.
curl -X POST "$BASE/api/v1/images/generations" \
-H "Authorization: Bearer $LAZARUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "prompt": "a neon cyberpunk city at night, cinematic", "size": "1024x1024" }'
// Response
{
"success": true,
"data": {
"image": { "b64_json": "iVBORw0β¦", "url": null, "revised_prompt": null },
"credits_charged": 2,
"duration_ms": 4210
}
}
POST /api/v1/images/analyze β describe, OCR, and reason about an image. Send either a public image_url or a base64 payload in image_b64 (with optional mime). Optional prompt lets you ask a specific question. Cost: 1 credit (refunded automatically if analysis fails).
// cURL
curl -X POST "$BASE/api/v1/images/analyze" \
-H "Authorization: Bearer $LAZARUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "image_url": "https://example.com/photo.jpg", "prompt": "What is happening here?" }'
// JavaScript (fetch)
const r = await fetch(BASE + "/api/v1/images/analyze", {
method: "POST",
headers: { Authorization: "Bearer " + KEY, "Content-Type": "application/json" },
body: JSON.stringify({ image_url: "https://example.com/photo.jpg" })
});
const { data } = await r.json();
// Python (requests)
import requests
r = requests.post(BASE + "/api/v1/images/analyze",
headers={"Authorization": "Bearer " + KEY},
json={"image_url": "https://example.com/photo.jpg"})
print(r.json())
// PHP (curl)
$ch = curl_init("$BASE/api/v1/images/analyze");
curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["image_url" => "https://example.com/photo.jpg"]) ]);
echo curl_exec($ch);
// Response
{
"success": true,
"data": {
"analysis": {
"description": "A neon-lit city street at night with heavy rain.",
"objects": ["car", "pedestrian", "street sign", "puddle"],
"scene": "cityscape",
"text_ocr": "OPEN 24H",
"reasoning": "Reflections and blur suggest a long-exposure shot in wet conditions."
},
"credits_charged": 1,
"duration_ms": 2380
}
}
Lazarus AI automatically detects the language of each user message and replies in that same language, including regional variants such as Nigerian Pidgin, Yoruba, Igbo, Hausa, and Swahili. No API changes are required β it just works.
To pin a conversation to a specific language, pass an optional language string on /api/v1/chat. It is stored on the conversation and applied to every subsequent message automatically.
curl -X POST "$BASE/api/v1/chat" \
-H "Authorization: Bearer $LAZARUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "character_id": "β¦", "message": "How you dey?", "language": "Nigerian Pidgin" }'
GET /api/v1/characters β returns the current list of active characters, ordered by sort order. The list is live: whenever an admin creates, edits, enables, disables, or removes a character, the next call reflects the change immediately. Connected apps and bots automatically pick up the new list by polling this endpoint on load.
curl "$BASE/api/v1/characters" -H "Authorization: Bearer $LAZARUS_API_KEY"
// Response
{ "success": true, "data": { "characters": [
{ "id": "β¦", "name": "Nova", "uncensored": true, "sort_order": 1 },
{ "id": "β¦", "name": "Atlas", "uncensored": false, "sort_order": 2 }
]}}
GET /api/v1/models β returns the provider-agnostic capability catalog for the Lazaarus platform. Use this to discover which features (chat, character chat, voice understanding, image generation, multimodal) are available, along with the endpoint that exposes each one and its credit cost. Internal AI infrastructure is never exposed.
curl "$BASE/api/v1/models" -H "Authorization: Bearer $LAZARUS_API_KEY"
// Response
{
"success": true,
"data": {
"capabilities": [
{ "id": "lazarus-chat-v1", "capability": "chat", "label": "Chat", "endpoint": "/api/v1/chat", "credits_per_request": 1 },
{ "id": "lazarus-voice-v1", "capability": "voice_understanding", "label": "Voice Understanding", "endpoint": "/api/v1/voice", "credits_per_request": 2 },
{ "id": "lazarus-imagine-v1", "capability": "image_generation", "label": "Image Generation", "endpoint": "/api/v1/images/generations", "credits_per_request": 2 }
],
"models": [
{ "provider": "lazarus", "id": "lazarus-chat-v1", "role": "chat" }
]
}
}
Migration note: the legacy models array is preserved for backward compatibility. It now contains Lazaarus capability profiles (provider is always "lazarus") instead of third-party provider names. Please migrate to the capabilities array; the legacy field will be removed in a future major version.
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 |
insufficient_credits | 402 | Not enough credits for this request |
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 | Upstream AI service temporarily unavailable |
internal_error | 500 | Unexpected server error |
/api/v1/voice β voice note transcription and in-character reply (2 credits)./api/v1/images/generations β prompt-based image generation (2 credits).LZ-RAGE-XXXXXXXXXX-XXXXXXXXXX. Existing keys keep working./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.