Skip to content

The Kaeso gateway, one Rust binary between your apps and your providers. It checks every key and limit, translates every format and logs every request.

Step 1 of 8

Key

The API key decides the project and the member or service account it acts for. Keys are stored only as hashes and answered from memory for 30 seconds.

What the app can get
  • 401UnauthorizedThe key is missing, unknown, disabled, archived or expired.
  • 403ForbiddenThe key has platform access only, or its member lacks the right api.request.
  • 429Rate limitedToo many requests with unknown keys came from the same address.

The gateway reads the key from x-api-key, or else from Authorization: Bearer:

x-api-key: sk-kso-…Authorization: Bearer sk-kso-…

What the gateway does with every request.

Keys that stay in the gateway, state in stores you already run, and a service you operate like any other.

Keys stay in the gateway

Provider keys never reach your apps, and every action in the console is checked against one right.

Read about provider keys (opens in a new tab)
What your apps holdsk-kso-AbC1…wxyzInference

A Kaeso key, stored only as a hash, with an expiry and inference or platform access.

What the gateway holdsOpenAIAnthropicAES-256-GCM

Provider keys, envelope-encrypted with AES-256-GCM under a master key ring you hold. Rotate the master key with kaeso master-key rewrap.

Sign-in
Password with an authenticator app and recovery codes, sign-in links, and single sign‑on through each organization's OIDC provider
Rights
Fine-grained rights with built-in roles and up to 50 custom roles per organization
Audit logs
For the instance, every organization and every project

State in stores you know

Gateway instances keep nothing of their own, so you add more behind your load balancer. They share one PostgreSQL, ClickHouse and Valkey.

Read the architecture (opens in a new tab)
PostgreSQL
Keys, catalogue, limits, usage and audit logs
ClickHouse
Request logs and usage rollups
Valkey
Rate and budget counters, shared caches

Run it like any service

Configure it with KAESO_* variables or a TOML file, read every secret from a file, and watch it with the tools you already run.

Read the configuration (opens in a new tab)
1listen = "0.0.0.0:8080"2public_url = "https://kaeso.example.com"3 4[providers.anthropic]5base_url = "https://api.anthropic.com"6 7[upstream]8request_timeout = "600s"9 10[logs]11buffer_size = "256MiB"
Metrics
Prometheus on port 9100, which Caddy doesn't route; keep it private
Health
/healthz while the process runs, and /readyz with the state of PostgreSQL, Valkey and ClickHouse
Logs
Structured JSON, and request logs kept 90 days, content 30 days, by default
Streams
Keepalives every 15 seconds; the provider call is cancelled when the app goes away

One repository, one version.

The gateway, the console, KPP and Kaeso UI ship together, MIT licensed.

Browse the source on GitHub (opens in a new tab)

Put it in front of your apps.

One Compose file with Caddy, the gateway, the console, PostgreSQL, ClickHouse and Valkey, on your own servers.