GET STARTED

Quickstart

Run OmniSwitch locally and send your first model request.

Updated · Public beta

1. Build the gateway

This guide uses a pinned development source. You need Git, Go 1.26 or newer, and a provider API key.

Build OmniSwitchShell
git clone https://github.com/omniswitch-dev/omniswitch.git
cd omniswitch
git checkout 5df77bbb1852ac02faa92ce8fcfffca2bcabe6dc
go build -o omniswitch ./cmd/gateway
Docker & Kubernetes deployment

2. Configure and start

Save this as omniswitch.yaml. The gateway listens on your machine only, with authentication enabled.

omniswitch.yamlYAML
apiVersion: omniswitch.dev/v1
kind: GatewayConfig
gateway:
  listen: "127.0.0.1:8080"
  auth: true
  cache_scope: api_key
  log_payloads: false
providers:
  - name: openai
    type: openai
    api_key_env: OPENAI_API_KEY
Start the gatewayShell
export OPENAI_API_KEY="your-provider-key"
export OMNISWITCH_BOOTSTRAP_API_KEY="$(openssl rand -hex 32)"
export OMNISWITCH_KEY="$OMNISWITCH_BOOTSTRAP_API_KEY"
OMNISWITCH_CONFIG=omniswitch.yaml ./omniswitch serve

Keep this terminal running. In a second terminal, set OMNISWITCH_KEY to the same gateway key. Keep both keys private.

3. Send a request

Install the clientShell
python -m pip install openai
Make a model requestPython
import os
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8080/v1",
    api_key=os.environ["OMNISWITCH_KEY"],
)
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Open http://localhost:8080/ for the dashboard. Use named gateway keys for applications after the initial setup.