LluoluoAI

Developer integration guide

OpenAI-Compatible API for Python and Node.js

Keep the OpenAI SDK you already use. Change the base URL, select a live model, and test the compatibility details that matter before production.

python / openai-compatible
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["LUOLUO_API_KEY"],
    base_url="https://api.luoluocoder.com/v1",
)

response = client.chat.completions.create(
    model="gpt-5.4-mini",
    messages=[{"role": "user", "content": "Hello"}],
)
Quick start

Make the first request without rewriting your application.

01

Create a key

Create a separate API key for development and keep it outside source control.

02

Change the base URL

Set the SDK base URL to https://api.luoluocoder.com/v1.

03

Choose a live model

Query GET /v1/models and use an exact model ID returned by the service.

Implementation

Working examples for the official OpenAI SDK.

Python

pip install openai

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["LUOLUO_API_KEY"],
    base_url="https://api.luoluocoder.com/v1",
    timeout=60.0,
)

stream = client.chat.completions.create(
    model="gpt-5.4-mini",
    messages=[{"role": "user", "content": "Explain API gateways briefly."}],
    stream=True,
)

for chunk in stream:
    text = chunk.choices[0].delta.content
    if text:
        print(text, end="", flush=True)

Node.js

npm install openai

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LUOLUO_API_KEY,
  baseURL: "https://api.luoluocoder.com/v1",
  timeout: 60_000,
});

const stream = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [{ role: "user", content: "Explain API gateways briefly." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
Use the live model list instead of assuming that a model alias remains available. Upstream capacity and configured routes can change.
Evaluation

“Compatible” should be tested feature by feature.

CheckWhy it matters
Streaming chunksDelta fields and stream termination must match your client assumptions.
Tool callingTool names, arguments, and finish reasons can differ between routes.
Error objectsYour retry logic should distinguish authentication, balance, rate limits, and upstream failures.
Usage fieldsVerify token accounting before using it for customer billing.
Timeouts and retriesUse bounded retries and do not retry every 4xx response.

For a reusable test project, see the open-source Python, Node.js, and cURL examples.

FAQ

Questions to answer before switching an endpoint.

Is luoluoAI affiliated with OpenAI?

No. luoluoAI is an independent developer API gateway. SDK and API compatibility do not imply affiliation or endorsement.

Can I use the same SDK configuration in production?

Yes, but first test streaming, tool calls, structured output, errors, latency, rate limits, and usage accounting for the exact model route you plan to use.

Where are current model IDs and prices listed?

Use the Model Plaza for configured models and pricing, and query GET /v1/models for the live list.

Run a compatibility test with your existing SDK.

Start with a separate development key and one low-risk workflow.

Create an account