Skip to content

Usage & Analytics

Track your API consumption, costs and request patterns from the dashboard.

Dashboard Overview

Overview and Dashboard in the sidebar show:

  • Total requests over a selected period
  • Token consumption (prompt + completion tokens)
  • Cost breakdown by model
  • Request timeline — usage over time

Logs

Usage Logs gives a per-request history (Task Logs covers asynchronous jobs such as image, music and video generation):

Field Description
Time Request timestamp
Key Which API key was used
Model Model called
Prompt Tokens Input token count
Completion Tokens Output token count
Cost Credits charged
Status Success / Error
Duration Request processing time

Filtering Logs

Filter by date range, key name, model and status.

API Access to Logs

Your API key can read its own request history:

curl https://ai.moducompia.com/api/log/token \
  -H "Authorization: Bearer sk-YOUR_API_KEY"

The response is {"success": true, "data": [...]} — one entry per request made with that key, including model, token counts and the credits charged.

Session-only endpoints

/api/log/self and the other /api/log/… routes back the dashboard UI and require a login session; they do not accept API keys. Use /api/log/token from code. It is rate limited more tightly than the model endpoints, so poll it sparingly rather than after every request.

Cost Optimization Tips

  1. Choose the right model — smaller models are significantly cheaper for simple tasks
  2. Set max_tokens — prevent unnecessarily long responses
  3. Use streaming — doesn't save cost, but improves perceived latency
  4. Cache common queries — avoid redundant API calls for identical inputs
  5. Give each key its own quota — catch runaway usage early