Ingest a usage event
Record a single usage event for metering and analytics.
This endpoint only records the event without checking quotas or rate limits. For quota enforcement and rate limiting, use POST /v1/track instead.
When to use this endpoint:
- Recording events for analytics only
- Post-event tracking after successful operations
- Bulk ingestion without enforcement
When to use /v1/track instead:
- Need quota enforcement before processing
- Need rate limit checking
- Want all-in-one tracking with enforcement
Authorization
Bearer Project API key
In: header
Request Body
application/json
Your customer's identifier (e.g., user ID, tenant ID)
1 <= lengthType of event (e.g., "model_call", "embedding", "tool_call")
1 <= lengthModel used (e.g., "gpt-4", "claude-3-opus", "gpt-3.5-turbo")
Provider name (e.g., "openai", "anthropic", "google")
Number of input tokens consumed
0 <= valueNumber of output tokens generated
0 <= valueTotal tokens (auto-calculated if not provided)
0 <= valueRequest latency in milliseconds
0 <= valueCost in cents (e.g., 25 = $0.25)
0 <= valueCustom dimensions for filtering and grouping (e.g., user_id, team_id, feature)
Unique key for deduplication (prevents duplicate events)
ISO 8601 timestamp (defaults to current time if not provided)
date-timeResponse Body
application/json
application/json
application/json
curl -X POST "https://api.limitry.com/v1/events" \ -H "Content-Type: application/json" \ -d '{ "customerId": "cust_123", "eventType": "model_call", "model": "gpt-4", "provider": "openai", "inputTokens": 150, "outputTokens": 50, "totalTokens": 200, "latencyMs": 1200, "costCents": 25, "properties": { "user_id": "user_456", "team_id": "team_eng", "feature": "chat" }, "idempotencyKey": "req_abc123", "timestamp": "2024-01-15T10:30:00Z" }'{
"id": "evt_abc123"
}{
"error": "Invalid request"
}{
"error": "Invalid or missing API key"
}