Anthropic SDK
Change one constructor option — the rest of your code is untouched.
Base URL for this tool
https://api.laalaa.meProtocol
/v1/messages (Anthropic)Python
bash
pip install anthropicpython
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/sdktypescript
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
ទំព័រនេះមានប្រយោជន៍?