lala Models API — 開発者ドキュメント

1 つの API key で、lala 全自社モデルスイートを呼び出します。OpenAI-compatible インターフェース、ベース URL:https://lala.buddylala.ai/v1

認証

すべてのリクエストに header を含めるx-lala-key: <あなたの API key>(または標準Authorization: Bearer <key>)。

申請 key:メール[email protected]または WhatsApp 経由でお問い合わせください。

API key は適切に保管し、フロントエンドコードにハードコーディングしたり、公開リポジトリに公開しないでください。

モデルリスト

curl https://lala.buddylala.ai/v1/models -H "x-lala-key: $LALA_KEY"
モデルタイプEndpoint説明
lala-6chat/chat/completions高効率マルチモーダル対話(1M context)
lala-6-prochat/chat/completionsフラッグシップマルチモーダル対話(1M context)
lala-ultrafastchat/chat/completions超高速推論対話(1M context)
lala-superchat/chat/completionsトップティアフラッグシップ推論
lala-ragembedding/embeddingsテキストベクトル化(RAG 検索)
lala-imageimage/images/generations画像生成(品質優先)
lala-videovideo/responsesビデオ生成(タスク型、4–30 秒)
lala-video-getvideo/responsesビデオタスク結果を照会
lala-speechtts/responses高品質音声合成
lala-musicmusic/responses音楽生成
lala-lyriclyric/responses歌詞生成
lala-decisiondecision/typesafe/systemone構造化判研(テキスト生成なし)

対話 Chat Completions

OpenAI-compatible。サポート stream: trueストリーミング出力。

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": "你好,介紹下自己"}],
    "max_tokens": 500
  }'

Python(openai SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://lala.buddylala.ai/v1",
    api_key="***",   # 你的 lala key
)

resp = client.chat.completions.create(
    model="lala-super",
    messages=[{"role": "user", "content": "寫一首關於秋天的詩"}],
)
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);

ベクトル Embeddings

curl https://lala.buddylala.ai/v1/embeddings \
  -H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
  -d '{"model": "lala-rag", "input": "寵物食品零售自動化"}'

回傳標準 OpenAI embeddings 形式(data[].embeddingベクトル配列)、ベクトルデータベースに直接入力して RAG を実行できます。

画像生成 Image

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}'

回傳 data[].url(画像 CDN リンク)。課金:1枚あたり固定価格、詳細は価格ページ。

ビデオ生成 Video(タスク型)

ビデオ生成係2段階式:先提交任務攞 task id,再輪詢攞結果。

ステップ 1:タスクを送信

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", ...}   ← 保存此任務識別碼!

パラメータ:duration4–30 秒(または -1 スマート選択)、resolution 480p/720p/1080p、ratio 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive、generate_audioデフォルト true(自動で人声/効果音/背景音楽を配置)。

ステップ 2:ポーリング結果

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 時 output[].content[].text = 視頻下載 URL
タスク ID が失われると結果を取得できません(費用は発生済み)。レンダリングには約 1–5 分かかります。15–30 秒ごとにポーリングすることをお勧めします。

音声合成 Speech (TTS)

curl https://lala.buddylala.ai/v1/responses \
  -H "x-lala-key: $LALA_KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "lala-speech",
    "input": "你好,歡迎致電 Buddylala",
    "output_format": "hex",
    "voice_setting": {"voice_id": "male-qn-qingse", "speed": 1, "vol": 1, "pitch": 0}
  }'
# → {"data": {"audio": "<hex 編碼音頻>"}}

hex を mp3 に変換:python3 -c "import binascii,sys; open('out.mp3','wb').write(binascii.unhexlify(sys.argv[1]))" "<hex>"。80+ プリセット音色、9 種類の感情。

音楽生成 Music

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>"}}

lyrics必須(事前に lala-lyric生成)。

歌詞生成 Lyric

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": "一首關於貓的輕快廣東歌"
  }'
# → {"song_title": "...", "style_tags": "...", "lyrics": "[Verse]..."}

mode:write_full_song(完全な楽曲)またはedit(続き書き/修正、必要な場合は lyrics既存コンテンツ)。

構造化判研 Decision(非テキスト生成)

lala-decisionテキストを生成せず、のみ実行構造化判断:1 つの状態(ワークオーダー/会話/ログ)+1 組の質問を並行して返し、Choice / Score / Noul 3 種類の回答を校準確率付きで返します。画像判断をサポート:最大 4 枚の画像(PNG/JPEG/WebP、各 ≤4MiB、base64 内埋め込み、リモート URL は不可)を一緒に分析できます。典型的な応答時間 1~5 秒で、ワークオーダー配分、意図識別、コンテンツリスク管理に適しています。

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": "ワークオーダーの緊急度を判定する",
"criteria": {"低": "語気が穏やか", "中": "不満があるが期限なし", "高": "感情的または返金要求"}
      },
      "refund_requested": {
        "type": "noul",
"instructions": "顧客が明確に返金をリクエストしているか?"
      }
    }
  }'
# → {"answers": {"refund_requested": {"noul": 0.99, "type": "noul"}}, "model": "lala-decision", ...}

問題タイプ:choice(criteria は object:オプション名→判定基準)、score(criteria は array:低から高グレード)、noul(true/false 判断、criteria 不要)。

画像判断(オプション):body に追加"images": ["<base64 画像>"](最大 4 枚;各ファイル ≤4MiB、16 megapixels;リクエスト本体全体 ≤13MiB;base64 埋め込みのみ対応、URL は非対応)。例:

{
  "model": "lala-decision",
  "images": ["iVBORw0KGgo...(base64 PNG)"],
"state": "顧客がレシート写真を送信し、確認を要求しています",
  "questions": {
"is_valid_receipt": {"type": "noul", "instructions": "画像は有効なレシートですか?"}
  }
}

エラー処理

HTTP含義処理
401API key が無効または不足しています確認 x-lala-key header
400model 名が存在しない / body 形式が誤っています対照モデルリストと各 endpoint サンプルを参照
5xxアップストリーム一時的なエラー指数バックオフ再試行(推奨最大 3 回)

Response テキストは brand normalization を経由(サプライヤー関連の表現は lala/buddylala ブランド名に統一されます)、JSON 構造およびフィールドは完全に標準化されており、解析に影響しません。