Getting Started

Wallet Authentication (SIWX)

If you already have a crypto wallet, you can use it to authenticate with Hober directly. No email, no password, no account creation. This uses CAIP-122, the same "Sign-In With X" standard used by dApps across Solana and EVM chains.

Wallet auth is ideal for web apps where users already have a wallet connected (like a DeFi dashboard or an agent management portal). For server-to-server calls, use an API key instead. For autonomous agents, consider x402 which requires no authentication at all.

When to Use Which Auth Method

MethodDurationUse Case
API KeyPermanentServer-to-server, CI/CD, backend apps
JWT Session24 hoursWeb apps, dashboards, interactive use
Inference Pass30 days / N requestsPrepaid access, agent wallets
x402 (no auth)Per requestWallet-only, no account needed

SIWX Flow

# Step 1: Get a challenge
curl "https://api.hober.dev/api/siwx/challenge?wallet=YOUR_WALLET"

# Response: { "message": "api.hober.dev wants you to sign in...", "nonce": "<64 hex chars>", "issuedAt": "..." }
# The message includes "Chain ID: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" and "Expiration Time" (issuedAt + 5 min)
# Any failure returns 401 { "error": { "code": "invalid_signature", ... } } and burns the nonce

# Step 2: Sign the message with your wallet, then create session
curl -X POST https://api.hober.dev/api/siwx/session \
  -H "Content-Type: application/json" \
  -d '{
    "message": "THE_CHALLENGE_MESSAGE",
    "signature": "BASE58_SIGNATURE",
    "walletAddress": "YOUR_WALLET"
  }'

# Response: { "token": "eyJhbG...", "developerId": "...", "walletAddress": "YOUR_WALLET" }

Sign the returned message unchanged, with the same wallet, within 5 minutes, and request a new challenge after any failure.

Supported Chains

SIWX sign-in works with Solana wallets only. EVM wallets are not supported on this endpoint.

ChainSignatureVerification
Solanaed25519nacl.sign.detached.verify

Endpoints

MethodEndpointDescription
GET/api/siwx/challengeGet nonce + sign message
POST/api/siwx/sessionCreate JWT session from signed message
POST/api/siwx/pass/purchaseBuy inference pass (N requests / 30 days)
GET/api/siwx/pass/statusCheck pass remaining requests