| Method | Status | When to use |
|---|---|---|
| Bearer token | Recommended | All new integrations. Works for service account and personal API keys. |
| HTTP basic auth | Legacy | Fallback for tools that cannot send an Authorization: Bearer header. |
Bearer token
Bearer tokens work with both service account and personal API keys.In the CLI
Pass the token to anykosli command using one of:
- The
--api-tokenflag. - The
KOSLI_API_TOKENenvironment variable. - A config file passed via
--config-file— see Assigning flags via config files.
In API requests
Send the token in theAuthorization header:
HTTP basic auth
HTTP basic auth is a legacy method kept for backwards compatibility with tools that cannot send an
Authorization: Bearer header. For all new integrations, use bearer tokens instead.Authorization header directly with the base64-encoded <<your-api-key>>: string: