Skip to main content
Every AI API call can be tracked as a transaction.

Basic Flow

  1. Make your AI provider call
  2. Extract usage from the response
  3. Send to Fenra’s API

Transaction Schema

Every transaction needs:

Context

Only billable_customer_id is required. Everything else is flexible context you can use for filtering, alerts, and reports. Example with common fields:
What you can do with context fields:
  • Filter in Cost Explorer: Show only production costs, or only a specific feature
  • Create targeted alerts: Alert when a specific feature exceeds a threshold
  • Build custom dashboards: Widgets filtered to specific context
  • Generate filtered reports: Reports scoped to specific environments or teams
Send whatever context makes sense for your use case. If you can filter by it, you can track it.

Usage Types

Tokens (most common)

For text generation, chat, and reasoning models:
Optional token metrics:

Images

For image generation:

Audio

For speech-to-text or text-to-speech:

Video

For video processing:

Requests

For flat per-request pricing:

Custom

For custom billing models:

Bulk Transactions

Send multiple transactions in one request:

Response Codes

Next Steps