Authentication & keys

Authenticate requests, manage additional keys, and keep credentials out of client-side code.

API guide · Reviewed 11 October 2026

Bearer authentication

For OpenAI-compatible endpoints, send the full key as Authorization: Bearer YOUR_API_KEY. Preserve the space after Bearer. A masked key, fingerprint, or truncated value cannot authenticate.

Check authentication without generating tokens
curl --fail-with-body https://formalengines.com/inference/v1/billing/balance \
  -H "Authorization: Bearer $FE_API_KEY"

Model discovery is public. A successful GET /models request does not prove that your key works; use the authenticated balance endpoint above.

Create and manage keys

The API keys dashboard is the simplest way to create an additional key. Existing keys remain active until revoked. A new key belongs to the same account and shares that account’s credit and pricing.

Create an additional key programmatically
curl --fail-with-body https://formalengines.com/inference/v1/keys \
  -H "Authorization: Bearer $FE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"production-server"}'

A successful creation returns HTTP 201 with the new plaintext in api_key and metadata in key. Save the plaintext immediately. GET /keys lists metadata only. Treat the create response as a secret; do not log it.

MethodPath, relative to the base URLPurpose
GET/keysList key metadata
POST/keysCreate a key
PATCH/keys/{fingerprint}Update per-key limits
DELETE/keys/{fingerprint}Revoke a key; the final active key cannot be revoked here

Rotate without interrupting clients

Create a new key, update your application’s secret, verify an authenticated request, then revoke the old key. Revocation affects future requests that use the old key. Account discounts apply to all keys on the account; a key name does not create a separate billing account.

Need a hand? Contact support with your request ID. Keep your API key private.