curl https://get.megalania.io/v1 \
-H "Authorization: Bearer $MEG_API_KEY" \
-H "Idempotency-Key: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
-H "Content-Type: application/json" \
-d '{"url": "https://lab.megalania.io/about/",
"response_types": "markdown"}' -D -import os, uuid, requests
resp = requests.post(
"https://get.megalania.io/v1",
headers={
"Authorization": f"Bearer {os.environ['MEG_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"url": "https://lab.megalania.io/about/",
"response_types": "markdown"},
timeout=90,
)
print(resp.headers["X-Credits-Charged"], resp.text[:300])const resp = await fetch("https://get.megalania.io/v1", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MEG_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://lab.megalania.io/about/",
response_types: "markdown",
}),
});
console.log(resp.headers.get("X-Credits-Charged"));