Xác thực
Tất cả API requests cần gửi kèm API key trong header Authorization.
Header Format
Authorization: Bearer sk_live_xxxxxxxxxxxxTạo API key tại Dashboard → API Keys.
read
Xem VPS, sản phẩm, ví
write
Tạo, gia hạn, nâng cấp VPS
admin
Quản lý user, thống kê
Ví dụ
cURL
curl -H "Authorization: Bearer sk_live_your_key_here" \
https://your-domain.com/api/v1/productsJavaScript
const res = await fetch("https://your-domain.com/api/v1/products", {
headers: { "Authorization": "Bearer sk_live_your_key_here" }
});
const data = await res.json();
console.log(data.products);Python
import requests
headers = {"Authorization": "Bearer sk_live_your_key_here"}
res = requests.get("https://your-domain.com/api/v1/products", headers=headers)
print(res.json())Sản phẩm VPS
Hệ điều hành
Chu kỳ thanh toán
VPS
Ví
Mã lỗi
| HTTP Code | Mô tả |
|---|---|
| 200 | Thành công |
| 400 | Request không hợp lệ (thiếu params, số dư không đủ...) |
| 401 | API key không hợp lệ, hết hạn, hoặc bị vô hiệu hóa |
| 403 | Không đủ quyền (VD: gọi POST với key chỉ có quyền read) |
| 404 | Không tìm thấy (VPS không tồn tại hoặc không sở hữu) |
| 429 | Quá nhiều requests (vượt rate limit) |
| 500 | Lỗi server |
Rate Limits
Requests per minute60
Per API keyMỗi key có rate limit riêng
Nếu vượt quá giới hạn, bạn sẽ nhận HTTP 429. Đợi 1 phút rồi thử lại.
API v1.0 • Tạo API Key • Cần hỗ trợ? Tạo ticket