SDKs
Official SDKs are planned. In the meantime, the API is plain REST + JSON and
works with any HTTP client — the guides show every call in curl, Python
(requests), and JavaScript (fetch).
Because every endpoint shares the same envelope,
you only need a thin wrapper to get an SDK-like experience: set the two headers
once, unwrap data, and raise on error.
A minimal client
Python
import os, requests
class Lexabit:
def __init__(self, token, scope, base="https://api.lexabit.com"):
self.base, self.s = base, requests.Session()
self.s.headers.update({"Authorization": f"Bearer {token}", "X-Scope": scope})
def request(self, method, path, **kw):
r = self.s.request(method, f"{self.base}{path}", **kw)
body = r.json()
if not r.ok:
raise RuntimeError(body.get("error", {}))
return body["data"], body.get("meta", {})
api = Lexabit(os.environ["LEXABIT_TOKEN"], "42")
clients, meta = api.request("GET", "/clients/v1", params={"perPage": 25})
JavaScript / TypeScript
class Lexabit {
constructor(token, scope, base = "https://api.lexabit.com") {
this.base = base;
this.headers = { Authorization: `Bearer ${token}`, "X-Scope": scope };
}
async request(method, path, { body, ...opts } = {}) {
const resp = await fetch(`${this.base}${path}`, {
method,
headers: { ...this.headers, "Content-Type": "application/json" },
body: body ? JSON.stringify(body) : undefined,
...opts,
});
const json = await resp.json();
if (!resp.ok) throw Object.assign(new Error(json.error?.message), json.error);
return json;
}
}
const api = new Lexabit(process.env.LEXABIT_TOKEN, "42");
const { data: clients } = await api.request("GET", "/clients/v1");
Add the retry + idempotency helpers from the Error Handling guide and you have a resilient client.
Generating a typed client
The API ships a machine-readable OpenAPI spec that renders as the
API Reference. You can point a generator (such as openapi-generator or
openapi-typescript) at it to produce typed models and client stubs in most
languages. Watch this page for official, supported SDKs.