Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

クイックスタート

1. API Key を作成する

Lazu コンソールにサインインし、API Keys を開いて Create key をクリックします。生成された key は通常 sk-lazu- で始まります。

2. Base URL を選ぶ

https://api.lazu.ai

Self-hosted Lazu では、自分の API ドメインに置き換えてください。

3. リクエストする

cURL

curl https://api.lazu.ai/v1/chat/completions \
  -H "Authorization: Bearer $LAZU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "Say hello from Lazu"}
    ]
  }'

Python

from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.lazu.ai/v1",
    api_key="YOUR_LAZU_KEY",
)
 
resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Say hello from Lazu"}],
)
print(resp.choices[0].message.content)

TypeScript

import OpenAI from "openai";
 
const client = new OpenAI({
  baseURL: "https://api.lazu.ai/v1",
  apiKey: process.env.LAZU_API_KEY,
});
 
const resp = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Say hello from Lazu" }],
});
console.log(resp.choices[0].message.content);

次に読むページ