REST endpoints for building on top of Opentip. All endpoints return JSON.
Most endpoints require an authenticated session via NextAuth. The session cookie (next-auth.session-token) must be included in requests. Admin endpoints additionally require a linked wallet matching an admin address.
Public endpoints (repos, tips, leaderboard, stats, profile) do not require authentication.
/api/reposPaginated list of registered repos. Returns GitHub metadata (avatar, description, stars) when available.
Parameters
pagenumber— Page number (default 1)limitnumber— Results per page (default 20)sortstring— Sort by: tipped, recent, tipsqstring— Search by repo name/api/registered-reposRepos registered by the current user (through their linked wallets). Requires authentication.
/api/repos/summaryAI-generated summary for a registered repo. Uses Groq to analyze README, config files, and source code. Cached for 7 days. Auto-generated on first visit if missing.
Parameters
repoIdstringrequired— Repo ID (e.g. owner/repo)/api/repos/linksFetch custom links for a registered repo. Returns JSON array of {title, url} objects.
Parameters
repoIdstringrequired— Repo ID (e.g. owner/repo)/api/repos/linksUpdate custom links for a registered repo. Replaces all links. Max 10 links. Requires authentication (repo owner).
Parameters
repoIdstringrequired— Repo IDlinksarrayrequired— Array of {title, url} objects/api/tipsPaginated list of tips. Returns display names when set.
Parameters
pagenumber— Page number (default 1)limitnumber— Results per page (default 20)repoIdstring— Filter by repo ID (e.g. owner/repo)/api/leaderboardTop 20 tippers by lifetime USDC amount. Raw SQL aggregation.
Parameters
repoIdstring— Filter by repo ID/api/statsGlobal platform statistics: total volume, total tips, developers paid.
/api/dev/[login]Public profile data for a developer by GitHub login. Returns name, image, bio, social links, repos, and stats.
/api/dev/profileSave or update developer profile (bio + 6 social links). Requires authentication.
/api/wallet/linkList all wallets linked to the current user. Requires authentication.
/api/wallet/linkLink a wallet. Verifies Ethereum signature. Requires authentication.
Parameters
addressstringrequired— Ethereum addresssignaturestringrequired— Signed messagenoncestringrequired— Random nonce/api/display-nameGet display name for a wallet address.
Parameters
addressstringrequired— Ethereum address/api/display-nameSet a display name for your wallet. Requires signature verification.
Parameters
addressstringrequired— Ethereum addressnamestringrequired— Display name (1-64 chars)signaturestringrequired— Signed message/api/upload/pfpUpload profile picture. Max 2MB. JPEG, PNG, WebP, or GIF. Stored in Azure Blob Storage. Requires authentication.
/api/upload/headerUpload header banner. Max 4MB. Same formats. Stored in Azure Blob Storage. Requires authentication.
/api/verify-ownershipVerifies GitHub repo ownership (owner or admin/write collaborator). Signs an EIP-712 registration permit. Returns signature, expiry, nonce. Requires authentication.
Parameters
repoIdstringrequired— Repo ID (e.g. owner/repo)payoutAddressstringrequired— Payout wallet address/api/account/statusReturns account state: hasGithub, hasEmail, hasPassword, pfp, header, email, githubLogin. Requires authentication.
/api/account/emailAdd email to account (one-time, cannot be changed after set). Requires authentication.
/api/account/passwordSet or change password. Rate-limited to 5 attempts per 15 minutes. Requires authentication.
/api/account/password/reset/requestGenerate reset token and send email via Resend.
Parameters
emailstringrequired— Account email/api/account/password/reset/confirmValidate token and set new password.
Parameters
tokenstringrequired— Reset token from emailpasswordstringrequired— New password (min 8 chars)/api/github/reposProxied GitHub API: fetch user's repos (owner + collaborator) with access token. Requires authentication.
/api/github/metaFetch public GitHub repo metadata (owner, description, stars). Cached 5 minutes. Public.
Parameters
ownerstringrequired— GitHub ownerrepostringrequired— GitHub repo name/api/auth/signupRegister a new email/password account. Minimum 8 characters. Passwords hashed with bcrypt.
Parameters
emailstringrequired— Email addresspasswordstringrequired— Password (min 8 chars)namestring— Display name (optional)All admin endpoints require an authenticated session with a linked wallet matching an admin or owner address. Owner-only endpoints require the owner wallet.
/api/admin/meReturns current admin's role and wallet address.
/api/admin/statsFull stats: totalTips, totalFees, treasuryBalance, totalRepos, totalUsers, recentTips.
/api/admin/reposAll registered repos with payout addresses, tip counts, and balances.
/api/admin/usersAll users with wallets, tip counts, and totals.
/api/admin/tipsPaginated tips with Basescan links. 50 per page.
/api/admin/adminsList all admin records.
/api/admin/adminsAdd an admin. Owner only.
Parameters
addressstringrequired— Wallet addressrolestringrequired— Role: admin or viewer/api/admin/admins/[address]Remove an admin. Owner only.
/api/admin/pausePause the smart contract. Owner only.
/api/admin/unpauseUnpause the smart contract. Owner only.
/api/admin/set-feeUpdate fee basis points on-chain. Owner only.
Parameters
feeBpsnumberrequired— New fee (0-1000)/api/admin/set-treasuryUpdate treasury address on-chain. Owner only.
Parameters
addressstringrequired— New treasury address/api/admin/set-registrarRotate registrar signer on-chain. Owner only.
Parameters
signerstringrequired— New signer address/api/admin/reassignReassign payout address for a repo. Owner only.
Parameters
repoIdstringrequired— Repo IDnewAddressstringrequired— New payout address/api/admin/withdrawWithdraw treasury funds on-chain. Owner only.
Parameters
amountstringrequired— Amount in USDC base units