Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider’s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.
billable_customer_id is required in the context object. You can add any additional fields. They will be stored and available for filtering in your dashboard.
| Code | Meaning |
|---|---|
202 Accepted | All transactions queued |
207 Multi-Status | Some succeeded, some failed |
400 Bad Request | Validation error |
401 Unauthorized | Invalid API key |
500 Internal Error | Server error |
API key for authentication. Must be associated with an active organization.
Either a single transaction or a bulk request containing multiple transactions
AI provider. Fenra automatically applies the correct pricing for each provider. Use 'custom' for providers not yet supported, combined with custom pricing configuration in your dashboard.
openai, gemini, bedrock, anthropic, xai, deepseek, custom The model identifier (e.g., 'gpt-4o', 'claude-3-opus', 'gemini-pro')
1"gpt-4o"
"claude-3-opus"
"gemini-1.5-pro"
Array of usage entries. Each usage type may appear at most once per transaction.
1Only billable_customer_id is required. Add any additional fields (environment, feature, user_id, team, etc.) and they will appear in your dashboard for filtering, alerts, and reports.
Optional model tier classification for custom pricing tiers
Optional raw usage data from the provider for debugging or auditing
All transactions queued successfully