Developers
Lexible API
Every Lexible machine exposes an OpenAI-compatible API. Your data never leaves the machine: requests go straight to it, over its own TLS certificate, through the blind relay when you are off-site. Point any OpenAI client library at the machine's base URL and use a Lexible API key.
Base URL and keys
Sign in to see your machines' addresses. Addresses look like https://acme-law.on.lexible.ai.
Keys look like lxk_xxxxxxxx_…. Organization admins create them on the organization page (valid on every machine in the organization) or on one machine's Developers page (valid there only). Each key has scopes and a per-minute rate limit. Keys are stateless: they never read or write anyone's conversations.
| Scope | Allows |
|---|---|
chat | POST /chat/completions (streaming with stream: true) |
models | GET /models |
embeddings | POST /embeddings |
images | POST /images/generations (501 until the image engine ships) |
status | GET /status — load, model readiness, capacity |
Examples
curl https://your-machine.on.lexible.ai/api/v1/chat/completions \
-H "Authorization: Bearer $LEXIBLE_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "default", "messages": [{"role": "user", "content": "Summarise this contract clause: …"}]}'
from openai import OpenAI
client = OpenAI(base_url="https://your-machine.on.lexible.ai/api/v1", api_key=os.environ["LEXIBLE_API_KEY"])
reply = client.chat.completions.create(model="default", messages=[{"role": "user", "content": "Hello"}])
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://your-machine.on.lexible.ai/api/v1", apiKey: process.env.LEXIBLE_API_KEY });
const out = await client.embeddings.create({ model: "default", input: ["invoice", "receipt"] });
Behaviour
- Errors use the OpenAI shape:
{"error": {"message", "type"}}. 401 bad key, 403 missing scope, 429 over the per-minute limit (withRetry-After). modelmay bedefaultor any id fromGET /models.- Capacity:
GET /statusreportsok,busyorcritical; back off when it is notok. - The interactive reference (OpenAPI) is served by each machine at
https://your-machine.on.lexible.ai/docs. - Multiple machines: today each key works on every machine in the organization; pick one base URL per integration. Automatic routing across machines is on the roadmap.
app.lexible.ai manages access only. Conversations stay on your machine.