Skip to content

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.

  1. Take the key you were issued. Every key starts with kl_live_.
  2. Take the base URL for your key’s surface: https://api.korlogic.com/v1 for a credit key, https://api.korlogic.com/token/v1 for a token key.
  3. Send a chat completion.
ShellCredit surface
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.

Base URL for each billing surface
SurfaceYour key spendsBase URL
CreditA balance in US dollars, priced per modelhttps://api.korlogic.com/v1
TokenA fixed prepaid token budgethttps://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:

Supported endpoints
MethodPathWhat it is
POST/chat/completionsOpenAI Chat Completions. The default for most clients.
POST/messagesAnthropic Messages, for Anthropic SDKs and Claude Code.
POST/responsesOpenAI Responses, on models that support it.
GET/modelsThe 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)