Bytefusedocs

Integrations

API keys

Issue scoped dt_live_ keys with optional per-key monthly credit budgets. Keys are managed from your dashboard session — the management endpoints authenticate with a JWT, not a key.

Overview

A key is a dt_live_ secret you send in the X-API-Key header to call any tool (see Authentication). Only a hash is stored — the full secret is shown once, at creation. All management endpoints below live under /api/v1/keys and require a dashboard JWT.

Endpoints

POSThttps://api.bytefuse.in/api/v1/keys
GET/api/v1/keysList your keys (no secrets)
GET/api/v1/keys/limitsYour plan’s key-count limit
GET/api/v1/keys/scopesCatalog of scopable operations
DELETE/api/v1/keys/{key_id}Revoke a key (204)

Creating a key

POST /api/v1/keys with a JSON body:

namestringrequired
A label, 1–255 characters.
descriptionstringoptional
Up to 500 characters.
permissionsstring[]optional
Subset of read, write, delete, admin. An unknown value returns 422.Default: ["read","write"]
scopesstring[]optional
Allowed operation_keys (e.g. pdf.compress). Omit, [], or ["*"] means full access.Default: full access
credit_limitintoptional
A monthly per-key credit budget. Omit for no cap.
expires_in_daysintoptional
1–3650. Omit for a non-expiring key.

Returns 201 with the key’s metadata plus api_key — the full dt_live_ secret, shown only here:

201 Created
{
  "id": "…",
  "name": "CI pipeline",
  "key_prefix": "dt_live_a1b2c3d…",
  "scopes": ["pdf.compress", "convert.document"],
  "credit_limit": 5000,
  "credits_used": 0,
  "is_active": true,
  "created_at": "2026-07-04T12:00:00Z",
  "api_key": "dt_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
curl -X POST https://api.bytefuse.in/api/v1/keys \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI pipeline",
    "scopes": ["pdf.compress", "convert.document"],
    "credit_limit": 5000
  }'

The secret is shown once

The full api_key is returned only on creation. Store it securely immediately — there’s no way to retrieve it later. If it leaks, revoke and recreate.

Scopes & budgets

Scopes and budgets are enforced at call time, on the tool endpoint — not on these management routes:

  • Scope — if a key has scopes and the operation isn’t among them, the tool call returns 403.
  • Per-key budget — if the month’s spend plus this call would exceed credit_limit, the call returns 402. Both checks run before any debit, so a blocked call costs nothing.

GET /api/v1/keys/scopes returns the catalog of scopable operations (built from live pricing, so it only offers billable ops), each with its credit cost — handy for building a scope picker.

Key-count limits

How many active keys you can hold depends on your plan (over the cap, POST /keys returns 403):

Free2
Starter10
Pro / Business / EnterpriseUnlimited

Rotating & revoking

There is no rotate endpoint for API keys — to rotate, revoke and recreate. Revoke with DELETE /api/v1/keys/{key_id} (returns 204); the key stops authenticating immediately.

Revoke
curl -X DELETE https://api.bytefuse.in/api/v1/keys/KEY_ID \
  -H "Authorization: Bearer $JWT"
# → 204 No Content