{% extends "base.html" %} {% from "partials/icons.html" import icon %} {% block title %}API keys · {{ site_title }}{% endblock %} {% block heading %}API keys{% endblock %} {% block content %} {% if new_key %}
Copy this key now. Only its hash is stored, so it cannot be shown again.
{{ new_key }}
{% endif %}

Create a key

Space or comma separated.
Requests per minute. Blank for unlimited.
USD. Requests get 402 once exhausted.

Existing keys

{% if keys %}
{% for key in keys %} {% endfor %}
NameKeyScopesStatus LimitSpend Last used Actions
{{ key.name }} gapi_{{ key.prefix }}_•••• {% for scope in key.scopes %} {{ scope }} {% else %} none {% endfor %} {% if not key.is_active %} revoked {% elif key.expires_at and key.expires_at < now %} expired {% else %} active {% endif %} {{ (key.rate_limit_per_minute ~ '/min') if key.rate_limit_per_minute else '—' }} ${{ "%.2f"|format(spend.get(key.id, 0.0)) }}{% if key.monthly_budget_usd %} / ${{ "%.2f"|format(key.monthly_budget_usd) }} {% endif %} {{ key.last_used_at.strftime("%d %b %H:%M") if key.last_used_at else 'never' }} {% if key.is_active %}
{% endif %}
{% else %}

No API keys yet

Create one above, then protect an endpoint with Depends(require_api_key("chat:write")).

{% endif %}
{% endblock %}