{% extends "layouts/base.html" %} {% block main_content %} {% set breadcrumbs = [ {"name": t('nav.settings'), "url": "/settings", "icon": "fas fa-cog"}, {"name": t('settings.api_tokens'), "icon": "fas fa-key"} ] %} {% set header_title = t('settings.api_tokens') %} {% set header_subtitle = t('tokens.title') %} {% set header_icon = "fas fa-key" %} {% set header_actions = [ { "type": "button", "text": t('tokens.generate'), "url": "#", "icon": "fas fa-plus", "style": "primary", "onclick": "showCreateToken()" } ] %} {% include "components/page_header.html" %}

Total Tokens

{{ stats.total_active if stats else 0 }}

Active

{{ stats.used_tokens if stats else 0 }}

Expiring

{{ stats.will_expire if stats else 0 }}

Never Expire

{{ stats.never_expire if stats else 0 }}

Your API Tokens

These tokens allow you to access the API programmatically

{% if tokens %} {% for token in tokens %}

{{ token.name }}

{% if token.is_active %} Active {% else %} Revoked {% endif %}
{{ token.token_prefix }}*** Created {{ token.created_at }} {% if token.expires_at %} Expires {{ token.expires_at }} {% else %} Never expires {% endif %}
{% if token.last_used %} Last used: {{ token.last_used }} {% else %} Never used {% endif %}
{% if token.is_active %} {% else %} Token revoked {% endif %}
{% endfor %} {% else %}

No API tokens yet

Generate your first API token to get started with programmatic access

{% endif %}

Security Guidelines

Keep your API tokens secure and never share them publicly
Use different tokens for different applications or environments
Regularly rotate your tokens for enhanced security
Delete tokens that are no longer needed

API Documentation

Learn how to use the API with your tokens

Full API Docs

Quick Start Examples

cURL
curl -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     "https://your-domain.com/api/prompts"
JavaScript
fetch('/api/prompts', {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
}).then(response => response.json())
Python
import requests

headers = {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
}
response = requests.get('/api/prompts', headers=headers)
Node.js
const axios = require('axios');

const response = await axios.get('/api/prompts', {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
});

Available Endpoints

GET /api/prompts
POST /api/tokens
GET /api/categories
GET /api/user/info
DELETE /api/tokens/{id}
GET /api/stats
{% endblock %}