# Check profile & coin balance
curl -X POST BASE_URL/api/pro_service/profile \
-H "Content-Type: application/json" \
-d '{"email":"you@email.com","password":"yourpass"}'
# Buy 25 coins
curl -X POST BASE_URL/api/pro_service/buy_coins \
-H "Content-Type: application/json" \
-d '{"email":"you@email.com","password":"yourpass","count":25}'
# Encrypt a file into an image (costs 1 coin)
curl -X POST BASE_URL/api/pro_service/encrypt \
-H "Content-Type: application/json" \
-d '{"email":"you@email.com","password":"yourpass",
"image":"BASE64_IMAGE","file":"BASE64_FILE",
"passphrase":"my-secret-phrase"}'
# Decrypt (free)
curl -X POST BASE_URL/api/pro_service/decrypt \
-H "Content-Type: application/json" \
-d '{"email":"you@email.com","password":"yourpass",
"image":"BASE64_ENCRYPTED_IMAGE",
"passphrase":"my-secret-phrase"}'
import requests, base64
BASE = "BASE_URL"
auth = {"email": "you@email.com", "password": "yourpass"}
# Check profile
r = requests.post(f"{BASE}/api/pro_service/profile", json=auth)
print(r.json()) # {"coins": 25, "plan": "pro", ...}
# Buy coins
r = requests.post(f"{BASE}/api/pro_service/buy_coins",
json={**auth, "count": 25})
# Encrypt file into image
with open("cover.png", "rb") as f:
img_b64 = base64.b64encode(f.read()).decode()
with open("secret.pdf", "rb") as f:
file_b64 = base64.b64encode(f.read()).decode()
r = requests.post(f"{BASE}/api/pro_service/encrypt", json={
**auth,
"image": img_b64,
"file": file_b64,
"passphrase": "my-secret-phrase"
})
result = r.json()
with open("output.png", "wb") as f:
f.write(base64.b64decode(result["encrypted_image"]))
const BASE = "BASE_URL";
const auth = { email: "you@email.com", password: "yourpass" };
async function apiCall(endpoint, body = {}) {
const r = await fetch(`${BASE}/api/pro_service/${endpoint}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ ...auth, ...body })
});
return r.json();
}
// Check profile
const profile = await apiCall("profile");
// Buy 25 coins
await apiCall("buy_coins", { count: 25 });
// Encrypt
const result = await apiCall("encrypt", {
image: imageBase64, file: fileBase64,
passphrase: "my-secret-phrase"
});
// Decrypt (free)
const extracted = await apiCall("decrypt", {
image: encryptedImageBase64,
passphrase: "my-secret-phrase"
});
Auth: Pass email and password in every request body. Encrypt costs 1 coin; decrypt is free.