Hakila Docs

快速上手

取得 API Key 並送出第一個 Chat Completions 請求

本頁示範如何在五分鐘內串接 Hakila Gateway。

1. 取得 API Key

在 Hakila Admin 後台建立 Workspace API Key。金鑰只會在建立當下顯示一次明文,請妥善保存。

請求時使用:

Authorization: Bearer <your-api-key>

2. 列出模型

curl https://api.hakila.ai/api/v1/models \
  -H "Authorization: Bearer $HAKILA_API_KEY"

3. 送出第一個 Chat 請求

curl https://api.hakila.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $HAKILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.6-luna",
    "messages": [{"role":"user","content":"hi"}]
  }'

重點

  • SDK 只要改 base_url / baseURL 指向 Hakila,其餘與官方 OpenAI SDK 用法相同
  • model 必須帶 provider 前綴(見 模型與路由
  • 需要串流時加 "stream": true(見 Streaming

本頁目錄