🔧 Management API
Quản lý tài khoản Beeknoee programmatically — xem số dư ví, usage history, subscription, BeeSynapse quota, và danh sách models qua REST API. Dùng chung API key với AI Proxy.
🔓 Phân quyền (cập nhật 21/08/2026): mọi gói đều dùng được — Free, Basic, Advanced+, Ultra. Trước đây nhóm Account & Usage đòi gói Advanced+ trở lên; nay không còn ngưỡng gói nào. Dữ liệu trả về luôn là của chính chủ API key.
⚠️ Ngoại lệ duy nhất: tài khoản đại lý (Partner) và nội bộ chỉ dùng được nhóm Model Catalog (
/models…); gọi nhóm Account & Usage sẽ nhận403 permission_error.
🔑 Authentication
Dùng cùng API key (sk-bee-xxx) với AI Proxy:
Authorization: Bearer sk-bee-YOUR_API_KEY
Hoặc:
X-API-Key: sk-bee-YOUR_API_KEY
💡 Không cần tạo key riêng. Key bạn đang dùng cho Chat Completions / Embeddings cũng dùng được cho Management API.
⚠️ Bắt buộc gửi
User-Agentheader — Cloudflare sẽ chặn request không có User-Agent (Error 1010). Thêm headerUser-Agent: YourApp/1.0vào mỗi request.
🚀 Base URL
https://platform.beeknoee.com/v1/management
📋 Endpoints — Account & Usage (mọi gói)
1. Account Info
Xem thông tin tài khoản, số dư, gói subscription.
GET /v1/management/me
cURL:
curl https://platform.beeknoee.com/v1/management/me \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"id": "user-uuid",
"email": "[email protected]",
"name": "Nguyễn Văn A",
"plan": "ADVANCED_PLUS",
"planExpiresAt": "2026-04-23T00:00:00.000Z",
"balance": {
"totalVND": 500000,
"realVND": 450000,
"bonusVND": 50000
}
}
2. Usage History
Lịch sử sử dụng chi tiết từng request.
GET /v1/management/usage?limit=50
| Param | Type | Default | Max | Mô tả |
|---|---|---|---|---|
limit | number | 50 | 200 | Số lượng records trả về |
cURL:
curl "https://platform.beeknoee.com/v1/management/usage?limit=5" \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"id": "usage-uuid",
"date": "2026-03-23T10:30:00.000Z",
"completedAt": "2026-03-23T10:31:12.000Z",
"model": "claude-sonnet-4-6",
"inputTokens": 1500,
"outputTokens": 800,
"totalTokens": 2300,
"cacheHitTokens": 200,
"reasoningTokens": 0,
"costVND": 350,
"costBeforeDiscount": 500,
"discountPercent": 30,
"keySource": "PRIMARY"
}
],
"total": 5
}
⏱️ Hai mốc thời gian — thay đổi từ 2026-08-16
| Field | Nghĩa |
|---|---|
date | Lúc yêu cầu được gửi đi |
completedAt | Lúc yêu cầu chạy xong, tức lúc dòng nhật ký được ghi |
Trước 2026-08-16, date trả về lúc chạy xong. Dòng nhật ký chỉ được ghi sau khi có
phản hồi, nên với streaming, tạo ảnh hoặc video thì mốc đó muộn hơn lúc gửi yêu cầu tới
hàng chục phút — đủ để gây hiểu nhầm khi đối chiếu với thời điểm thu hồi API key.
Nếu ứng dụng của bạn đang dựa vào giá trị cũ, đổi sang đọc completedAt. Danh sách sắp
xếp theo date giảm dần.
3. Daily Usage Stats
Thống kê sử dụng theo ngày — tổng tokens, chi phí, số requests.
GET /v1/management/usage/daily?days=7
| Param | Type | Default | Max | Mô tả |
|---|---|---|---|---|
days | number | 7 | 365 | Số ngày thống kê |
cURL:
curl "https://platform.beeknoee.com/v1/management/usage/daily?days=7" \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"date": "2026-03-23",
"totalTokens": 125000,
"totalCostVND": 15000,
"requestCount": 45
}
]
}
4. Model Usage Breakdown
Thống kê sử dụng theo từng model — bao nhiêu tokens, chi phí, requests.
GET /v1/management/usage/models
cURL:
curl https://platform.beeknoee.com/v1/management/usage/models \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"modelId": "model-uuid",
"modelName": "claude-sonnet-4-6",
"provider": "Anthropic",
"totalTokens": 500000,
"totalCostVND": 75000,
"requestCount": 320
}
]
}
5. Usage Summary
Tổng quan nhanh — tổng requests, tokens, chi phí (all time + 7 ngày gần nhất).
GET /v1/management/usage/stats
cURL:
curl https://platform.beeknoee.com/v1/management/usage/stats \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"totalRequests": 1250,
"totalTokens": 2500000,
"totalCostVND": 180000,
"last7DaysTokens": 125000,
"last7DaysCostVND": 15000
}
6. BeeSynapse Quota
Xem quota còn lại của Antigravity và Codex.
GET /v1/management/cliproxy-quota
cURL:
curl https://platform.beeknoee.com/v1/management/cliproxy-quota \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"antigravity": {
"totalQuota": 500,
"usedInWindow": 120,
"remaining": 380,
"emails": [
{ "email": "[email protected]", "tier": "pro", "quota": 500, "used": 120 }
]
},
"codex": {
"totalQuota": 300,
"usedInWindow": 80,
"remaining": 220,
"emails": []
}
}
7. Savings (Tiết kiệm)
Tổng chi phí đã tiết kiệm — Antigravity, Codex, Cache Hit, Ưu đãi, Free Models.
GET /v1/management/savings
cURL:
curl https://platform.beeknoee.com/v1/management/savings \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"antigravity": {
"tokens": 500000,
"savedVND": 75000,
"requests": 320
},
"codex": {
"tokens": 200000,
"savedVND": 30000,
"requests": 150
},
"cacheHit": {
"tokens": 100000,
"savedVND": 5000
},
"discount": {
"tokens": 50000,
"savedVND": 8000,
"requests": 45
},
"freeModels": {
"tokens": 300000,
"requests": 200
},
"totalSavedVND": 118000,
"totalSpentVND": 180000,
"savingsPercent": 39.6
}
| Field | Mô tả |
|---|---|
antigravity | Tiết kiệm từ Antigravity free quota |
codex | Tiết kiệm từ Codex free quota |
cacheHit | Tiết kiệm từ prompt caching |
discount | Tiết kiệm từ giảm giá theo gói |
freeModels | Sử dụng model miễn phí (GLM-4.7-Flash...) |
savingsPercent | % tiết kiệm so với tổng chi phí gốc |
💡 Data được cache 5 phút — gọi liên tục không tạo thêm load.
📦 Endpoints — Model Catalog (mọi tài khoản)
🌐 Dùng được với mọi tài khoản có API key hợp lệ — kể cả đại lý và nội bộ.
8. All Models Summary
Danh sách tất cả models (Text, Image, Video, Embedding) — tổng quan nhanh.
GET /v1/management/models
cURL:
curl https://platform.beeknoee.com/v1/management/models \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"model_id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"provider": "Anthropic",
"type": "TEXT"
},
{
"model_id": "gpt-image-1",
"name": "GPT Image 1",
"provider": "OpenAI",
"type": "IMAGE"
}
],
"counts": { "text": 32, "image": 14, "video": 15, "embedding": 3 }
}
9. Text Models
Danh sách text models với pricing chi tiết (input/output/cache/reasoning).
GET /v1/management/models/text
cURL:
curl https://platform.beeknoee.com/v1/management/models/text \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"model_id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"provider": "Anthropic",
"type": "TEXT",
"description": "Fast, intelligent model for everyday tasks",
"context_window": 200000,
"max_output_tokens": 64000,
"supports_vision": true,
"released_at": "2026-03-15T00:00:00.000Z",
"rate_limits": { "rpm": 2000, "rpd": null, "tpm": null, "tpd": null },
"pricing": {
"currency": "USD",
"unit": "per_1M_tokens",
"input": 1.00,
"output": 5.00,
"cache_read": 0.10,
"cache_write": 1.25,
"reasoning": null
},
"discount": {
"percent": 30,
"all_plans": { "free": 0, "basic": 15, "advanced_plus": 30 }
}
}
],
"total": 32
}
| Field | Mô tả |
|---|---|
model_id | ID dùng khi gọi API (ví dụ: model: "claude-sonnet-4-6") |
pricing.input | Giá USD per 1M input tokens |
pricing.output | Giá USD per 1M output tokens |
pricing.cache_read | Giá cached prompt tokens (null = không hỗ trợ) |
pricing.reasoning | Giá extended thinking tokens (null = không hỗ trợ) |
discount.percent | % giảm giá theo plan hiện tại của bạn |
10. Image Models (Full Pricing Matrix)
Danh sách image models kèm giá chi tiết theo từng quality × size combo.
GET /v1/management/models/image
cURL:
curl https://platform.beeknoee.com/v1/management/models/image \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response (OpenAI model):
{
"data": [
{
"model_id": "gpt-image-1",
"name": "GPT Image 1",
"provider": "OpenAI",
"type": "IMAGE",
"description": "OpenAI's most capable image generation model",
"supported_sizes": ["1024x1024", "1024x1536", "1536x1024", "auto"],
"supported_qualities": ["low", "medium", "high", "auto"],
"supports_editing": true,
"supports_negative_prompt": false,
"supports_image_input": true,
"max_images_per_request": 4,
"rate_limits": { "rpm": 5, "rpd": 100 },
"discount": {
"percent": 0,
"all_plans": { "free": 0, "basic": 0, "advanced_plus": 0 }
},
"pricing": {
"currency": "USD",
"unit": "per_image",
"generation": [
{ "quality": "low", "size": "1024x1024", "priceUSD": 0.011, "discountedVND": 302 },
{ "quality": "medium", "size": "1024x1024", "priceUSD": 0.042, "discountedVND": 1155 },
{ "quality": "high", "size": "1024x1024", "priceUSD": 0.167, "discountedVND": 4592 }
],
"editing": [
{ "quality": "low", "size": "1024x1024", "priceUSD": 0.014, "discountedVND": 385 },
{ "quality": "high", "size": "1024x1024", "priceUSD": 0.200, "discountedVND": 5500 }
]
}
}
],
"total": 14
}
Response (Google model):
Google models dùng resolution thay vì quality + size:
{
"model_id": "imagen-4.0-fast-generate-001",
"pricing": {
"currency": "USD",
"unit": "per_image",
"generation": [
{ "resolution": "512", "priceUSD": 0.020, "discountedVND": 110 },
{ "resolution": "1024", "priceUSD": 0.020, "discountedVND": 110 },
{ "resolution": "2048", "priceUSD": 0.020, "discountedVND": 110 }
]
}
}
| Field | Mô tả |
|---|---|
model_id | Dùng khi gọi POST /v1/image/generations { model: "gpt-image-1" } |
pricing.generation[] | Giá per image cho từng quality/size combo |
pricing.editing[] | Giá per image cho editing (chỉ models hỗ trợ) |
discountedVND | Giá sau discount theo plan hiện tại |
supports_editing | Model có hỗ trợ image editing không |
supports_image_input | Model có nhận ảnh làm input không |
11. Video Models (Per-Resolution Pricing)
Danh sách video models kèm giá theo resolution và duration.
GET /v1/management/models/video
cURL:
curl https://platform.beeknoee.com/v1/management/models/video \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response (Veo — per resolution):
{
"model_id": "veo-3.1-generate-preview",
"name": "Veo 3.1",
"provider": "Google",
"supported_resolutions": ["720p", "1080p", "4k"],
"supported_durations": { "min_seconds": 4, "max_seconds": 8 },
"supported_aspect_ratios": ["16:9", "9:16", "1:1"],
"supported_input_types": ["text", "image", "dual_frame", "reference_images", "video_extension"],
"supports_audio": false,
"pricing": {
"currency": "USD",
"unit": "per_second",
"per_resolution": [
{ "resolution": "720p", "costPerSecondUSD": 0.90, "example_8s_USD": 7.20, "discounted_8s_VND": 39600 },
{ "resolution": "1080p", "costPerSecondUSD": 0.95, "example_8s_USD": 7.60, "discounted_8s_VND": 41800 }
]
}
}
Response (Seedance — per resolution × input type):
{
"model_id": "seedance-2-pro",
"pricing": {
"currency": "USD",
"unit": "per_second",
"per_resolution": [
{
"resolution": "720p",
"by_input_type": {
"text": { "costPerSecondUSD": 0.80, "example_8s_USD": 6.40 },
"remix": { "costPerSecondUSD": 0.62, "example_8s_USD": 4.96 },
"omni": { "costPerSecondUSD": 0.80, "example_8s_USD": 6.40 }
}
}
]
}
}
Response (Kling/Sora — flat rate):
{
"model_id": "kling-3.0-pro",
"pricing": {
"currency": "USD",
"unit": "per_second",
"flat": { "costPerSecondUSD": 1.15, "example_8s_USD": 9.20, "discounted_8s_VND": 50600 }
}
}
| Pricing Type | Models | Mô tả |
|---|---|---|
per_resolution | Veo 3.1 | Giá khác nhau theo resolution (720p/1080p/4K) |
per_resolution.by_input_type | Seedance 2 | Giá theo resolution + loại input (text/remix/omni) |
flat | Sora, Kling | 1 giá duy nhất per second |
💡 Tính giá video:
costPerSecondUSD × duration (giây). Ví dụ: Veo 3.1 720p 8s = $0.90 × 8 = $7.20
12. Embedding Models
Danh sách embedding models với pricing và free quota.
GET /v1/management/models/embedding
cURL:
curl https://platform.beeknoee.com/v1/management/models/embedding \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response:
{
"data": [
{
"model_id": "gemini-embedding-001",
"name": "Gemini Embedding 001",
"provider": "Google",
"type": "EMBEDDING",
"description": "Google embedding model with free daily quota",
"dimensions": 3072,
"max_input_tokens": 2048,
"rate_limits": { "rpm": 500, "rpd": null },
"free_quota": { "per_day": 200 },
"discount": {
"percent": 0,
"all_plans": { "free": 0, "basic": 0, "advanced_plus": 0 }
},
"pricing": {
"currency": "USD",
"unit": "per_1M_tokens",
"input": 0.15,
"discountedVND_per_1M": 4125
}
}
],
"total": 3
}
13. Single Model Detail
Xem chi tiết 1 model theo model_id. Trả về format giống endpoint theo loại (text/image/video/embedding).
GET /v1/management/models/:model_id
cURL:
curl https://platform.beeknoee.com/v1/management/models/gpt-image-1 \
-H "Authorization: Bearer sk-bee-YOUR_API_KEY" \
-H "User-Agent: MyApp/1.0"
Response: Trả về 1 object (không wrapped trong data array), format giống item trong endpoint tương ứng.
Error (model không tồn tại):
{
"error": "Not Found",
"message": "Model \"invalid-model\" not found. Use GET /v1/management/models to see available models."
}
💻 Code Examples
import requests
API_KEY = "sk-bee-YOUR_API_KEY"
BASE = "https://platform.beeknoee.com/v1/management"
headers = {
"Authorization": f"Bearer {API_KEY}",
"User-Agent": "MyApp/1.0",
}
# Xem account info
me = requests.get(f"{BASE}/me", headers=headers).json()
print(f"Balance: {me['balance']['totalVND']:,.0f}đ")
print(f"Plan: {me['plan']} (expires {me['planExpiresAt']})")
# Xem usage stats
stats = requests.get(f"{BASE}/usage/stats", headers=headers).json()
print(f"Total: {stats['totalRequests']} requests, {stats['totalTokens']:,} tokens")
# Xem image models + pricing
image_models = requests.get(f"{BASE}/models/image", headers=headers).json()
for m in image_models["data"]:
print(f"\n{m['name']} ({m['model_id']}):")
print(f" Sizes: {', '.join(m['supported_sizes'])}")
for p in m['pricing']['generation'][:3]:
if 'quality' in p:
print(f" {p['quality']} {p['size']}: ${p['priceUSD']} ({p['discountedVND']}đ)")
else:
print(f" {p['resolution']}px: ${p['priceUSD']} ({p['discountedVND']}đ)")
# Xem 1 model cụ thể
model = requests.get(f"{BASE}/models/gpt-image-1", headers=headers).json()
print(f"\n{model['name']}: {len(model['pricing']['generation'])} pricing combos")
const API_KEY = "sk-bee-YOUR_API_KEY";
const BASE = "https://platform.beeknoee.com/v1/management";
const headers = {
Authorization: `Bearer ${API_KEY}`,
"User-Agent": "MyApp/1.0",
};
// Account info
const me = await fetch(`${BASE}/me`, { headers }).then(r => r.json());
console.log(`Balance: ${me.balance.totalVND.toLocaleString()}đ`);
// All models summary
const all = await fetch(`${BASE}/models`, { headers }).then(r => r.json());
console.log(`Models: ${all.counts.text} text, ${all.counts.image} image, ${all.counts.video} video`);
// Video models pricing
const video = await fetch(`${BASE}/models/video`, { headers }).then(r => r.json());
video.data.forEach(m => {
console.log(`${m.name}: ${m.supported_resolutions.join('/')}`);
});
⚠️ Rate Limiting
Management API giới hạn 60 requests / phút per API key (áp dụng cho tất cả endpoints).
Nếu vượt quá, bạn sẽ nhận:
{
"error": {
"message": "Management API rate limit exceeded. Try again in 15s.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded",
"request_id": "req_3cb1dccd5790"
}
}
Số giây phải chờ nằm ở header Retry-After — hãy đọc header, đừng parse chuỗi message.
❌ Error Codes
Lỗi trả về theo khuôn OpenAI:
{
"error": {
"message": "Account & usage endpoints are not available for partner/internal accounts...",
"type": "permission_error",
"param": null,
"code": "insufficient_permissions",
"request_id": "req_3cb1dccd5790"
}
}
| HTTP Status | code | Mô tả |
|---|---|---|
| 401 | invalid_api_key | Thiếu API key trong header, hoặc key không hợp lệ / đã bị thu hồi (xem message) |
| 403 | insufficient_permissions | Tài khoản đại lý/nội bộ gọi nhóm Account & Usage (khách thường ở mọi gói đều được phép), hoặc tài khoản bị vô hiệu hoá / đang khoá bảo mật 24h sau khi reset 2FA |
| 404 | model_not_found | Model không tồn tại (chỉ endpoint /models/:id) |
| 429 | rate_limit_exceeded | Vượt rate limit (60 req/min) — xem header Retry-After |
💡
request_idlà mã truy vết: dán vào ticket hỗ trợ để tra thẳng ra log của request đó.
🆘 Support
Gặp vấn đề? Sử dụng Support Chat (góc dưới phải) hoặc liên hệ qua Zalo / Messenger.