Laalaa Docs

Anthropic SDK

Change one constructor option — the rest of your code is untouched.

Base URL for this toolhttps://api.laalaa.me
Protocol/v1/messages (Anthropic)

Python

bash
pip install anthropic
python
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.laalaa.me",
    api_key="sk-xxxxxxxxxxxx",
)

msg = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)

TypeScript

bash
npm install @anthropic-ai/sdk
typescript
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({  baseURL: "https://api.laalaa.me",  apiKey: "sk-xxxxxxxxxxxx",}); const msg = await client.messages.create({  model: "claude-opus-4-8",  max_tokens: 1024,  messages: [{ role: "user", content: "Hello" }],});console.log(msg.content[0].text);

Notes

The Anthropic SDK appends /v1/messages itself — your base URL must NOT include /v1.

Other tools

ទំព័រនេះមានប្រយោជន៍?