Identity-aware AI gateway

The open-source, enterprise-ready AI gateway

Octelium is an open source, security-first, enterprise-ready AI gateway. Give every human and AI agent an identity, route each request dynamically across OpenAI, Anthropic, Gemini, Amazon Bedrock and compatible model servers, and understand exactly who uses which models, tokens and tools.

  • Open source and self-hosted
  • Four native provider protocols
  • Horizontally scalable on Kubernetes

Humans and AI agents access OpenAI, Anthropic, Gemini and Amazon Bedrock through an Octelium AI gateway. Each inference request is authenticated, authorized from identity and context, routed to an effective model and audited with token and tool usage.

policy.yaml
Identity-aware policyAuthorize the model and operation against the person or workload making the request.
Identity-aware policy. Authorize the model and operation against the person or workload making the request.
kind: Policy
metadata:
  name: production-inference
spec:
  rules:
    - effect: ALLOW
      condition:
        all:
          of:
            - match: ctx.request.llm.operation == "GENERATE"
            - match: ctx.request.llm.model in ["auto", "gpt-5"]
            - match: '"ai-platform" in ctx.user.spec.groups'
            - match: ctx.session.status.type == "CLIENT"
Dynamic model and reasoning. Make model and reasoning policy decisions from identity and request context.
spec:
  mode: LLM
  config:
    upstream:
      url: https://api.openai.com
    llm:
      protocol: OPENAI
      model:
        eval: |
          "ai-platform" in ctx.user.spec.groups
            ? "gpt-5" : "gpt-5-mini"
      reasoning:
        eval: |
          ctx.user.spec.type == "WORKLOAD"
            ? "LOW" : "HIGH"
Semantic routing. Route by intent instead of brittle keywords, with an explicit fallback model.
llm:
  plugins:
    - name: route-by-intent
      condition:
        match: ctx.request.llm.model == "auto"
      semanticRouter:
        fallbackModel: gpt-5-mini
        routes:
          - name: complex-engineering
            description: Architecture and debugging
            examples:
              - Diagnose this distributed deadlock
            model: gpt-5
            minSimilarity: 0.45
LLM visibilityLast 24 hours · all Services
UserModelProtocol
Total tokens
18.7M14.2M in · 4.5M out
Reasoning
1.3M2,406 managed requests
Cache hit rate
38.4%6,182 requests served
Quota denials
2718,942 allowed
Top token consumersupport-agent42%
Top effective modelgpt-5-mini48%
Top called toolsearch_docs3.1K
gpt-5-miniOPENAIsupport-agent · inference.prod
claude-sonnet-4ANTHROPICmaya@acme.com · research.ai
gemini-2.5-flashGEMINIdocs-bot · assistants.ai

Selected request

Requested modelauto
Effective modelgpt-5-mini
Total tokens2,244
Reasoning tokens184
Latency · TTFT842ms · 188ms TTFT
Identitysupport-agent
Token quotaALLOWED
Finish reasonSTOP
Inference pipelinerequest authorized
  1. 01Guardrailsdetect · redact · deny
  2. 02Tool controlsallow · remove · replace
  3. 03Semantic routerintent → model
  4. 04Prompt controlsprepend · replace · reject
  5. 05Semantic cacheexact + vector match
  6. 06Token quotauser · session · tenant
Modelgpt-5-mini
CacheMISS
Quota97.4K left
OpenAI
Anthropic
Gemini
AWS Bedrock
Mistral
Meta AI
DeepSeek
Kimi
Grok
Qwen
Z.AI
Ollama
Supported providers include OpenAI, Anthropic, Gemini, Amazon Bedrock, Mistral, Meta AI, DeepSeek, Kimi, Grok, Qwen, Z.AI and Ollama.
Secretless provider access

Applications identify themselves without a shared provider key

Provider credentials stay inside the Cluster and are injected only after a request is authenticated and authorized. Each client presents its own Octelium identity, giving access a clear owner and audit trail without distributing upstream secrets.

Read the secretless access guide
openai.yaml
OpenAI bearer tokenThe provider credential stays in a Secret and is injected only after authorization.
OpenAI bearer token. The provider credential stays in a Secret and is injected only after authorization.
kind: Service
metadata:
  name: inference
spec:
  mode: LLM
  isPublic: true
  config:
    upstream:
      url: https://api.openai.com
    llm:
      protocol: OPENAI
      auth:
        bearer:
          fromSecret: openai-api-key
Gemini API key. Custom header authentication supports provider-specific API key conventions.
kind: Service
metadata:
  name: gemini
spec:
  mode: LLM
  config:
    upstream:
      url: https://generativelanguage.googleapis.com/v1beta
    llm:
      protocol: GEMINI
      auth:
        custom:
          header: x-goog-api-key
          value:
            fromSecret: gemini-api-key
Amazon Bedrock SigV4. Native AWS Signature Version 4 support signs Bedrock requests inside the gateway.
spec:
  mode: LLM
  config:
    upstream:
      url: https://bedrock-runtime.us-east-1.amazonaws.com
    llm:
      protocol: BEDROCK
      auth:
        sigv4:
          accessKeyID: AKIAEXAMPLE
          secretAccessKey:
            fromSecret: aws-secret-access-key
          region: us-east-1
          service: bedrock
