Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
エンドポイント / OpenAI-compatible
POSThttps://api.lazu.ai/v1/chat/completions

Chat completions

Lazu 経由で OpenAI-compatible chat request を送ります。Base URL、認証、必須 body fields、stream、tools、response usage、troubleshooting をこのページで確認できます。

課金選択したモデルとレーンの料金でトークン使用量を計算します。他の課金項目が適用される場合もあります。 料金とレーン ↗

基本設定

Base URL

OpenAI SDK では https://api.lazu.ai/v1 を使います。直接呼ぶ場合は https://api.lazu.ai/v1/chat/completions です。

モデル検出

実行時に GET /api/models/catalog を読み、 supported_endpoint_types に chat を含むモデルを選びます。

Request body

modelstringrequired

model ID、route alias、または route policy name。明示的な model は GET /api/models/catalog から選びます。

messagesobject[]required

OpenAI shape の会話メッセージ配列です。

rolestring
system、user、assistant、tool のいずれか。
contentstring | content_part[]
plain text または multimodal content parts。
tool_call_idstring
tool message を先行 tool call と関連付けます。
streambooleannullable

true の場合、Server-Sent Events stream を返し、最後に data: [DONE] を送ります。

toolsobject[]nullable

tool 定義です。送信前に catalog の parameters.tools を確認してください。

type"function"
現在は function tools を扱います。
function.namestring
モデルが呼べる tool name。
function.parametersobject
tool arguments の JSON Schema。
tool_choicestring | objectnullable

auto、none、指定 tool object など。

response_formatobjectnullable

structured output control。例:{"type":"json_object"}。

temperaturenumbernullable

sampling temperature。多くの model は 0 から 2 を受け付けます。

max_tokensintegernullable

生成 token の上限です。

Vision input

画像入力は OpenAI-compatible content parts を使います。HTTPS image URL または data URL を送れます。

Image inputjson
{
"model": "gpt-6-luna",
"messages": [
  {
    "role": "user",
    "content": [
      {"type": "text", "text": "What's in this image?"},
      {
        "type": "image_url",
        "image_url": {"url": "data:image/png;base64,..."}
      }
    ]
  }
]
}

PDF や大きな document は Files で upload し、 Responses で参照してください。Chat completions は

file_id を自動 dereference しません。

Response

idstring

Lazu または provider response ID。

choicesobject[]

assistant output choices。Streaming では incremental delta です。

usage.prompt_tokensinteger

input token count。

usage.completion_tokensinteger

generated output token count。

usage.prompt_tokens_details.cached_tokensintegernullable

provider が報告した cache read tokens。

完全な照合には リクエスト詳細 を使ってください。

Sent from your browser to api.lazu.ai · key stays in this tab
RequestPOST /v1/chat/completions
curl https://api.lazu.ai/v1/chat/completions \
  -H "Authorization: Bearer $LAZU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "messages": [
      {"role": "user", "content": "Say hello from Lazu"}
    ]
  }'
ResponseExample
{
  "id": "chatcmpl-9aZx",
  "model": "gpt-6-luna",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello!" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 11, "completion_tokens": 3 }
}
リクエスト明細明細の例
$0.00028200 · 842 ms
Request ID
req_demo_01
モデル · レーン
gpt-6-luna · stable
トークン · 入力 / 出力
1,200 / 320
キー
demo-key

例示のみで、見積もりでもあなたのリクエストの結果でもありません。上のリクエストを送信すると自分の明細が表示されます。

実際のリクエスト明細を見る →