Aize Platform LogoAize Platform Docs

Usage Analytics

Monitor your API usage, costs, and performance metrics

Usage Analytics

Track and analyze your Aize Platform usage with comprehensive metrics and insights.

Overview

The Usage & Analytics page provides detailed insights into:

  • API request volumes
  • Token consumption
  • Cost breakdown
  • Model usage patterns
  • Performance metrics
  • Team activity (for Admins/Owners)

Key Metrics

Total Requests

What it shows:

  • Lifetime count of all API calls
  • Includes successful and failed requests
  • Updates in real-time

Useful for:

  • Understanding overall usage volume
  • Capacity planning
  • Rate limit monitoring
  • Trend analysis

View breakdown by:

  • Time period (daily, weekly, monthly)
  • Model
  • API key
  • Team member (Admins/Owners)
  • Status code (success/error)

Total Tokens

What it shows:

  • Combined input + output tokens
  • Lifetime aggregation
  • Separate input/output breakdown available

Token types:

  • Input tokens: Text you send in prompts
  • Output tokens: Generated responses
  • Total tokens: Sum of both

Why it matters:

  • Output tokens typically cost 2-3x input tokens
  • Helps optimize prompt engineering
  • Indicates data volume processed

Conversion guide:

  • ~1 token = 4 characters
  • ~1 token = 0.75 words
  • ~100 tokens = 75 words
  • ~1000 tokens = ~750 words or 1-2 pages

Total Cost

What it shows:

  • Lifetime spending in USD
  • Sum of all usage deductions
  • Excludes deposits and refunds

Cost components:

Request Cost = (Base Model Cost × Tokens) × Markup + Fixed Fee

View breakdown:

  • Cost per model
  • Cost per API key
  • Cost per team member
  • Cost trends over time

Current Spend

What it shows:

  • Current billing period spending
  • Resets based on organization tier
  • Progress towards any budget limits set

Color coding:

  • Green: Under 75% of budget
  • Yellow: 75-90% of budget
  • Red: Over 90% of budget

Request Logs

Detailed view of every API call made to the gateway.

Log Record Information

Each request record includes:

Request Identification:

  • Request ID: Unique UUID for tracing
  • Timestamp: Exact date and time
  • API Key: Which key was used (label shown)
  • User: Member who made request (team keys only)

Model Information:

  • Model Alias: What you requested (e.g., "gpt-4")
  • Provider Model: Actual model used (e.g., "gpt-4-0613")
  • Endpoint: API endpoint called (/v1/chat/completions)

Token Usage:

  • Input Tokens: Tokens in your prompt
  • Output Tokens: Tokens in response
  • Total Tokens: Combined count

Cost Breakdown:

  • Provider Cost: What we pay the AI provider
  • Customer Cost: What you're charged
  • Markup: Our markup (transparent)
  • Fixed Fee: Per-request fee (if applicable)

Performance:

  • Latency: Time to complete request (milliseconds)
  • Status Code: HTTP response code (200, 401, 402, etc.)
  • Error Message: Details if request failed

Metadata (expandable):

  • Model parameters (temperature, max_tokens, etc.)
  • Full request/response (if logging enabled)
  • Provider-specific details

Filtering Logs

By Time Period:

  • Last hour
  • Last 24 hours
  • Last 7 days
  • Last 30 days
  • Custom date range

By Status:

  • All requests
  • Successful only (2xx)
  • Client errors (4xx)
  • Server errors (5xx)

By Model:

  • Filter to specific model
  • Compare across models
  • Identify most-used models

By API Key:

  • View logs for specific key
  • Useful for debugging
  • Track key usage patterns

By User (Admins/Owners only):

  • See team member activity
  • Identify high-usage users
  • Track individual costs

"My Logs Only" (Members):

  • Toggle to see only your requests
  • Hides team activity
  • Privacy-focused view

Pagination

  • Page size: 50 records per page
  • Load more: Click to see older records
  • Export: Download as CSV (coming soon)

Cost Analysis

Understanding Costs

Provider Cost vs Customer Cost:

Provider Cost: $0.10      (what we pay)
Markup (25%):   $0.025    (our margin)
Fixed Fee:      $0.01     (per-request fee)
─────────────────────────
Customer Cost:  $0.135    (what you pay)

Why the difference?:

  • Infrastructure costs
  • Support and maintenance
  • Payment processing fees
  • Service reliability guarantees
  • Additional features (caching, routing, fallbacks)

Transparency:

  • Both costs shown in request logs
  • Clear markup percentage
  • No hidden fees
  • Predictable pricing

Cost Optimization Tips

1. Choose the Right Model:

  • Simple tasks: Use GPT-3.5 Turbo (~10x cheaper than GPT-4)
  • Complex reasoning: Use GPT-4 or Claude
  • Code generation: Consider GPT-4 Turbo
  • General chat: GPT-3.5 Turbo sufficient

2. Optimize Prompts:

  • Be concise but clear
  • Remove unnecessary examples
  • Use system messages efficiently
  • Avoid redundant instructions

3. Control Output Length:

  • Set appropriate max_tokens
  • Don't request more than needed
  • Output tokens cost more than input

4. Use Streaming:

  • Same cost, better UX
  • Users see results faster
  • Can cancel if sufficient

5. Implement Caching:

  • Cache common responses
  • Reduce repeat requests
  • Significant savings for high-traffic apps

6. Set Budget Limits:

  • Per-key monthly limits
  • Team member budgets
  • Alert before overspending

Cost Per Request Analysis

Average cost:

Average = Total Cost / Total Requests

Track trends:

  • Is average increasing? (using more expensive models?)
  • Sudden spikes? (longer outputs or errors?)
  • Compare against budget expectations

