How to Get Remaining API Credits

Use the GET /api/customers/package-credits endpoint to fetch your balance programmatically.

curl -k 'https://techhk.aoscdn.com/api/customers/package-credits' \
-H 'X-API-KEY: YOUR_API_KEY'
const response = await fetch("https://techhk.aoscdn.com/api/customers/package-credits", {
  method: "GET",
  headers: {
    "X-API-KEY": "YOUR_API_KEY",
  },
});

const data = await response.json();
console.log(data);
import requests

url = "https://techhk.aoscdn.com/api/customers/package-credits"
headers = {"X-API-KEY": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
print(response.json())

Credits Guide

API TypeCredits Consumed
Remove Background0.5 credit will be consumed for each successful call; when outline_border > 0, 1 credit will be consumed.
Face cutout1 credit will be consumed for each successful call.
Photo Enhance2 credits will be consumed for each successful call when the long edge ≤ 2048px, and 3 credits when 2048px < long edge ≤ 4096px.
Advanced Photo EnhancementEach successful call consumes 5 credits for Ultra HD (type=0) or Ultra HD (Text image) (type=2), and 4 credits for HD (type=1).
Object Removal1 credit will be consumed for each successful call.
Objects Removal (Advanced)6 credits will be consumed for each successful call.
Watermark Removal (General)2 credits will be consumed for each successful call.
Watermark Removal (Advanced)5 credits will be consumed for each successful call. (Regular price: 10 credits; 50% off for a limited time.)
Image Translation5 credits will be consumed for each successful call.
Background Generation3~10 credits will be consumed for each successful call. (1 images=3 credits, 2 images=6 credits, 3 images=8 credits, 4 images=10 credits)
ID Photo1 credit will be consumed for each successful call.
ID Photo (Advanced)
• Standard ID Photo: 6 credits per request
• ID Photo with Outfit Change (using clothes_id parameter): 15 credits per request
• Beauty Enhancement (any of auto_bright, auto_smooth, auto_thin_face, auto_sharp enabled): +8 credits extra
• Layout Feature (layout=1): +5 credits extra
• Watermarked Preview (preview=1): No credits consumed
Colorize Photo1 credit will be consumed for each successful call.
Compress1 credit will be consumed for each successful call when the long edge ≤ 4096px, and 2 credits when 4096px < long edge ≤ 8000px.
OCR1 credit will be consumed for each successful call.
Photo Cropping & Enhancement3 credits will be consumed for each successful call.
Clothing Segmentation3 credits will be consumed for each successful call.
Image Expansion5 credits will be consumed for each successful call.
Old Photo RestorationWhen model_type=3 (Ultra HD restoration), 20 credits will be consumed for each successful call. When restoration_type=0 (light), 2 credits will be consumed for each successful call. In all other cases, 15 credits will be consumed for each successful call.
Product Retouching5 credits will be consumed for each successful call.
Image Upscaling3 credits will be consumed for each successful call.