Authentication

Learn how to authenticate your API requests using API keys.

Overview

The API uses API keys for authentication. Each API key is scoped to a specific workspace and has configurable permissions.

API keys are prefixed with hk_ to make them easily identifiable.

API Keys

To create an API key:

  1. Log in to your account
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Enter a descriptive name (e.g., "Production", "Development")
  5. Select the required scopes
  6. Copy the generated key immediately

Important: API keys are only shown once when created. Store them securely as they cannot be retrieved later.

Using API Keys

Include your API key in the Authorization header as a Bearer token:

HTTP Header
Authorization: Bearer hk_your_api_key_here

Example request with cURL:

cURL
curl --request GET \
  --url 'https://api.lthn.ai/v1/brain/recall' \
  --header 'Authorization: Bearer hk_your_api_key'

Scopes

API keys can have different scopes to limit their permissions:

Scope Description
read Read access to resources (GET requests)
write Create and update resources (POST, PUT requests)
delete Delete resources (DELETE requests)

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables to store keys
  • Rotate keys periodically
  • Use the minimum required scopes
  • Revoke unused keys immediately
  • Never expose keys in client-side code