{% extends "base.html" %} {% from "partials/icons.html" import icon %} {% block title %}API keys · {{ site_title }}{% endblock %} {% block heading %}API keys{% endblock %} {% block content %}
Machine-to-machine credentials with scopes, rate limits and spend caps.
{{ new_key }}
| Name | Key | Scopes | Status | Limit | Spend | 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 %} |
Create one above, then protect an endpoint with
Depends(require_api_key("chat:write")).