octeliumctl
octeliumctl apply ./ai-platform
$ octeliumctl apply ./ai-platform
Secret: model-provider-keys Updated
Policy: inference-access Created
Service: inference.ai Created
Service: embeddings.ai Created
Group: ai-platform Updated
IdentityProvider: workload-oidc Created
Cluster AI gateway configuration applied
 4 resources created
 2 resources updated

 Gateway data plane reconciled
Capability map

The controls behind an Octelium AI gateway

Each capability operates on the same authenticated and normalized request context, so access, routing, safety, efficiency and accountability do not drift into separate systems.

  1. 01

    Identity and context

    Human and workload identity, groups, session type, device posture and request attributes meet in one CEL or OPA authorization decision.

    Read more
  2. 02

    Dynamic models and reasoning

    A static value, CEL expression, Rego result or ordered plugin can choose the effective model and a portable reasoning level, exact token budget or provider-native effort.

    Read more
  3. 03

    Prompt and tool governance

    Prepend, append, replace, strip or reject instructions; inject messages; and allow, remove, deny, replace or add tool definitions.

    Read more
  4. 04

    Guardrails

    Inspect request content, instructions, tool definitions, tool results and completed responses using regex, PII detectors and secret detection.

    Read more
  5. 05

    Token-based rate limiting

    Reserve and reconcile input, output or total-token quotas over sliding windows, scoped per User, Session or an evaluated tenant key.

    Read more
  6. 06

    Semantic caching

    Reuse exact or semantically equivalent successful generations within a per-Session, per-User, shared or tenant-defined security partition.

    Read more
  7. 07

    Semantic routing

    Embed the request's semantic subject and select the highest-scoring model route, with a deterministic fallback when nothing matches.

    Read more
  8. 08

    Extensible request path

    Compose LLM-native controls with Lua, ExtProc, JSON Schema, direct responses, request rate limits and path plugins.

    Read more

A generic reverse proxy sees an HTTP request. Octelium sees the identity, inference operation, model, reasoning, prompts, tools, token budget and the outcome of every control applied to them.

Questions

Frequently asked

Which AI providers and APIs does Octelium support?
The LLM mode natively understands OpenAI, Anthropic, Gemini and Amazon Bedrock protocols. It covers generation, streaming, embeddings, token counting, moderation and model discovery where the provider exposes those operations. OpenAI-compatible servers such as vLLM and Ollama work when they expose the canonical routes. Octelium validates and normalizes each protocol; it does not translate one provider's wire format into another.
What makes the AI gateway identity-aware?
Every request is tied to an Octelium human or workload User instead of relying on a shared provider key. Policies combine that identity, group membership, session type and device posture with normalized LLM attributes such as operation, requested model, streaming, modalities, tools and declared output tokens. The same context can choose an upstream account, model, reasoning level and plugin configuration dynamically.
Can Octelium route requests to different models dynamically?
Yes. Model and reasoning settings can be static, computed with CEL, returned by Open Policy Agent, or applied conditionally through plugins. Semantic routing classifies the meaning of a request against descriptions and examples and sends it to the best matching model. Dynamic Service configuration can additionally select a different upstream, provider account, credential, headers and complete LLM configuration.
How does token-based rate limiting work?
Token rate limiting applies a sliding-window quota to input, output or total inference tokens. Quotas can be keyed per User, per Session or by an evaluated value such as a tenant ID. Octelium reserves capacity before sending the request so concurrent requests observe one another, then reconciles the reservation with usage reported by the provider.
What does semantic caching store and how is it isolated?
The semantic cache can serve an exact repeat without an embedding call or find an earlier semantically equivalent request using vector similarity. The effective model, instructions, tools, reasoning, response schema and other execution context must still match. Cache partitions can be per Session, per User, shared or derived from context for tenant isolation. A cache hit uses no inference quota and still passes current response guardrails.
Which guardrails and prompt controls are available?
Guardrails inspect instructions, content, tool definitions, tool results and generated responses. They support RE2 patterns, built-in PII detectors and broad secret detection. Matching content can be denied, redacted, stripped or replaced where mutation is safe. Prompt plugins can prepend, append, replace, strip or reject system instructions and insert or modify user and assistant messages.
What can teams see about AI usage?
Identity-aware AccessLogs record who used which Service and model, requested and effective models, protocol, operation, routing decision, reasoning, finish reason, tools, guardrails, cache and quota outcomes, latency, time to first token and reported input, output, cached and reasoning token usage. The enterprise console aggregates these fields into trends, breakdowns and top users, models and tools.
Is Octelium self-hosted and horizontally scalable?
Yes. Octelium is free and open source, has no mandatory hosted control plane and runs on Kubernetes infrastructure you control. Production deployments distribute the data plane across Gateway nodes and scale it horizontally with Kubernetes. The same Cluster can deploy and scale containerized self-hosted inference servers as managed Service upstreams.
Do applications receive the upstream provider credentials?
No. Applications authenticate to Octelium with their own identity. Provider bearer tokens, custom API keys, OAuth2 client credentials, basic credentials and AWS SigV4 secrets stay in the Cluster and are injected only after authorization.
Get started

Deploy Octelium on your own infrastructure in minutes

Free and open source. Self-hosted. No vendor lock-in.