- API keys for scripts, services, and long-lived integrations
- Device authorization for CLIs and external apps that need browser-based sign-in
Choose an Authentication Method
API keys
Use API keys when you control secret storage and want a stable credential for a single Kaneo instance.Device authorization
Use the device flow when you are building a CLI, desktop app, or other client that should send the user to the browser to approve access. The device flow follows RFC 8628 and returns a Bearer token that can be used against that Kaneo instance’s API.Creating an API Key
Navigate to SettingsGo to your account settings by clicking on your profile or navigating to the Settings page.
Access API Keys SectionScroll down to the API Keys section in the Account tab. This section is located under the Developer Settings.
Create a New API KeyClick the Create API Key button to generate a new API key. You’ll be prompted to provide a name for your API key to help you identify it later.
Using Your API Key
Once you have your API key, include it in theAuthorization header of all API requests using the Bearer token format:
Example Request
Here’s an example of making an authenticated API request using curl:Example with JavaScript
Using Device Authorization
By default, self-hosted Kaneo allows the built-in device clientskaneo-cli and kaneo-mcp.
If you want to use a different device client ID, the instance operator must allow it through DEVICE_AUTH_CLIENT_IDS.
Flow overview
- Your app requests a device code from
/api/auth/device/code - Kaneo returns a
device_code,user_code, polling interval, and verification URL - The user opens the verification URL in a browser and signs in
- The user approves the request
- Your app polls
/api/auth/device/tokenuntil an access token is issued - Your app sends API requests with
Authorization: Bearer <token>
Request a device code
Poll for a token
authorization_pendingslow_downinvalid_clientexpired_token
Use the returned token
Security Best Practices
- Keep your API keys secret: Never commit API keys to version control or share them publicly
- Use descriptive names: Name your API keys clearly so you can identify their purpose (e.g., “Production Script”, “Development Testing”)
- Rotate keys regularly: Periodically create new API keys and revoke old ones
- Limit key scope: Only grant API keys to trusted applications and services
- Monitor usage: Regularly review your API keys and remove any that are no longer needed
- Allow only trusted device clients: Keep
DEVICE_AUTH_CLIENT_IDSlimited to approved client IDs on self-hosted deployments - Treat Bearer device tokens like secrets: Do not print or log them unnecessarily in production clients