Example averages by model:

  • GPT-3.5 Turbo: $0.001 - $0.005 per request
  • GPT-4: $0.01 - $0.05 per request
  • Claude 3 Opus: $0.015 - $0.075 per request

Performance Analytics

Latency Metrics

What we measure:

  • Time from request received to response complete
  • Includes:
    • API processing time
    • Model inference time
    • Network latency
    • Queue wait time (if any)

Typical latencies:

  • Fast models (GPT-3.5): 500-2000ms
  • Standard models (GPT-4): 2000-5000ms
  • Large outputs: Can be 10+ seconds

Monitoring:

  • Average latency per model
  • P50, P95, P99 percentiles (coming soon)
  • Identify slow requests
  • Track performance trends

Success Rate

HTTP Status Codes:

  • 2xx Success: Request completed successfully
  • 4xx Client Error: Problem with your request
  • 5xx Server Error: Issue on our side or provider

Track success rate:

Success Rate = (2xx responses / Total responses) × 100%

Target: > 99% success rate

Common errors:

  • 401 Unauthorized: Invalid API key
  • 402 Payment Required: Insufficient balance
  • 403 Forbidden: Model not allowed for key
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Temporary issue
  • 503 Service Unavailable: Provider down

Error Analysis

View errors:

  1. Go to Request Logs
  2. Filter by status code (4xx, 5xx)
  3. Review error messages
  4. Identify patterns

Common patterns:

  • Spikes in 429: Need rate limit increase
  • 401 errors: Key was revoked or blocked
  • 402 errors: Wallet needs refill
  • 500 errors: Contact support if persistent

Team Analytics (Admin/Owner)

Per-Member Usage

View individual member activity:

  1. Go to Request Logs
  2. Filter by team member
  3. See their metrics:
    • Total requests
    • Token usage
    • Cost incurred
    • Models used
    • Error rates

Use cases:

  • Identify power users
  • Budget allocation
  • Training needs
  • Cost attribution

Per-Key Analytics

Track API key usage:

  1. Go to Request Logs
  2. Filter by API key
  3. Analyze:
    • Usage patterns
    • Cost trends
    • Error rates
    • Model preferences

Use cases:

  • Identify problematic keys
  • Optimize key limits
  • Debug integration issues
  • Plan key rotation

Monitor team costs:

  • Daily spending breakdown
  • Week-over-week trends
  • Month-over-month growth
  • Per-member cost attribution

Set team budgets:

  • Organization-wide limits
  • Per-key limits
  • Per-member quotas (via key limits)
  • Alert on threshold breaches

Export and Reporting

Data Export

Available formats:

  • CSV (coming soon)
  • JSON (coming soon)
  • API access (coming soon)

What you can export:

  • Request logs
  • Cost reports
  • Usage summaries
  • Token breakdowns

Use cases:

  • Financial reconciliation
  • Custom analytics
  • Business intelligence
  • Compliance reporting

Scheduled Reports

Coming soon:

  • Daily usage summaries
  • Weekly cost reports
  • Monthly spending analysis
  • Custom report schedules

Access Control

Who Can View Analytics?

MetricMemberAdminOwner
Own requests
Own costs
Team requests
Team costs
All API keys
Cost breakdowns
Export data

Privacy

Member privacy:

  • Members see only own activity
  • Cannot view team spending
  • No access to other members' logs
  • Perfect for contractors/consultants

Team transparency:

  • Admins/Owners see all activity
  • Required for cost management
  • Enables proper budgeting
  • Supports accountability

Best Practices

Regular Monitoring

Daily:

  • Check wallet balance
  • Review any errors
  • Monitor spending trends

Weekly:

  • Analyze per-key usage
  • Review team activity
  • Check for anomalies

Monthly:

  • Full cost analysis
  • Model usage review
  • Budget vs actual comparison
  • Optimize based on trends

Setting Up Alerts

Wallet alerts:

  • Low balance threshold ($10 default)
  • Email when triggered
  • Adjust in Organization Settings

API key alerts:

  • Monthly limit warnings (75%, 90%, 100%)
  • Automatic blocking at limit
  • Email notifications

Usage alerts (coming soon):

  • Daily spending thresholds
  • Unusual activity detection
  • Error rate spikes

Cost Governance

For small teams:

  • Set reasonable monthly limits per key
  • Monitor weekly
  • Review monthly for trends

For larger teams:

  • Per-key limits strictly enforced
  • Per-member quotas
  • Approval process for high-limit keys
  • Monthly cost reviews with team leads

Troubleshooting

Missing Logs

Problem: Don't see recent requests in logs

Possible causes:

  • Filters applied (check filter settings)
  • "My Logs Only" toggled (if you're looking for team logs)
  • Page not refreshed (refresh to see latest)

Solution: Clear filters and refresh

Costs Don't Match Expectations

Problem: Costs higher than anticipated

Investigation steps:

  1. Check Request Logs for high-cost requests
  2. Identify which models being used (GPT-4 vs GPT-3.5)
  3. Look at token counts (unexpectedly long outputs?)
  4. Check for errors (retries can double costs)
  5. Review API key usage (is a key being overused?)

Solutions:

  • Switch to cheaper models where appropriate
  • Reduce max_tokens parameter
  • Optimize prompts to be more concise
  • Fix error causes to prevent retries
  • Set stricter API key limits

High Error Rates

Problem: Many failed requests

Check:

  1. Filter logs by error status (4xx, 5xx)
  2. Read error messages
  3. Identify patterns (same key? same model? same time?)

Common fixes:

  • 401: Check API key is valid
  • 402: Refill wallet
  • 429: Reduce request rate or contact for limit increase
  • 500/503: Wait and retry, or contact support if persistent

Next Steps

On this page