Authentication
Authenticate LatentKit API requests with a Bearer API key stored server-side.
Header
Send your raw API key on every /v1/* request:
Authorization: Bearer <LATENTKIT_API_KEY>
Content-Type: application/jsonBase URL
https://ai.latentkit.comSDKs default to this base URL and normalize paths to /v1.
Where keys come from
- Sign in to console.latentkit.com
- Open API Keys or use the default key from AI Router
- Copy the secret when created and store it in your server environment
Security rules
Never expose raw API keys in frontend code, public repos, or AI tool prompts. Load secrets from environment variables or a secrets manager on the server only.
- Rotate keys from the console if a secret may have leaked
- Use separate keys per environment (development, staging, production)
- Log
X-LK-Request-IDon failures for support correlation
Invalid or missing keys
| Condition | Typical response |
|---|---|
| Missing key | 401 with missing_api_key or {"detail":"Missing API key"} |
| Invalid or revoked key | 401 with invalid_api_key or {"detail":"Invalid or revoked API key"} |
See Error handling for the full error contract.