Skip to main content
Most application requests need an Authorization: Bearer credential. Your credential is still subject to workspace membership and permissions.

API keys

  1. Sign in and open Settings → Account → API Keys, under the Developer section.
  2. Create a key and give it a name that identifies the script or service using it.
  3. Copy the full key when it is shown. You cannot retrieve it again later.
  4. Store it in a secret manager or private environment variable.
Send it with each request:
Replace PROJECT_ID with the ID from a project URL. See Make your first API request for the complete sequence.

JavaScript on a server

Revoke or rotate a key

Return to API Keys to remove a credential you no longer use. To rotate one, create a replacement, update the service that uses it, check a request succeeds, then revoke the old key.

Rate limits

Each API key can make 100 requests per 60 seconds by default. Requests made with a browser session or a device access token do not count against it. The window follows the key’s most recent successful request. Every successful request starts the 60 seconds again, and the count resets only after a full window passes without a successful request. A steady stream of requests, even one per second, keeps the window open, so the key is limited after 100 requests until it has been idle for 60 seconds. Successful requests made with an API key include these headers: When a key goes over its limit, Kaneo answers 429 Too Many Requests with the error code RATE_LIMITED, the same headers, X-RateLimit-Remaining: 0, and a Retry-After header with the number of seconds to wait. Wait at least that long before you retry, and pace bulk jobs rather than retrying in a loop. A 429 does not mean the key is invalid. An unknown, disabled, or expired key still gets 401 with UNAUTHORIZED. A key with a usage quota also gets 429 with RATE_LIMITED once the quota runs out, with the message API key usage limit exceeded. Retry-After is included when the quota refills at a known time. Auth endpoints under /api/auth can also have their own per-IP limits, for example on sign-up and invitations. Those 429 responses include Retry-After but no X-RateLimit headers, because the request did not count against the key.

Device authorization

By default, self-hosted Kaneo allows the built-in device clients kaneo-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

  1. Your app requests a device code from /api/auth/device/code
  2. Kaneo returns a device_code, user_code, polling interval, and verification URL
  3. The user opens the verification URL in a browser and signs in
  4. The user approves the request
  5. Your app polls /api/auth/device/token until an access token is issued
  6. Your app sends API requests with Authorization: Bearer <token>

Request a device code

Example response:

Poll for a token

While waiting for approval, Kaneo may return:
  • authorization_pending
  • slow_down
  • invalid_client
  • expired_token
Once approved, Kaneo returns an access token:

Use the returned token

The examples use the built-in kaneo-cli client ID so they work with the default allowlist. A separately named client needs its own allowed ID in DEVICE_AUTH_CLIENT_IDS. Respect the polling interval returned by the server. On slow_down, increase the interval; stop when the code expires or access is denied. Do not log device codes or access tokens.

Keep credentials private

Use a different key for each integration so you can revoke one without interrupting the others. If a key leaks, revoke it immediately and replace it in the affected service. Device access tokens are secrets too.