See inside your AI agents. Track tokens, costs, latency, and debug failures with a developer-first observability platform.
- Real-time Logging - Stream events from your agents with our simple API
- Cost Tracking - Monitor token usage and costs across all your agents
- Performance Metrics - Track latency, cache hits, and success rates
- Timeline View - Debug agent runs step-by-step
- Multi-tier Billing - Flexible plans from hobbyists to enterprise
git clone https://github.com/yourusername/glass-box.git
cd glass-box
npm install- Create a new Supabase project at supabase.com
- Run the migration in
supabase/migrations/001_initial.sqlin the SQL editor - Copy your project URL and keys to
.env.local
- Create a Stripe account and get test keys from the dashboard
- Create 3 products with monthly prices:
- Hacker: $29/mo
- Startup: $99/mo
- Scale: $299/mo
- Add price IDs to
.env.local - Set up webhook endpoint:
https://yoursite.com/api/stripe/webhook - Listen for events:
checkout.session.completed,customer.subscription.*
cp .env.example .env.local
# Edit .env.local with your keysnpm run seednpm run dev
# Visit http://localhost:3000Get your API key from the Settings page after signing up.
curl -X POST https://app.glassbox.dev/api/ingest \
-H "Content-Type: application/json" \
-H "x-glassbox-key: YOUR_API_KEY" \
-d '{
"request_id": "req_123",
"step_type": "llm",
"tool_name": "gpt-4",
"input_tokens": 150,
"output_tokens": 200,
"cost_usd": 0.0105,
"latency_ms": 1200,
"cache_hit": false,
"status": "ok",
"payload": {
"model": "gpt-4",
"temperature": 0.7
},
"index": 0
}'import { GlassBox } from 'glassbox-sdk'; // Coming soon
const gb = new GlassBox({ apiKey: process.env.GLASSBOX_KEY });
// Log a single step
await gb.log({
requestId: 'req_123',
stepType: 'llm',
toolName: 'gpt-4',
inputTokens: 150,
outputTokens: 200,
costUsd: 0.0105,
latencyMs: 1200,
status: 'ok'
});
// Or use the tracer for automatic tracking
const tracer = gb.trace('req_123');
const response = await tracer.llm('gpt-4', {
messages: [...]
});- Fork this repository
- Import to Vercel
- Add environment variables
- Deploy!
- Enable Supabase RLS policies
- Switch Stripe to live mode
- Set up monitoring (Sentry, PostHog)
- Configure rate limiting
- Set up backup strategy
- Add custom domain
- Enable SSL certificate
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Next.js │────▶│ Supabase │────▶│ Postgres │
│ App Router │ │ Auth/RLS │ │ Database │
└─────────────┘ └──────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Stripe │ │ Events │
│ Billing │ │ Table │
└─────────────┘ └─────────────┘
- Success:
4242 4242 4242 4242 - Decline:
4000 0000 0000 0002 - 3DS Required:
4000 0025 0000 3155
- Ingest API: 60 requests/minute per key
- Dashboard: No limits
- Metrics: Cached for 60 seconds
- Documentation: docs.glassbox.dev
- Discord: discord.gg/glassbox
- Email: support@glassbox.dev
MIT
Built with ❤️ for the AI agent community.