Authentication & API Keys

All API requests and SDK methods require a valid Bearer token for authentication.

Obtaining Keys

You can generate unlimited API keys from your Libro Dashboard under Settings > API Keys. We provide two environments:

  • Test Keys (cos_test_...): Memory ingested here is wiped automatically after 24 hours.
  • Live Keys (cos_live_...): Persistent production storage.

Using the SDK

The SDK automatically handles the Authorization header. Just pass your key during instantiation:

const ctx = new Libro({ apiKey: 'cos_live_YOUR_KEY_HERE' });

API Requests

If using direct HTTP requests, include the token:

curl -X POST https://libro.dev/api/v1/ingest \
  -H "Authorization: Bearer cos_live_YOUR_KEY_HERE" \
  -d '{"userId":"test", "content":"Hello"}'