Back to Documentation
Authentication
Learn how to authenticate with the Bait Al-Aman API using API keys and tokens.
API Keys
API keys are used to authenticate requests to the Bait Al-Aman API. You can create and manage API keys from your dashboard.
Creating an API Key
- Navigate to Settings → API Keys in your dashboard
- Click "Create New Key"
- Give your key a descriptive name
- Select the appropriate permissions
- Copy and securely store your key
Security Warning
Never expose your API keys in client-side code or public repositories.
Using API Keys
Include your API key in the Authorization header of all requests:
curl -X POST https://api.bait-al-aman.com/v1/gateway/chat \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4", "messages": [...]}'SDK Authentication
When using our SDK, pass your API key during initialization:
import { BaitAlAman } from '@bait-al-aman/sdk';
const client = new BaitAlAman({
apiKey: process.env.BAIT_AL_AMAN_API_KEY,
});Key Permissions
Read
View resources, list agents, read logs
Write
Create and modify agents, run workflows
Admin
Manage team members, billing, and settings