API Keys
API keys provide traditional authentication with prepaid credits.
Benefits
- 500 calls/day limit
- 30 requests/minute rate
- No crypto wallet needed
- Prepaid credits
Creating a Key
Requires SIWE authentication first:
await client.signIn();
const key = await client.createKey({ name: 'My App' });
// { id: "key_abc123", key: "atv_live_...", name: "My App" }
warning
Save the key immediately — it's only shown once!
Using a Key
curl -H "X-API-Key: atv_live_..." \
https://api.web3identity.com/api/ens/resolve/vitalik.eth
Managing Keys
// List keys
const keys = await client.listKeys();
// Delete key
await client.deleteKey('key_abc123');
Credits
Keys require prepaid credits.
| Credits | Price | Per Call |
|---|---|---|
| 100 | $0.90 | $0.009 |
| 500 | $4.00 | $0.008 |
| 1,000 | $7.00 | $0.007 |
| 5,000 | $30.00 | $0.006 |
Purchasing Credits
const purchase = await client.purchaseCredits('key_abc123', 1000);
// Returns payment instructions
Checking Balance
const key = await client.getKey('key_abc123');
console.log(key.credits); // 847
When to Use API Keys
| Scenario | Recommendation |
|---|---|
| Backend services | ✅ API Key |
| Mobile apps | ✅ API Key |
| High volume | ✅ API Key |
| Browser apps | ⚠️ Use SIWE instead |
| Testing | ❌ Use free tier |