{"title":"Chia Balance API","version":"1.0.0","description":"API for retrieving Chia wallet balances using master public keys","baseUrl":"http://chia-balance-api.fly.dev","endpoints":{"/balance/:publicKey":{"method":"GET","description":"Get the balance for a Chia wallet using its master public key","parameters":{"publicKey":{"type":"string","format":"hex","description":"Master public key in hexadecimal format (96 characters)","example":"a1b2c3d4e5f6789012345678901234567890123456789012345678901234567890123456789012345678901234567890"}},"responses":{"200":{"description":"Successfully retrieved balance","schema":{"type":"object","properties":{"mojos":{"type":"number","description":"Balance in mojos (smallest Chia unit, 1 XCH = 10^12 mojos)"},"chia":{"type":"number","description":"Balance in XCH (Chia coins)"}}},"example":{"mojos":1500000000000,"chia":1.5}},"502":{"description":"Failed to fetch balance from upstream service","schema":{"type":"object","properties":{"error":{"type":"string","example":"Failed to fetch balance"}}}},"504":{"description":"Upstream request timed out","schema":{"type":"object","properties":{"error":{"type":"string","example":"Upstream request timed out"},"timeoutMs":{"type":"number","description":"Timeout duration in milliseconds"}}}}}}},"notes":["The API derives up to 2000 puzzle hashes from the master public key","Only unspent coins are included in the balance calculation","The API uses the Coinset.org service for blockchain data","Request timeout is configurable via FETCH_TIMEOUT_MS environment variable (default: 1000ms)"],"examples":{"curl":"curl \"http://chia-balance-api.fly.dev/balance/YOUR_PUBLIC_KEY_HERE\"","javascript":"\nfetch('http://chia-balance-api.fly.dev/balance/YOUR_PUBLIC_KEY_HERE')\n  .then(response => response.json())\n  .then(data => console.log('Balance:', data.chia, 'XCH'));"}}