Quickstart
Create a key in the portal, then pull with the SDK (pip install margen).
1import os, urllib.request2from margen import Margen34client = Margen(bearer_auth="mgn_test_...") # free test key from the portal56# The passport test set is a free sample: one real and one fake per demographic7# cell, from both editors (see Benchmarks). Pull one HiDream fake:8item = client.list_items(9benchmark="passport-pad-v1", kind="fake", generator="hidream_o1", limit=1,10).result.data[0]1112dl = client.download_item(item_id=item.id) # test tier: free, no credit debited13print("signed url:", dl.url) # click to open the image in a browser1415out_dir = "margen_out" # <- change to any folder you like16os.makedirs(out_dir, exist_ok=True)17path = os.path.join(out_dir, f"{item.id}.jpg")18urllib.request.urlretrieve(dl.url, path) # signed URL, no auth header19print("saved to:", path)