---
title: "Speko Gateway for LiveKit"
description: "Run the open Speko Gateway beside a LiveKit AgentSession for provider-direct voice legs and optional managed Router LLMs."
canonical: "https://speko.ai/docs/livekit"
last-updated: "2026-08-24"
---

> ## Speko page index
> The complete index of every page on this site is at: https://speko.ai/llms.txt
> Read it before exploring further. It lists the exact Markdown URL for every canonical HTML page.

# Speko Gateway for LiveKit

Docs

Run the open Speko Gateway beside a LiveKit AgentSession for provider-direct voice legs and optional managed Router LLMs.

## Use the native Gateway integration

Speko Gateway is a customer-side runtime that runs in the same image or beside the LiveKit agent. It is not an OpenAI-compatible base URL. The public Gateway image includes the binary and Python integration; follow the complete container diff in the[Gateway README](https://github.com/SpekoAI/gateway#add-gateway-to-a-livekit-agent).

```python
from livekit.agents import AgentSession
from livekit.plugins import openai
from speko_gateway.livekit import LLM, STT, TTS

session = AgentSession(
    stt=STT(
        language="en",
        credential_source="auto",  # managed or local BYOK
    ),
    llm=LLM(
        model="auto",
        objective="balanced",
        max_output_tokens=8192,
    ),
    tts=TTS(
        language="en",
        credential_source="auto",
    ),
)
```

## Managed credentials

```text
lk agent update-secrets \
  --secrets "SPEKO_LOCAL_AUTH_TOKEN=$(openssl rand -hex 32)" \
  --secrets "SPEKO_API_KEY=$SPEKO_API_KEY"
```

## Local BYOK credentials

```text
lk agent update-secrets \
  --secrets "SPEKO_LOCAL_AUTH_TOKEN=$(openssl rand -hex 32)" \
  --secrets "SPEKO_DEEPGRAM_BYOK_API_KEY=$DEEPGRAM_API_KEY"
```

## Choose the trust boundary

|  |  |
| --- | --- |
| `Managed` | Gateway requests Speko-managed routes; Router handles the hosted LLM data plane. |
| `BYOK` | Provider credentials stay inside the Gateway process and provider-direct voice traffic does not traverse Router. |
| `Mixed` | Use BYOK for selected voice legs and a Speko API key for managed or Router-backed work. |
