ApiLux

Kiem tra ket noi (cURL / PowerShell)

Xac nhan khoa, base URL va so du hoat dong — truoc khi dung toi bat ky SDK hay IDE nao.

Buoc 1 — Tao API key

  1. 01Mo trang API Keys trong bang dieu khien va tao mot khoa moi.
  2. 02Chep khoa NGAY — no chi hien dung mot lan, ApiLux chi luu ban bam.
  3. 03Dat vao bien moi truong, dung dan vao ma nguon.
Windows PowerShell
$env:APILUX_API_KEY = "apl_YOUR_API_KEY"
macOS / Linux
export APILUX_API_KEY="apl_YOUR_API_KEY"

Buoc 2 — Chon model

Lay danh sach model ban that su goi duoc. Endpoint nay chi doc va KHONG tinh tien.

bash
curl https://apilux.net/api/v1/models \
  -H "Authorization: Bearer apl_YOUR_API_KEY"
Chi dung id tra ve tu day. Danh muc doi theo thoi gian nen dung chep cung mot ID tu tai lieu.

Buoc 3 — Goi thu

bash
curl https://apilux.net/api/v1/chat/completions \
  -H "Authorization: Bearer apl_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [{ "role": "user", "content": "Xin chao" }]
  }'
DUNG them stream: true. ApiLux chua ho tro streaming va tu choi tuong minh bang 400 — co y, vi im lang tra non-streaming se lam client SSE treo.

Tom tat cau hinh

MucGia tri
Base URLhttps://apilux.net/api/v1
Bien khoaAPILUX_API_KEY
Bien base URLAPILUX_BASE_URL
Giao thucchat.completions (co streaming)

Khi gap loi

LoiNguyen nhan va cach sua
401Khoa sai hoac da thu hoi. Tao khoa moi o trang API Keys.
402So du khong du. Nap them roi goi lai.
404Base URL sai, hoac ban dang goi endpoint ApiLux chua co (vi du /messages, /responses).
400 unknown_modelModel khong co trong GET /models cua ban. Chon ID tu danh sach do.
400 streamingBan gui stream: true. Bo field do di.
429Vuot han muc toc do. Doc header Retry-After roi cho dung ngan do giay.
503Model tam khong ban duoc, hoac he thong dang bao tri. Ban khong bi tinh tien.
TimeoutChat vai giay la du; tao anh nen dat 180-360 giay; video tra job ngay roi poll.