API reference¶
Base URL: https://api.keln.ai/v1 · Auth: Authorization: Bearer sk-keln-…
Keln is OpenAI-wire-compatible, an OpenAI SDK works by changing the base URL. Behind the endpoint, Keln normalizes across its serving pool: whatever capacity serves your request, the parameters you sent behave the same way and the response has the same shape.
Endpoints¶
| Endpoint | What it does |
|---|---|
POST /v1/chat/completions |
Chat completions, streaming and non-streaming, tools, structured output, reasoning control. Needs an API key. |
GET /v1/models |
The servable catalog: context windows, live pricing, input modalities (text / image), and current routing performance figures. No key needed, CORS-open. |
GET /healthz |
Liveness check, for uptime monitoring. No key needed. |
There is no legacy /v1/completions text endpoint.
Model ids are lowercase (deepseek-ai/deepseek-v4-flash) and matched case-insensitively.
Authentication¶
Every POST /v1/chat/completions requires an API key, created in the
portal (Keys page):
Authorization: Bearer sk-keln-…
Keys are shown once, stored hashed, and can be revoked. A key belongs to a workspace; usage bills to that workspace's balance and can be capped with per-key budgets.
GET /v1/models requires no key and is served CORS-open
(Access-Control-Allow-Origin: *).
SDKs¶
Any OpenAI-compatible client works:
from openai import OpenAI
client = OpenAI(base_url="https://api.keln.ai/v1", api_key="sk-keln-…")
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.keln.ai/v1", apiKey: "sk-keln-…" });
Coming from another gateway? Migration guide →
Reading order¶
- Chat completions, the full parameter contract
- Streaming, SSE semantics, usage in the final chunk
- Models, catalog, context windows, pricing block
- Errors & limits, the envelope, status codes, retry guidance