Documentation

API reference

Lilbe is OpenAI-compatible. Point any OpenAI SDK at https://lilbe.in/api/public/v1 with your Lilbe API key.

Authentication

All requests require an Authorization: Bearer sk-ion-… header. Create keys in your dashboard.

Endpoints

  • POST /api/public/v1/chat/completions — chat, streaming, tools, vision
  • POST /api/public/v1/embeddings — vector embeddings
  • GET /api/public/v1/models — list available public models

cURL

POST /chat/completions
curl https://lilbe.in/api/public/v1/chat/completions \
  -H "Authorization: Bearer $LILBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

JavaScript (openai)

JavaScript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LILBE_API_KEY,
  baseURL: "https://lilbe.in/api/public/v1",
});

const r = await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);

Python (openai)

Python
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["LILBE_API_KEY"],
    base_url="https://lilbe.in/api/public/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Streaming (SSE)

Streaming JavaScript
const r = await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", "content": "Stream this" }],
  stream: true,
});
for await (const chunk of r) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Errors

Errors follow the OpenAI shape:{ "error": { "message": "…", "type": "…", "code": "…" } }

  • 401 invalid_api_key
  • 404 model_not_found
  • 502 upstream_failure — all routes failed after retries
  • 503 service_unavailable — no healthy route available