Skip to content

kristopolous/sliceable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sliceable

A team API key budgeting platform. Owners deposit master API credentials, set monthly credit allocations for team members, and members provision their own budget-limited sub-keys however they see fit.

How It Works

Owners store master API keys (e.g., an OpenRouter key) in an encrypted vault, invite team members, and assign each member a monthly credit budget.

Members spend their allocated credits by provisioning sub-keys — scoped, time-limited API keys with hard spending caps. A member with a $100/month budget might allocate $20 to OpenRouter and $30 to cloud storage, keeping the rest for later.

Every key provisioned and every credit allocation is recorded in a full audit trail.

Architecture

  • Next.js 15 (App Router) with server components and server actions
  • StackAuth for authentication, teams, and role-based permissions (owner / user)
  • Postgres via the postgres library (raw SQL, no ORM)
  • AES-256-GCM encryption for master keys at rest
  • ServiceAdapter pattern for pluggable provider integrations

Pages

Route Role Description
/my-keys All View provisioned sub-keys; owners also manage master keys here
/store Member Provision new budget-limited sub-keys
/vault Owner Manage master API credentials
/members Owner View team members and allocate monthly budgets
/audit Owner Full transaction and provisioning log
/dashboard All Overview with stats and recent activity

Supported Services

Service Status
OpenRouter ✅ Live
AWS S3 🔜 Planned
RunPod 🔜 Planned

New providers are added by implementing the ServiceAdapter interface in src/lib/services/.

Setup

cp .env.example .env.local
# Fill in DATABASE_URL, ENCRYPTION_KEY, and StackAuth credentials

npm install
npm run dev

Initialize the database with schema.sql:

psql $DATABASE_URL < schema.sql

Database Schema

Three tables:

  • master_keys — Encrypted root credentials stored by owners, scoped to an org
  • api_keys — Provisioned sub-keys with budget caps, usage tracking, and expiry
  • transactions — Audit log of all credit allocations and key purchases

Permissions

Roles are managed via StackAuth team permissions:

  • owner — Can store master keys, invite members, allocate budgets, view audit logs
  • user — Can provision sub-keys within their allocated budget

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages