API keys

Manage your API keys from the console or over the API. Every endpoint is served at https://api.eclogue.ai.

Portal API (key management)

Requires a Supabase JWT token, obtained after signing in to the console.

MethodPathDescription
GET/portal/keysList all of your keys
POST/portal/keysCreate a new key
PATCH/portal/keys/:idUpdate a key (name, model allowlist)
DELETE/portal/keys/:idRevoke a key

Create a key

curl -X POST https://api.eclogue.ai/portal/keys \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-app", "allowed_models": ["deepseek-chat"]}'
{
  "data": {
    "id": "uuid-xxx",
    "raw_key": "gw-my-app-abc123...",
    "name": "my-app",
    "allowed_models": ["deepseek-chat"]
  }
}

raw_key is returned only once, at creation. Store it securely.

Key properties

FieldTypeDescription
namestringHuman-readable label
allowed_modelsstring[]Model allowlist (empty array = all models allowed)
spending_limitnumberSpending cap (USD)
limit_resetstring"daily", "weekly", "monthly" or "never"
expires_atstringExpiry time in ISO 8601 format
is_activebooleanEnable or disable the key

Inspect a key

Use the API key itself to check its balance and usage — no JWT required:

curl https://api.eclogue.ai/v1/auth/key \
  -H "Authorization: Bearer gw-your-key"
{
  "data": {
    "label": "gw-my-app-...",
    "limit": 100.0,
    "usage": 25.5,
    "limit_remaining": 74.5,
    "limit_reset": "monthly"
  }
}