OpenAI-compatible Claude API

Lumosel supports the OpenAI chat completions format. Point any OpenAI SDK at Lumosel and call Claude models without changing your code. One endpoint —/v1/chat/completions — works with every OpenAI-compatible client.

How to migrate from OpenAI to Claude

If your application already uses the OpenAI SDK, migrating to Claude takes exactly two changes:

  1. 1Change base_url to https://api.lumosel.vip
  2. 2Change model to a Claude model ID like claude-opus-4-8

Code examples

Python (OpenAI SDK)

# pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://api.lumosel.vip/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello, Claude"}],
)
print(response.choices[0].message.content)

Node.js (OpenAI SDK)

// npm install openai
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.lumosel.vip/v1",
  apiKey: "YOUR_API_KEY",
});

const response = await client.chat.completions.create({
  model: "claude-opus-4-8",
  messages: [{ role: "user", content: "Hello, Claude" }],
});
console.log(response.choices[0].message.content);

cURL

curl https://api.lumosel.vip/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'

What works

Supported

  • Chat completions (JSON and streaming)
  • OpenAI Python SDK
  • OpenAI Node.js SDK
  • cURL and raw HTTP
  • Claude models (Opus, Sonnet, Haiku)
  • GPT-5.5 and other models

Not supported

  • Function calling (use the Anthropic Messages API with tool use instead)
  • Vision/image input through the OpenAI format
  • Embeddings
  • Audio/whisper
  • Fine-tuning

For full Claude API features (tool use, vision, prompt caching, token counting), use the Anthropic Messages API endpoint.

Try it free for 14 days

No credit card required. Get your API key and switch your base URL.

Start free trial →