Danh sách model
Trả về các model bạn gọi được ngay lúc này. Model chưa cấu hình giá hoặc đang tắt sẽ không xuất hiện.
Đã triển khai
Request
GET
/modelsCần header Authorization: Bearer apl_...
Endpoint này không nhận tham số nào.
Response
| Field | Kiểu | Mô tả |
|---|---|---|
data[].idbắt buộc | string | Public model ID dùng trong field model của các request khác. |
data[].kindbắt buộc | "TEXT" | "IMAGE" | "VIDEO" | Loại model. |
data[].capabilitiesbắt buộc | string[] | Các endpoint model này dùng được. |
data[].price_credit_per_unitbắt buộc | integer | Giá bán, tính bằng credit (1 credit = 1 VND) trên một đơn vị. |
data[].billing_unitbắt buộc | "million_tokens" | "image" | "second" | Đơn vị tính tiền tương ứng. |
Tính tiền
Miễn phí, không trừ credit.
Ví dụ
curl https://apilux.net/api/v1/models \
-H "Authorization: Bearer apl_YOUR_API_KEY"const res = await fetch("https://apilux.net/api/v1/models", {
headers: { Authorization: `Bearer ${process.env.APILUX_API_KEY}` },
});
const { data } = await res.json();
console.log(data.map((m) => m.id));import os, requests
res = requests.get(
"https://apilux.net/api/v1/models",
headers={"Authorization": f"Bearer {os.environ['APILUX_API_KEY']}"},
)
print([m["id"] for m in res.json()["data"]])Lỗi
| HTTP | Mã | Ý nghĩa |
|---|---|---|
| 401 | auth_missing_or_malformed | Thiếu header Authorization hoặc sai định dạng. Phải là Bearer apl_.... |
| 401 | auth_invalid | API key không tồn tại. |
| 401 | auth_revoked | API key đã bị thu hồi. |
| 401 | auth_expired | API key đã hết hạn. |