REST API backend for the Sprinkle developer cloud platform.
Built with Express 5, Drizzle ORM, OpenAI SDK, and Ethers.js. Handles authentication, AI inference proxying, smart wallet operations, relay networking, billing, and domain management.
- Runtime: Node.js 20+, TypeScript
- Framework: Express 5
- Database: PostgreSQL via Drizzle ORM (see sprinkle-db)
- AI: OpenAI SDK (compatible with any OpenAI-compatible provider)
- Onchain: Ethers.js, ERC-4337 smart accounts
- Logging: Pino + pino-http
- Auth: JWT, express-session, OAuth (GitHub, Google)
| Prefix | Description |
|---|---|
/v1/auth |
Sign up, sign in, OAuth callbacks, session management |
/v1/ai |
Chat completions, image generation, speech, embeddings |
/v1/wallets |
Smart account creation, signing, session keys |
/v1/relay |
Intent submission and status tracking |
/v1/keys |
API key management |
/v1/projects |
Project CRUD and configuration |
/v1/billing |
Usage, credits, and onchain billing |
/v1/domains |
Domain provisioning and DNS management |
/v1/analytics |
Usage stats and activity logs |
git clone https://github.com/sprinklelabs/sprinkle-api
cd sprinkle-api
pnpm install
cp .env.example .env
# Fill in your environment variables
pnpm devThe server starts on http://localhost:3000 by default.
See .env.example for the full list. Required keys:
DATABASE_URL=
SESSION_SECRET=
OPENAI_API_KEY=
BACKEND_SIGNER_KEY=
TREASURY_ADDRESS=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
pnpm dev # Start with hot reload
pnpm build # Compile TypeScript
pnpm typecheck # Type-check without emit- Fork the repo and create a feature branch.
- Run
pnpm typecheckbefore committing. - Open a pull request with a clear description of the change.
MIT. See LICENSE.