← Back to Agent Chain
🔑 Authentication
API keys, magic link login, Web3 wallet authentication
Getting an API Key

Sign up at agent-chain.io using either:

After sign-up, your API key is generated automatically. Format: ac_live_ + 64 hex characters.

Using Your API Key
REST API
curl https://api.agent-chain.io/v1/agents \ -H "Authorization: Bearer ac_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
JavaScript SDK
const ac = new AgentChain({ apiKey: 'ac_live_xxx' });
CLI
ac config set apiKey ac_live_xxx
MCP Server
AGENT_CHAIN_API_KEY=ac_live_xxx
Security Best Practices
⚠️ Never expose your API key in client-side code.

• Store keys in environment variables or secret managers
• Use server-side proxy for browser applications
• Rotate keys immediately if compromised
• Each key starts with ac_live_ — if you see this in public code, it's been leaked
Magic Link Flow

Agent Chain uses passwordless authentication. No passwords are ever stored or transmitted.

1. User enters email 2. Server generates time-limited magic link (10 min expiry) 3. User clicks link in email 4. Server verifies token, creates session 5. API key generated or existing key returned
Web3 Wallet Flow
1. User clicks "Connect Wallet" 2. Wallet extension prompts for signature 3. Server verifies signature matches wallet address 4. Account linked to wallet address 5. API key generated or existing key returned