from openai import OpenAI
client = OpenAI(
base_url="https://api.livellmapi.com/v1",
api_key="YOUR_LIVELLMAPI_KEY",
)
resp = client.chat.completions.create(
model="qwen3.8-max-prime",
messages=[{"role": "user", "content": "Explain consistent hashing in 3 bullets."}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.livellmapi.com/v1",
apiKey: process.env.LIVELLMAPI_KEY,
});
const resp = await client.chat.completions.create({
model: "qwen3.8-max-prime",
messages: [{ role: "user", content: "Explain consistent hashing in 3 bullets." }],
});
console.log(resp.choices[0].message.content);
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max-prime",
"messages": [{"role": "user", "content": "Explain consistent hashing in 3 bullets."}]
}'
const stream = await client.chat.completions.create({
model: "qwen3.8-max-prime",
stream: true,
messages: [{ role: "user", content: "Write a short SQL migration helper." }],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max-prime",
"messages": [{"role": "user", "content": "What is the weather in Tokyo?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}]
}'