What Are Blueprints?
Each blueprint includes:- Event structure recommendations: Optimal event naming and metadata design
- Meter configuration: Suggested aggregation types and filters
- Sample code: Working implementation examples in multiple languages
- Best practices: Tips for accuracy, performance, and cost optimization
Blueprints save hours of setup time and help you avoid common pitfalls. Start with a blueprint, then adapt it to your specific requirements.
Why Use Blueprints?
Faster Setup
Get usage tracking working in minutes instead of hours. Copy proven patterns instead of designing from scratch.
Best Practices Built In
Avoid common mistakes with tested event structures, proper metadata, and optimal aggregation choices.
Production Ready
Sample code is based on real-world implementations. Just add your API keys and go.
Available Blueprints
Choose the blueprint that matches your use case:LLM Blueprint
Track AI token usage across OpenAI, Anthropic, Groq, Gemini, Vercel AI SDK, and more.Perfect for: AI chatbots, code generators, content creation tools, AI-powered apps.What you’ll track: Input tokens, output tokens, model usage, request counts.
API Gateway Blueprint
Meter API requests at the gateway level with endpoint filtering and rate limiting support.Perfect for: REST APIs, GraphQL services, webhook providers, API-first platforms.What you’ll track: Request counts, endpoint usage, HTTP methods, response times.
Object Storage Blueprint
Track file uploads, storage consumption, and bandwidth for cloud storage services.Perfect for: File hosting, media platforms, backup services, document management.What you’ll track: Bytes stored, file uploads, downloads, storage snapshots.
Stream Blueprint
Measure streaming bandwidth for video, audio, and real-time data delivery.Perfect for: Video streaming, audio platforms, live broadcasts, real-time data feeds.What you’ll track: Bandwidth consumed, stream duration, quality levels, concurrent streams.
Time Range Blueprint
Bill by elapsed time for compute resources, serverless functions, and long-running jobs.Perfect for: Serverless platforms, container hosting, compute instances, batch processing.What you’ll track: Execution time, compute hours, function invocations, job duration.
How to Use a Blueprint
1
Choose your blueprint
Select the blueprint that best matches your billing scenario. Each blueprint page includes detailed implementation guides.
2
Review the event structure
Understand the recommended event naming and metadata design. Copy the event structure for your use case.
3
Create the meter
Follow the blueprint’s meter configuration instructions. Use the suggested aggregation type and filters.
4
Implement event sending
Copy the sample code for your language/framework. Replace placeholder values with your actual API keys and customer IDs.
5
Test and verify
Send test events and verify they appear in your meter dashboard with correct aggregation.
6
Customize as needed
Adapt the blueprint to your specific requirements—add custom metadata, adjust filters, or modify pricing.
Blueprint Comparison
Not sure which blueprint fits your needs? Here’s a quick comparison:Use Case | Blueprint | Aggregation | Common Metadata |
---|---|---|---|
AI chat app | LLM | Sum (tokens) | model, input_tokens, output_tokens |
REST API | API Gateway | Count | endpoint, method, status_code |
File storage | Object Storage | Sum (bytes) | file_size, file_type, operation |
Video platform | Stream | Sum (bandwidth) | duration, quality, bitrate |
Serverless | Time Range | Sum (duration) | function_name, execution_time_ms |
Custom Implementations
Don’t see a blueprint for your exact use case? No problem:- Start with the closest blueprint: Pick the one most similar to your needs
- Adapt the event structure: Modify metadata fields to match your requirements
- Adjust meter configuration: Change aggregation type or filters as needed
- Test thoroughly: Verify billing calculations with sample usage
All blueprints are starting points. Feel free to mix concepts from different blueprints or create entirely custom implementations.