Integration Guide

OpenAI Compatibility

Lumyx AI provides full OpenAI API compatibility, making it easy to migrate existing applications or use the official OpenAI SDKs with our platform.

Compatibility Overview

Lumyx AI implements the OpenAI API specification, allowing you to use:

Official SDKs

Use OpenAI's official Python and Node.js SDKs with Lumyx AI endpoints.

Drop-in Replacement

Switch from OpenAI to Lumyx AI by changing just the base URL and API key.

Same Request Format

Use the same JSON request format you're familiar with from OpenAI.

Streaming Support

Full SSE streaming support, identical to OpenAI's implementation.

Configuration

To use Lumyx AI with OpenAI SDKs, simply change the base URL and API key:

Python SDK

Python
from openai import OpenAI

# Configure for Lumyx AI
client = OpenAI(
    api_key="nova_your_api_key_here",
    base_url="https://api.lumyx-ai.site/v1"
)

# Use exactly like OpenAI
response = client.chat.completions.create(
    model="nova_1_1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

Node.js SDK

JavaScript
import OpenAI from 'openai';

// Configure for Lumyx AI
const client = new OpenAI({
  apiKey: 'nova_your_api_key_here',
  baseURL: 'https://api.lumyx-ai.site/v1'
});

// Use exactly like OpenAI
const response = await client.chat.completions.create({
  model: 'nova_1_1',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello!' }
  ]
});

console.log(response.choices[0].message.content);

Environment Variables

Environment Variables
# .env file
OPENAI_API_KEY=nova_your_api_key_here
OPENAI_BASE_URL=https://api.lumyx-ai.site/v1

Many OpenAI-compatible libraries automatically read these environment variables.

Supported Endpoints

Endpoint Lumyx AI Path Status
Chat Completions /api/v1/chat/completions ✓ Supported
Models List /api/v1/models ✓ Supported
Model Details /api/v1/models/{id} ✓ Supported
Agents Chat /api/v1/agents/chat/completions Nova Exclusive
Personas /api/v1/personas Nova Exclusive
Embeddings /api/v1/embeddings Coming Soon
Audio /api/v1/audio/* Coming Soon
Images /api/v1/images/* Coming Soon

Supported Chat Completion Parameters

Request Parameters

model string

ID of the model to use. See models for available options.

messages array

A list of messages comprising the conversation. Supports system, user, and assistant roles.

temperature number

Sampling temperature between 0 and 2. Higher values make output more random.

max_tokens integer

Maximum number of tokens to generate in the response.

stream boolean

If true, partial message deltas will be sent as Server-Sent Events.

top_p number

Nucleus sampling parameter. Consider tokens with top_p probability mass.

stop string/array

Up to 4 sequences where the API will stop generating further tokens.

presence_penalty number

Penalizes new tokens based on whether they appear in the text so far.

frequency_penalty number

Penalizes new tokens based on their frequency in the text so far.

seed integer

If specified, outputs are deterministic (best effort).

Lumyx AI Exclusive Features

While maintaining OpenAI compatibility, Lumyx AI offers additional features:

🤖 AI Personas

Specialized AI agents with unique personalities and expertise areas.

Learn more →

🧠 Thinking Mode

See the AI's reasoning process with step-by-step thinking.

Learn more →

📚 Training Data

Add custom knowledge to personas for domain-specific responses.

Learn more →

💬 Conversation History

Built-in conversation management with UUID-based tracking.

Learn more →

Migration from OpenAI

Migrating from OpenAI to Lumyx AI is straightforward:

Step 1: Install SDK (if not already)

Installation
# Python
pip install openai

# Node.js
npm install openai

Step 2: Get a Lumyx AI API Key

  1. Go to your Developer Dashboard
  2. Click "Create New API Key"
  3. Name your key and set rate limits
  4. Copy the generated key (starts with nova_)

Step 3: Update Your Code

Before (OpenAI)
client = OpenAI(
    api_key="sk-..."
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[...]
)
After (Lumyx AI)
client = OpenAI(
    api_key="nova_...",
    base_url="https://api.lumyx-ai.site/v1"
)

response = client.chat.completions.create(
    model="nova_1_1",  # Use Lumyx AI model
    messages=[...]
)

Step 4: Update Model Names

Replace OpenAI model names with Lumyx AI equivalents:

OpenAI Model Lumyx AI Equivalent
gpt-4 nova_1_1
gpt-4-turbo nova_1_1
gpt-3.5-turbo nova_1_1
That's it!

Your application should now work with Lumyx AI. The response format is identical to OpenAI, so no other changes are needed.