Re-bill AI costs to clients
Agencies bill AI work in different ways. All of them start with exact spend per client.
Pull last month's spend per project, then apply your own markup or show it at cost as a line item.
python
import os, requests
H = {"Authorization": f"Bearer {os.environ['TAKES_API_KEY']}"}
u = requests.get("https://edengen.ai/v1/usage", headers=H,
params={"from": "2026-09-01", "to": "2026-10-01", "group_by": "project"}).json()
MARKUP = 0.15
for row in u["data"]:
print(f"{row['project']:<32} {row['takes']:>4} takes net ${row['net_usd']:.2f} bill ${row['net_usd']*(1+MARKUP):.2f}")Use group_by=key to see which tool or pipeline spent what, or group_by=day for a timeline. Refunded takes are already netted out. The monthly usage statement in Billing has the same per-project lines.