Home/Docs/Getting Started
Quickstart Playbook

Time to First Request: 5 Minutes

Follow this playbook to deploy your AI Reliability Layer locally. You will route your first request, trigger a failover, and view the AI-native telemetry in under 5 minutes.

โšก Quick SummaryTo deploy Selixes, launch the Docker container on port 4000 and generate an API key. Next, swap the baseURL in your standard OpenAI SDK to http://localhost:4000/v1 and supply your Selixes key. Selixes operates as an in-VPC reverse proxy, automatically routing requests across OpenAI, Anthropic, Gemini, and local Ollama while enforcing session cost limits and autonomous failover during upstream outages.

Step 1: Launch via Docker Compose (60 Seconds)

Clone the open-source repository and launch the full gateway stack with Redis and Postgres in one command:

git clone https://github.com/selixes/gateway.git
cd gateway
cp .env.example .env
docker compose up -d

Alternatively, run the pre-built GHCR image directly on port 4000:

docker run -d -p 4000:4000 --name selixes-gateway ghcr.io/selixes/gateway:latest

*(Verify health anytime with curl http://localhost:4000/health).*

Step 2: 2-Line SDK Drop-in

Selixes is fully compatible with the standard OpenAI SDK. Swap the `baseURL` and `apiKey` to point your existing application to the local reliability layer:

import OpenAI from 'openai';

// Selixes integration takes exactly 2 lines:
const openai = new OpenAI({
  apiKey: process.env.SELIXES_API_KEY,     // 1. Secure reliability key
  baseURL: 'http://localhost:4000/v1'      // 2. Swapped base URL
});

Step 3: Dispatch Your First Reliable Request

Pass transaction cost caps, timeout limits, and semantic caching directives directly through standard HTTP request headers:

const response = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'Extract details from CSV invoices' }],
  headers: {
    'x-selixes-session-id': 'session_crm_batch_02',
    'x-selixes-max-session-cost': '0.15', // Autonomous block if spend exceeds $0.15
    'x-selixes-semantic-cache': 'true',   // Serve from vector DB if similar prompt exists
    'x-selixes-timeout': '5000'           // Instantly failover to Anthropic if OpenAI takes > 5s
  }
});

Step 4: Verify Health & Telemetry

Selixes provides sub-millisecond status endpoints and structured audit telemetry. Test the live health endpoint:

curl -s http://localhost:4000/health | jq .

Open the companion telemetry console at http://localhost:3000 to review active transactions, provider failovers, and latency economics.

Next Up: Primitives & Routing

Learn how autonomic failovers and local Ollama continuity backups operate under the hood.

Read Core Concepts ->