Start
Introduction
Korlogic is an OpenAI-compatible API gateway. Point an SDK you already use at a Korlogic base URL, authenticate with the key you were issued, and the whole model catalogue answers in the request format you already know.
Change the base URL. Keep your SDK.
What it is (permalink)
One endpoint, one key, and the request and response shapes of the OpenAI and Anthropic APIs. There is nothing to install and no SDK of ours to learn. If your code already talks to /chat/completions or /v1/messages, changing the base URL and the key is the entire integration.
- Drop-in compatibility. OpenAI Chat Completions and Responses, plus Anthropic Messages, on the same key.
- Streaming everywhere. Server-sent events pass through byte for byte, and usage is metered from the stream as it flushes.
- Per-key control. A key can be scoped to a subset of models and given an expiry date. Ask whoever issued yours what it allows.
- Usage you can see. Paste your key into the usage checker to watch balance and consumption update live. No account required.
First request (permalink)
Three steps, about a minute.
- Take the key you were issued. Every key starts with
kl_live_. - Take the base URL for your key’s surface:
https://api.korlogic.com/v1for a credit key,https://api.korlogic.com/token/v1for a token key. - Send a chat completion.
curl https://api.korlogic.com/v1/chat/completions \
-H "Authorization: Bearer kl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"messages": [{ "role": "user", "content": "Say hello in five words." }]
}'A successful call returns the standard OpenAI chat completion object, including a usage block with the token counts your key was billed for.
Two surfaces (permalink)
Every key is issued against exactly one billing surface, and each surface has its own base URL. A credit key spends a balance in US dollars. A token key draws down a prepaid budget of tokens, counted across input and output. Sending a key to the other surface is rejected as an invalid key, so it is worth getting right first.
| Surface | Your key spends | Base URL |
|---|---|---|
| Credit | A balance in US dollars, priced per model | https://api.korlogic.com/v1 |
| Token | A fixed prepaid token budget | https://api.korlogic.com/token/v1 |
Base URLs covers the difference in full, including the separate value that Anthropic-style clients need.
Endpoints (permalink)
Paths are appended to your base URL and forwarded upstream unchanged. These are the ones you will use:
| Method | Path | What it is |
|---|---|---|
| POST | /chat/completions | OpenAI Chat Completions. The default for most clients. |
| POST | /messages | Anthropic Messages, for Anthropic SDKs and Claude Code. |
| POST | /responses | OpenAI Responses, on models that support it. |
| GET | /models | The upstream model catalogue. |
The gateway answers GET, POST, DELETE and OPTIONS. Cross-origin preflight is handled, and a request with no path at all returns 404 unknown_endpoint before it is even authenticated.
Where to go next (permalink)
- QuickstartCopy-paste calls in curl, Python, Node, the Anthropic SDK and plain fetch.
- Base URLsTwo billing surfaces, two base URLs. Your key belongs to one of them.
- AuthenticationKey format, headers, expiry, suspension, and what each failure returns.
- ModelsEvery model id you can pass, with context window and capabilities.
- Client setupCursor, Cline, Roo Code, Continue, Claude Code, and anything OpenAI-compatible.
- Checking usageRead your balance, budget and recent requests without an account.
- ErrorsEvery status and code the gateway returns, and what to do about each.