Authentication
Bithaven uses two authentication methods depending on the context.
JWT (Dashboard & REST API)
Human users authenticate with email/password and receive a JWT token valid for 7 days.
# Login
curl -X POST https://api.bithaven.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "your_password"}'
# Response
{ "success": true, "data": { "user": {...}, "token": "eyJhbG..." } }
# Use token in subsequent requests
curl https://api.bithaven.ai/api/v1/wallet \
-H "Authorization: Bearer eyJhbG..."API Keys (MCP / Agent Access)
AI agents authenticate with scoped API keys generated from the dashboard. Keys are tied to a specific agent wallet and have read/write scopes.
# MCP tool call with API key
curl -X POST https://api.bithaven.ai/mcp/v1/tools/check_balance \
-H "Authorization: Bearer bh_live_abc123..." \
-H "Content-Type: application/json" \
-d '{}'⚠️ API Key Security
- Keys start with
bh_live_and are shown only once at creation - Only the hash is stored — Bithaven cannot recover a lost key
- Keys can be revoked instantly from the dashboard
- Use API key rotation to replace keys without downtime
Scopes
| Scope | Allows |
|---|---|
read | check_balance, get_tx_history |
write | send_payment, request_approval |
read,write | All tools (default) |