{% extends "base.html" %} {% block title %}LLM usage · Keywright{% endblock %} {% macro number(value) %}{{ '{:,}'.format(value) }}{% endmacro %} {% macro counts(t) %} {{ number(t.requests) }} {{ number(t.input) }} {{ number(t.output) }} {{ number(t.total) }} {{ number(t.reported) }}/{{ number(t.requests) }} reported{% if t.partial %}
{{ t.partial }} partial
{% endif %} {{ number(t.errors) }} {% endmacro %} {% macro headings(first) %}{{ first }}RequestsInputOutputTotal tokensCoverageErrors{% endmacro %} {% block body %}

LLM usage

Track model activity across providers and see which agents and gateway keys drive it.

{% for dimension, label in [('provider', 'Provider / gateway'), ('model', 'Model'), ('agent', 'Agent'), ('key', 'Gateway key')] %}
{% endfor %}
ResetDates are inclusive. Ranked by reported tokens, then requests.
Requests
{{ number(totals.requests) }}
{{ totals.errors }} errors
Reported tokens
{{ number(totals.total) }}
{{ number(totals.input) }} input · {{ number(totals.output) }} output
Provider / gateways
{{ providers | length }}
{{ models | length }} model names
Requests with usage
{{ totals.reported }} / {{ totals.requests }}
{{ totals.unreported }} unreported · {{ totals.partial }} partial

Usage observed by the Keywright proxy, including failed upstream attempts. Denied requests and model listings are excluded. Missing usage is unknown, not zero; totals include only reported counts. Input includes cache reads and writes. Older streams, compressed responses, and streams without usage may be unreported. Direct provider calls and provider billing costs are not included.

{% if totals.requests %}

Providers → models

Each provider is a configured gateway. The same model stays separate under each gateway.

{% for p in providers %}
{{ p.name }}{{ number(p.totals.total) }} tokens · {{ number(p.totals.requests) }} requests

Focus on {{ p.name }}

{{ headings('Model') }} {% for m in p.models.values() | sort(attribute='totals.total', reverse=true) %} {{ counts(m.totals) }} {% endfor %}
{{ m.name }}
{% endfor %}

Models across selected providers

{{ headings('Model') }} {% for name, t in models %}{{ counts(t) }}{% endfor %}
{{ name }}

Keys driving usage

{{ headings('Gateway key / agent') }} {% for k in keys %}{{ counts(k.totals) }}{% endfor %}
{{ k.alias }}
{{ k.agent }} · {{ k.provider }}
{{ k.models | sort | join(', ') }}
{% if not k.key_id.startswith('legacy:') %}
{{ k.key_id }}
{% endif %}

Daily usage (UTC)

{{ headings('Date') }} {% for day, t in days | reverse %}{{ counts(t) }}{% endfor %}
{{ day }}
Recent requests · latest {{ recent | length }} matching calls {% for event in recent %}{% endfor %}
Time (UTC)Provider / modelAgent / keyTokensResult
{{ event.ts.strftime('%Y-%m-%d %H:%M:%S') }} {{ event.provider }}
{{ event.model }}
{{ event.agent }}
{{ event.alias }}
{{ number(event.total) if event.total is not none else 'Unreported' }} {{ event.decision }}
{% else %}

No usage in this selection

Try a wider date range or clear the filters. Model calls through Keywright will appear here after their responses finish.

{% endif %} {% endblock %}