Skip to main content
Ingestion blueprints are pre-built patterns for tracking usage in common scenarios. Instead of figuring out event structures and meter configurations from scratch, start with a proven blueprint and customize it for your needs.

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 CaseBlueprintAggregationCommon Metadata
AI chat appLLMSum (tokens)model, input_tokens, output_tokens
REST APIAPI GatewayCountendpoint, method, status_code
File storageObject StorageSum (bytes)file_size, file_type, operation
Video platformStreamSum (bandwidth)duration, quality, bitrate
ServerlessTime RangeSum (duration)function_name, execution_time_ms

Custom Implementations

Don’t see a blueprint for your exact use case? No problem:
  1. Start with the closest blueprint: Pick the one most similar to your needs
  2. Adapt the event structure: Modify metadata fields to match your requirements
  3. Adjust meter configuration: Change aggregation type or filters as needed
  4. 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.

Need Help?

If you’re unsure which blueprint to use or need help customizing:

Complete Tutorial

Follow our end-to-end tutorial building an AI image generator with usage billing.

Integration Guide

Comprehensive guide covering all aspects of usage-based billing implementation.