Create a development key
Use a separate key for testing and keep it in an environment variable.
Developer integration guide
Use the Anthropic SDK request format with an independently operated gateway. Configure the base URL, preserve the required headers, and verify behavior before production.
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" }],
});Use a separate key for testing and keep it in an environment variable.
Use https://api.luoluocoder.com when the SDK appends /v1.
Choose an exact Claude-compatible model ID listed by the service.
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 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"}]
}'/v1 automatically. If you provide a base URL that already ends in /v1, verify that the final request path is not duplicated.| Check | What to verify |
|---|---|
| Headers | x-api-key, anthropic-version, and content type reach the intended route. |
| Content blocks | Your client handles text and non-text content blocks without assuming a single string. |
| Streaming events | Event names, deltas, stop reasons, and termination match your parser. |
| Tool use | Tool input JSON and result blocks round-trip correctly. |
| Errors and retries | Authentication, balance, rate limits, and upstream failures are handled separately. |
Download additional examples from the public integration repository.
No. luoluoAI is an independent developer API gateway. Compatibility with the Messages format does not imply affiliation or endorsement by Anthropic.
Use a configured model ID, but check the live model list and have a migration plan because upstream capacity and routes can change.
First review the service terms, data handling, retention expectations, and your own compliance requirements. Begin with non-sensitive development traffic.
Start with non-sensitive development traffic and a separate API key.