Migrating to Selixes Gateway
Selixes is engineered as a wire-compatible drop-in proxy for the official OpenAI SDK. Migrating your existing applications requires only updating your clientโs baseURL to point to your Selixes instance. No prompt schema or SDK wrapper rewrites are necessary.
2-Line SDK Configuration Swap
Update your client initialization in Node.js or Python to route transit through Selixes:
// Node.js (OpenAI SDK)
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'http://localhost:4000/v1', // Point to your Selixes Gateway instance
apiKey: process.env.OPENAI_API_KEY, // Provider key passed directly
});Custom Header Primitives
Activate gateway resilience and budget guards by adding standard HTTP headers to your requests:
| HTTP Header | Value / Type | Purpose |
|---|---|---|
x-selixes-session-id | String (UUID/Slug) | Tracks multi-turn trajectory and reasoning spend |
x-selixes-max-session-cost | Float (e.g. 0.50) | Hard USD spending cap across an agent run |
x-selixes-max-concurrent-calls | Integer (e.g. 5) | Limits parallel agent worker bursts |
x-selixes-timeout | Integer (ms) | Per-request timeout before failover standby trigger |