Docs
API Authentication and Key Management

API Authentication and Key Management

Guidance how to use our API

Overview

The API uses API keys for authentication. To get started, you can create API keys at either a user or service account level.

Creating API Keys

Service Accounts: Recommended for production systems, these accounts are tied to a "bot" individual and provide a secure way to provision access.

User Accounts: Legacy keys that provide access to all organizations and projects associated with the user. We recommend transitioning to project keys for enhanced security.

API Key Scopes

Each API key can be scoped to one of the following:

  1. Project Keys

Provides access to a single project (recommended). To generate a project key, select the specific project you wish to create keys against.

  1. User Keys

Legacy keys that provide access to all organizations and projects associated with the user.

Important Security Reminders

Keep your API key confidential! Do not share it with others or expose it in client-side code (e.g., browsers, apps).

Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.

Making API Requests

To make API requests, include your API key in the Authorization HTTP header:

Authorization: Bearer YOUR_API_KEY

Example Curl Command

Here's an example of a curl command that includes these headers:

curl https://llmengine.ai/api/query \
  -H "Authorization: Bearer $YOUR_API_KEY" \