Skip to main content

Authentication Overview

Web3 Identity API offers flexible authentication options designed for both Web3-native and traditional applications. Choose the method that best fits your use case and scale requirements.

Quick Comparisonโ€‹

MethodDaily LimitRate LimitPayment ModelSetup ComplexityBest For
Anonymous100 calls100/minx402 after limitNoneTesting, prototypes
SIWE200 calls200/minx402 after limitWallet signatureWeb3 dApps
API Key10,000+ calls1,000/minPrepaid creditsKey generationProduction backends

How It Worksโ€‹

Anonymous Accessโ€‹

The simplest way to get started. No authentication requiredโ€”just make requests.

How It Worksโ€‹

  • 100 requests per day per IP address
  • 100 requests per minute rate limit
  • After daily limit: Pay-per-request via x402

Exampleโ€‹

# No auth needed
curl https://api.web3identity.com/api/ens/resolve/vitalik.eth

Response Headersโ€‹

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1707350400

When to Useโ€‹

  • โœ… Quick testing and exploration
  • โœ… Low-volume personal projects
  • โœ… Prototyping and development
  • โŒ Production applications (use SIWE or API keys)

SIWE Authenticationโ€‹

Sign-In with Ethereum (EIP-4361) provides wallet-based authentication with enhanced limits.

Benefitsโ€‹

  • 2x daily limits (200 calls/day vs 100)
  • Wallet-verified identity for audit trails
  • No API key management โ€” uses your existing wallet
  • Web3-native authentication flow

Authentication Flowโ€‹

Implementationโ€‹

import { SiweMessage } from 'siwe';

// 1. Get nonce
const { nonce } = await fetch('/api/auth/nonce').then(r => r.json());

// 2. Create and sign message
const message = new SiweMessage({
domain: 'yourapp.com',
address: walletAddress,
statement: 'Sign in to Web3 Identity API',
uri: 'https://api.web3identity.com',
version: '1',
chainId: 1,
nonce
});

const signature = await wallet.signMessage(message.prepareMessage());

// 3. Verify and get token
const { token } = await fetch('/api/auth/verify', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: message.prepareMessage(), signature })
}).then(r => r.json());

// 4. Use token in requests
const data = await fetch('/api/ens/resolve/vitalik.eth', {
headers: { 'Authorization': `Bearer ${token}` }
}).then(r => r.json());

When to Useโ€‹

  • โœ… Web3 dApps with wallet connections
  • โœ… User-facing applications
  • โœ… When you need 2x free tier limits
  • โŒ Server-to-server integrations (use API keys)

Complete SIWE Guide โ†’


API Key Authenticationโ€‹

Traditional API key authentication for high-volume production use.

Benefitsโ€‹

  • 10,000+ requests/day depending on tier
  • 1,000 requests/minute rate limit
  • Prepaid credits โ€” predictable costs
  • Server-side friendly โ€” no wallet required

Tiersโ€‹

TierDaily LimitRate LimitPrice
Developer10,000500/min$9/mo
Pro50,0001,000/min$29/mo
EnterpriseUnlimitedCustomContact us

Implementationโ€‹

# Include API key in header
curl -H "X-API-Key: atv_live_abc123xyz" \
https://api.web3identity.com/api/ens/resolve/vitalik.eth
const response = await fetch('https://api.web3identity.com/api/ens/resolve/vitalik.eth', {
headers: {
'X-API-Key': process.env.WEB3_IDENTITY_API_KEY
}
});

Security Best Practicesโ€‹

Keep Your Keys Safe
  • Never expose API keys in client-side code
  • Use environment variables for storage
  • Rotate keys periodically
  • Use separate keys for dev/staging/production

When to Useโ€‹

  • โœ… Backend services and servers
  • โœ… High-volume production applications
  • โœ… Traditional web applications
  • โŒ Client-side JavaScript (keys will be exposed)

API Key Management โ†’


x402 Micropaymentsโ€‹

When you exceed free tier limits, pay-per-request with x402 protocol.

How It Worksโ€‹

  1. Request exceeds daily limit
  2. API returns 402 Payment Required
  3. Client signs USDC payment on Base
  4. Include payment proof in retry
  5. Request succeeds

Pricingโ€‹

Endpoint CategoryPrice per Request
Basic (ENS, prices)$0.005
Standard (DeFi, social)$0.01
Premium (batch, analytics)$0.02-0.05

Complete x402 Guide โ†’


Choosing the Right Methodโ€‹

Decision Matrixโ€‹

ScenarioRecommended Auth
"I'm just exploring the API"Anonymous
"Building a dApp with wallet connect"SIWE
"Need reliable production access"API Key
"Unpredictable traffic spikes"SIWE + x402 fallback
"Enterprise with SLA requirements"API Key (Enterprise)

Next Stepsโ€‹