Plurence is currently in Public Beta. Features and pricing may change. Not recommended for production workloads. Beta Terms

Integration Guides

OpenAI SDK Drop-in

Plurence is fully compatible with the OpenAI API. Swap in Plurence by changing one line — no other code changes required.

Python

before
from openai import OpenAI

client = OpenAI(api_key="sk-...")  # OpenAI key
after — one change
from openai import OpenAI

client = OpenAI(
    api_key="plr_live_...",           # your Plurence API key
    base_url="https://gateway.plurence.com/v1",
)

Everything else — models, messages, streaming, function calling — stays the same.

Node / TypeScript

before
import OpenAI from 'openai';

const client = new OpenAI({ apiKey: 'sk-...' });
after — one change
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'plr_live_...',
  baseURL: 'https://gateway.plurence.com/v1',
});

Environment variable pattern

The cleanest approach is to keep credentials in environment variables:

.env
OPENAI_API_KEY=plr_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_BASE_URL=https://gateway.plurence.com/v1
python — zero changes
from openai import OpenAI

# Reads OPENAI_API_KEY and OPENAI_BASE_URL automatically
client = OpenAI()

The OpenAI SDK picks up OPENAI_BASE_URL automatically — no code changes at all.

Accessing non-OpenAI models

Once pointing at Plurence, you can route to Anthropic or Google models by just changing the model name:

python
# OpenAI model
client.chat.completions.create(model="gpt-4o-mini", messages=[...])

# Anthropic model — same client, same code
client.chat.completions.create(model="claude-3-5-haiku-20241022", messages=[...])

# Google model
client.chat.completions.create(model="gemini-1.5-flash", messages=[...])

Related