Skip to main content
All API requests require a Bearer token in the Authorization header.

Creating an API key

  1. Go to the API settings page
  2. Click Create New Key
  3. Copy the key immediately. It won’t be shown again
You can create up to 10 API keys per workspace.

What a key can do

An API key acts for its whole workspace. It can call every operation in this API reference, and do everything each one offers: a key has no role and is never refused for a permission. Where an operation is limited to admins in the app, a key counts as an admin. People signed in to the Clustr app call the same operations with the rights of their role. The operations this reference leaves out (signing in, managing API keys, Clustr staff tools, the app’s own screens) do not take an API key, and answer 403. An organization’s own operations (its workspaces, usage, audit log and webhook) take an organization key instead.

Check a key

GET /v2/api_keys/current answers 200 with your workspace id when the key works. Tools that offer a “test connection” button can call it.

Example

Error responses

Every error answers the same envelope, with a request_id to quote to support. See Errors for the envelope and every code.

Signing in from the Clustr web app

The Clustr web app does not use API keys and holds no token. It sends the person to GET /v2/auth/login?return_to=/accounts, which goes to the Clustr sign-in page. The sign-in page comes back to GET /v2/auth/callback, which leaves a session in a secure, httpOnly cookie on api.clustr-ai.com. The app then calls the API with the browser’s credentials (credentials: 'include'), and POST /v2/auth/logout signs out. These routes are for the Clustr app only: a change made with the session cookie must come from the app’s own address, and any other is refused with 403. Integrations keep using API keys as above.