Authentication
All requests include headerx-lala-key: <your API key>(or standardAuthorization: Bearer <key>)。
Apply for key: Email[email protected]or contact us via WhatsApp.
Model List
curl https://lala.buddylala.ai/v1/models -H "x-lala-key: $LALA_KEY"
| Model | Type | Endpoint | Documentation |
|---|---|---|---|
lala-6 | chat | /chat/completions | High-efficiency Multimodal Conversation (1M context) |
lala-6-pro | chat | /chat/completions | Flagship Multimodal Chat (1M context) |
lala-ultrafast | chat | /chat/completions | Ultra-fast inference chat (1M context) |
lala-super | chat | /chat/completions | Premium Flagship Inference |
lala-rag | embedding | /embeddings | Text Vectorization (RAG Retrieval) |
lala-image | image | /images/generations | Image Generation (Quality Priority) |
lala-video | video | /responses | Video Generation (Task-based, 4–30 seconds) |
lala-video-get | video | /responses | Query video task results |
lala-speech | tts | /responses | High-quality Speech Synthesis |
lala-music | music | /responses | Music Generation |
lala-lyric | lyric | /responses | Lyric Generation |
lala-decision | decision | /typesafe/systemone | Structured Decision (No Text Generation) |
Chat Completions
OpenAI-compatible. Supports stream: trueStreaming output.
curl
curl https://lala.buddylala.ai/v1/chat/completions \
-H "x-lala-key: $LALA_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lala-6",
"messages": [{"role": "user", "content": "Hello, introduce yourself"}],
"max_tokens": 500
}'
Python(openai SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://lala.buddylala.ai/v1",
api_key="***", # your lala key
)
resp = client.chat.completions.create(
model="lala-super",
messages=[{"role": "user", "content": "Write a poem about autumn"}],
)
print(resp.choices[0].message.content)
Node.js
const res = await fetch("https://lala.buddylala.ai/v1/chat/completions", {
method: "POST",
headers: {
"x-lala-key": process.env.LALA_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
model: "lala-ultrafast",
messages: [{ role: "user", content: "1+1=?" }],
stream: false,
}),
});
const data = await res.json();
console.log(data.choices[0].message.content);
Vector Embeddings
curl https://lala.buddylala.ai/v1/embeddings \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{"model": "lala-rag", "input": "Pet food retail automation"}'
Return standard OpenAI embeddings format (data[].embeddingVector array), can be directly fed into vector database for RAG.
Image Generation
curl https://lala.buddylala.ai/v1/images/generations \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{"model": "lala-image", "prompt": "a cute corgi puppy, studio photo", "n": 1}'
Returndata[].url(Image CDN link). Billing: fixed price per image, seePricing page。
Video Generation (Task-based)
Video GenerationTwo-stage: Submit task first to obtain task id, then poll for results.
Step 1: Submit Task
curl https://lala.buddylala.ai/v1/responses \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{
"model": "lala-video",
"input": [{"type": "text", "text": "a cat yawning in sunlight"}],
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true
}'
# → {"id": "cgt-xxxx", ...} ← Save this task ID!
Parameters:duration4–30 seconds (or -1 for smart selection)、resolution 480p/720p/1080p、ratio 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive、generate_audioDefault true (auto-configure voice/sound effects/background music).
Step 2: Poll Results
curl https://lala.buddylala.ai/v1/responses \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{"model": "lala-video-get", "input": "cgt-xxxx"}'
# status: succeeded when output[].content[].text = video download URL
Speech Synthesis (TTS)
curl https://lala.buddylala.ai/v1/responses \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{
"model": "lala-speech",
"input": "Hello, welcome to Buddylala",
"output_format": "hex",
"voice_setting": {"voice_id": "male-qn-qingse", "speed": 1, "vol": 1, "pitch": 0}
}'
# → {"data": {"audio": "<hex encoded audio>"}}
Convert hex to mp3:python3 -c "import binascii,sys; open('out.mp3','wb').write(binascii.unhexlify(sys.argv[1]))" "<hex>"80+ preset voice options, 9 emotion types.
Music Generation
curl https://lala.buddylala.ai/v1/responses \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{
"model": "lala-music",
"input": "upbeat jingle for a pet shop",
"lyrics": "la la la happy day with you"
}'
# → {"data": {"audio": "<hex>"}}
lyricsRequired (can use existing content first).lala-lyricGenerated).
Lyric Generation
curl https://lala.buddylala.ai/v1/responses \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{
"model": "lala-lyric",
"mode": "write_full_song",
"input": "An upbeat Cantonese song about cats"
}'
# → {"song_title": "...", "style_tags": "...", "lyrics": "[Verse]..."}
mode:write_full_song(complete song) oredit(Continue/modify, must include lyricsExisting content).
Structured Decision (Non-text Generation)
lala-decisionNo text generation, onlyStructured Decision: Provide a status segment (ticket/conversation/log) + a set of questions, return Choice / Score / Noul answers in parallel with calibrated probabilities.Support image recognition: Can attach up to 4 images (PNG/JPEG/WebP, each ≤4MiB, base64 embedded, no remote URLs) for joint analysis. Typical response 1–5 seconds, suitable for ticket routing, intent recognition, content moderation.
curl https://lala.buddylala.ai/typesafe/systemone \
-H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
-d '{
"model": "lala-decision",
"state": "Customer: my order is 5 days late and I want a refund!",
"questions": {
"urgency": {
"type": "choice",
"instructions": "Assess ticket urgency level",
"criteria": {"Low": "Calm tone", "Medium": "Dissatisfied but no deadline", "High": "Emotional or requesting refund"}
},
"refund_requested": {
"type": "noul",
"instructions": "Did customer explicitly request a refund?"
}
}
}'
# → {"answers": {"refund_requested": {"noul": 0.99, "type": "noul"}}, "model": "lala-decision", ...}
Question Type:choice(criteria is object: option name → judgment standard)、score(criteria is array: from low to high tier)、noul(true/false judgment, criteria not required)。
Image Recognition (Optional): Add to body"images": ["<base64 image>"](Maximum 4 images; each ≤4MiB, 16 megapixels; entire request body ≤13MiB; base64 embedded only, no URLs). Example:
{
"model": "lala-decision",
"images": ["iVBORw0KGgo...(base64 PNG)"],
"state": "Customer sent a receipt photo, requesting we review it",
"questions": {
"is_valid_receipt": {"type": "noul", "instructions": "Is the image a valid receipt?"}
}
}
Error Handling
| HTTP | Meaning | Processing |
|---|---|---|
| 401 | API key invalid or missing | Checkx-lala-key header |
| 400 | Model name does not exist / body format error | Refer to model list and respective endpoint examples |
| 5xx | Upstream occasional error | Exponential backoff retry (recommended maximum 3 attempts) |
Response text undergoes brand normalization (vendor-related terms unified to lala/buddylala brand naming), JSON structure and fields fully standardized, no impact on parsing.