LluoluoAI

Developer integration guide

Claude Messages API-Compatible Endpoint

Use the Anthropic SDK request format with an independently operated gateway. Configure the base URL, preserve the required headers, and verify behavior before production.

node / anthropic-compatible
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.LUOLUO_API_KEY,
  baseURL: "https://api.luoluocoder.com",
});

const message = await client.messages.create({
  model: "claude-sonnet-4-5",
  max_tokens: 512,
  messages: [{ role: "user", content: "Hello" }],
});
Quick start

Keep the Messages request format your application already understands.

01

Create a development key

Use a separate key for testing and keep it in an environment variable.

02

Set the base URL

Use https://api.luoluocoder.com when the SDK appends /v1.

03

Select a live route

Choose an exact Claude-compatible model ID listed by the service.

Implementation

Anthropic SDK and direct HTTP examples.

Node.js with the Anthropic SDK

npm install @anthropic-ai/sdk

import Anthropic from "@anthropic-ai/sdk";

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

const message = await client.messages.create({
  model: "claude-sonnet-4-5",
  max_tokens: 512,
  messages: [{ role: "user", content: "Explain API gateways briefly." }],
});

console.log(message.content);

cURL

curl https://api.luoluocoder.com/v1/messages \
  -H "x-api-key: $LUOLUO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 512,
    "messages": [{"role":"user","content":"Hello"}]
  }'
Some SDK versions append /v1 automatically. If you provide a base URL that already ends in /v1, verify that the final request path is not duplicated.
Production checks

Verify semantics, not only the HTTP status.

CheckWhat to verify
Headersx-api-key, anthropic-version, and content type reach the intended route.
Content blocksYour client handles text and non-text content blocks without assuming a single string.
Streaming eventsEvent names, deltas, stop reasons, and termination match your parser.
Tool useTool input JSON and result blocks round-trip correctly.
Errors and retriesAuthentication, balance, rate limits, and upstream failures are handled separately.

Download additional examples from the public integration repository.

FAQ

Common questions about compatible Claude routes.

Is this an Anthropic-operated service?

No. luoluoAI is an independent developer API gateway. Compatibility with the Messages format does not imply affiliation or endorsement by Anthropic.

Should I hard-code one model ID?

Use a configured model ID, but check the live model list and have a migration plan because upstream capacity and routes can change.

Can I send production data immediately?

First review the service terms, data handling, retention expectations, and your own compliance requirements. Begin with non-sensitive development traffic.

Test your existing Messages integration.

Start with non-sensitive development traffic and a separate API key.

Create an account