Quick Start Guide

Integrate XVariant in minutes. Choose what you want to test and start running experiments with just a few lines of code.

LLM Experiments

Test different models, prompts, and parameters without changing code.

  • OpenAI-compatible gateway
  • Transparent routing
  • Automatic cost tracking

Feature Flags

Gradually roll out features and control access by user segment.

  • Percentage rollouts
  • Targeting rules
  • Instant kill switches
A B

A/B Tests

Test pricing, copy, and design changes with statistical confidence.

  • Sequential testing
  • Confidence intervals
  • Guardrail metrics

2-Minute Integration

import openai
from uuid import uuid4

# 1. Point your OpenAI client to XVariant Gateway
client = openai.OpenAI(
    api_key="xv_your_api_key_here",
    base_url="https://gateway.xvariant.io/v1"
)

# 2. Add tracking headers to your requests
session_id = str(uuid4())
user_id = "user_12345"

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
    extra_headers={
        "X-XVariant-Session-ID": session_id,
        "X-XVariant-Unit-ID": user_id
    }
)

# 3. That's it! Experiments are managed from the dashboard
print(response.choices[0].message.content)
import OpenAI from 'openai';
import { v4 as uuidv4 } from 'uuid';

// 1. Point your OpenAI client to XVariant Gateway
const client = new OpenAI({
  apiKey: 'xv_your_api_key_here',
  baseURL: 'https://gateway.xvariant.io/v1'
});

// 2. Add tracking headers to your requests
const sessionId = uuidv4();
const userId = "user_12345";

const response = await client.chat.completions.create({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'Hello!' }]
}, {
  headers: {
    'X-XVariant-Session-ID': sessionId,
    'X-XVariant-Unit-ID': userId
  }
});

// 3. That's it! Experiments are managed from the dashboard
console.log(response.choices[0].message.content);

What happens:

Ready to see it in action?

Book a demo to learn how XVariant can help you optimize your product with confidence.

Book Demo Back to Home