{% extends "dashboard/layout.html" %} {% block title %}{{ _('API Keys – Dashboard') }}{% endblock %} {% block dashboard_content %}

{{ _('API Keys') }}

{{ _('Manage your API keys for programmatic access') }}

{% if api_enabled %} {% endif %}
{% if not api_enabled %}

{{ _('API Access Not Available') }}

{{ _('API access is not included in your current plan. Upgrade to unlock the REST API.') }}

{{ _('Upgrade Plan') }}
{% else %} {% if new_key %}

{{ _('Your new API key — save it now') }}

{{ _('This is the only time you will see the full key. Copy it and store it somewhere safe.') }}

{{ new_key }}
{% endif %}
{{ _("Today's Calls") }}
{{ today_usage }}
{% if daily_limit > 0 %}{{ _('of') }} {{ daily_limit }} {{ _('limit') }}{% else %}{{ _('Unlimited') }}{% endif %}
{{ _('Active Keys') }}
{{ keys|selectattr('is_active')|list|length }}
{{ _('of') }} {{ keys|length }} {{ _('total') }}
{{ _('Daily Limit') }}
{% if daily_limit < 0 %}{{ _('∞') }}{% else %}{{ daily_limit }}{% endif %}
{{ plan.name if plan else _('Current plan') }}

{{ _('Your API Keys') }}

{% if keys %}
{% for key in keys %}
{{ key.name }} {% if key.is_active %} {{ _('Active') }} {% else %} {{ _('Revoked') }} {% endif %}
{{ key.display_prefix }}•••••••••••••••• {{ _('Key hidden for security') }}
{{ _('Created') }}: {{ key.created_at[:10] if key.created_at else '–' }} {{ _('Used') }}: {{ key.usage_count }} {{ _('times') }} {% if key.last_used_at %}{{ _('Last used') }}: {{ key.last_used_at[:10] }}{% endif %} {% if key.restriction_type != 'all' %} {{ _('Restricted to') }}: {{ key.restriction_type }} {% endif %}
{% if key.is_active %}
{% endif %}
{% endfor %}
{% else %}

{{ _('No API keys yet') }}

{{ _('Create your first API key to get started.') }}

{% endif %}
{{ _('API Documentation') }}
{{ _('Explore all available endpoints, request formats, and code examples.') }}
{{ _('View Docs') }}
{% endif %}
{% if api_enabled %} {% endif %} {% endblock %}