{% extends "admin_layout.html" %} {% import "_page.html" as page_ui %} {% block title %}Spark - Usage{% endblock %} {% block page %}
{{ page_ui.header("Usage and credits", "Model usage by user and connection, in tokens and credits, month by month.") }} {% include "_page_messages.html" %}
Totals by connection

Credits are worked out for each call at its connection's rates when it was made; changing a connection's rates never changes what earlier calls cost.

{% if totals %}
{% for row in totals %} {% endfor %}
ConnectionRequestsInputOutputCache readCache writeTotal tokensCredits
{{ row.connection }} {{ "{:,}".format(row.requests) }} {{ "{:,}".format(row.input_tokens) }} {{ "{:,}".format(row.output_tokens) }} {{ "{:,}".format(row.cache_read_tokens) }} {{ "{:,}".format(row.cache_write_tokens) }} {{ "{:,}".format(row.total_tokens) }} {{ credits(row.credits) }}
{% else %}

No usage recorded for this month.

{% endif %}
Usage by month, user, connection and model
{% if rows %}
{% for row in rows %} {% endfor %}
MonthUserConnectionModelRequestsInputOutputCache readCache writeTotal tokensCredits
{{ row.period }} {{ row.user }} {{ row.connection }} {{ row.model }} {{ "{:,}".format(row.requests) }} {{ "{:,}".format(row.input_tokens) }} {{ "{:,}".format(row.output_tokens) }} {{ "{:,}".format(row.cache_read_tokens) }} {{ "{:,}".format(row.cache_write_tokens) }} {{ "{:,}".format(row.total_tokens) }} {{ credits(row.credits) }}
{% else %}

No usage recorded for this month.

{% endif %}
{% if server %}
This month's credits on metered connections

Allowances are set on each connection's assignments and reset at 00:00 UTC on the first of each month. A user's own assignment wins over their roles'; otherwise the highest allowance of their roles applies. Users are warned at 80%; at 100% new requests on that connection are refused, while a request already running finishes.

{% if standings %}
{% for item in standings %} {% set status = item.status %} {% endfor %}
UserConnectionUsedAllowanceStanding
{{ item.person.label }} {{ status.connection }} {{ credits(status.used) }} {{ credits(status.limit) if status.limit is not none else "No limit" }} {% if status.state == "exceeded" %}Allowance used {% elif status.state == "warning" %}{{ status.percent }}% {% elif status.state == "ok" %}{{ status.percent }}% {% else %}No limit{% endif %}
{% else %}

No metered connection is assigned to anyone yet.

{% endif %}
{% endif %}
{% endblock %}