Skip to main content
Docs
Usage Tracking

Usage Tracking

Monitor API requests, token consumption, and usage patterns.

Track your organization's API usage to understand consumption patterns, optimize performance, and plan capacity.

Usage Metrics

Request Tracking

MetricDescription
Total RequestsAll API calls made
Requests/DayDaily request volume
Peak RequestsHighest request rate
Success RatePercentage of successful calls

Token Tracking

MetricDescription
Input TokensPrompt token consumption
Output TokensResponse token consumption
Tokens/RequestAverage tokens per call
Token EfficiencyOutput/input ratio

Viewing Usage

Usage Dashboard

  1. Go to Analytics > Usage
  2. Select your time range
  3. View usage charts and tables

By Model

See which models you use most:

ModelRequestsTokensCost
gpt-4o-mini10,0005M$15
claude-3-haiku5,0002M$10
gpt-4o2,0001M$25

By API Key

Track usage per key:

KeyRequestsTokensCost
production-api15,0007M$45
development2,0001M$5

Usage Patterns

Time-Based Analysis

View usage by:

  • Hour of day: Identify peak times
  • Day of week: Weekday vs weekend patterns
  • Month: Seasonal trends

Request Types

Break down by endpoint:

  • Chat completions
  • Embeddings
  • Completions (legacy)

Token Optimization

Understanding Token Counts

Tokens are roughly:

  • 1 token ≈ 4 characters in English
  • 1 token ≈ 0.75 words

Reducing Token Usage

  1. Concise prompts: Remove unnecessary text
  2. Set max_tokens: Limit response length
  3. Use smaller models: For simple tasks
  4. Cache responses: For repeated queries

Efficient Prompting

# Verbose (more tokens)
"Please analyze the following text and provide a comprehensive summary
that covers all the main points and key details..."

# Concise (fewer tokens)
"Summarize this text:"

Alerts and Notifications

Set up usage alerts:

  • Daily/weekly usage reports
  • Threshold alerts (e.g., 80% of budget)
  • Unusual activity notifications

Quotas and Limits

Storage Quotas by Plan

PlanStorage
Free500 MB
Standard5 GB
Premium15 GB
Enterprise1 TB

Viewing Quota Usage

  1. Go to Analytics > Storage
  2. See current usage vs limit
  3. View breakdown by type

API Access to Usage Data

Query usage programmatically (where available):

# Example: Get usage summary
# Note: Usage API availability depends on your plan
Usage Tracking | elyxir