Caveman Cloud· HostedGet Started
Authenticate with Caveman Cloud: API Keys and Credentials
How Caveman Cloud authentication works: sign-up, the Cave API key vs the upstream provider key, project scoping, CLI sign-in, CI tokens, and MCP OAuth.
Caveman Cloud uses two separate credentials. The Cave API key authenticates you to Caveman Cloud. The upstream provider key authenticates to the model provider. They have different audiences, different rotation paths, and different error behavior when they are missing or invalid.
The two credentials#
The Cave key carries your tenant and project scope. The upstream key is forwarded by the gateway to the provider on your behalf. When you store the upstream key in a Caveman Cloud provider connection, you can drop the x-cave-upstream-key header from requests.
Gateway authentication#
Send the Cave API key on every request to the gateway. The gateway reads the x-cave-api-key header first and falls back to authorization: Bearer <key>, so both styles work. It resolves your organization and project from the key, then forwards the request upstream with the provider key.
curl "${CAVE_GATEWAY_URL}/openai/v1/chat/completions" \
-H "authorization: Bearer ${CAVE_API_KEY}" \
-H "x-cave-upstream-key: ${OPENAI_API_KEY}" \
-H "x-cave-agent: support-agent" \
-H "x-cave-workflow: resolve-ticket" \
-H "content-type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"hi"}]}'Labels like x-cave-agent and x-cave-workflow identify traffic for reporting. They do not grant access. Tenant scope always comes from the verified API key, never from a request label or payload field.
Create an account#
Hosted Caveman Cloud has open sign-up. Open the console and choose Create an account, or go to /signup. You can sign up with:
- Email and password. Caveman Cloud emails you a confirmation link. Open the link and enter the password you chose at sign-up to confirm the address. Confirming does not sign you in. Sign in next with your email and password. If you forgot the password, choose Reset it. The reset also confirms the address.
- Google or GitHub. The provider must have verified your email address.
Signing up again with an unconfirmed address sends a set-password link instead of a new confirmation. Sign-ups are rate-limited per client address.
The Free notice#
A new hosted account starts on the Free plan. Before Caveman Cloud creates your account's workspace, it shows the How Free works notice:
On Free, you agree that Caveman may use your prompt text and recorded requests to improve its models. Requests are kept until you delete them or your configured retention window expires. Add a card any time to turn sharing off.
- Accept and continue records your answer for this notice version and continues sign-up.
- Decline creates no workspace. You can keep using Caveman locally without an account with
npx @caveman-ai/cli.
The notice is versioned. If you sign in when a newer version applies before your workspace exists, Caveman Cloud shows the notice again and retries the sign-in after you accept.
Your personal workspace#
At your first sign-in, if you are not already a member of an organization, Caveman Cloud creates a personal organization for you:
- You are the owner.
- The organization is named after you, or after the part of your email address before the
@. - It contains one project named Default, ready for keys and traffic.
- On hosted Caveman Cloud, it is on the Free plan, and Caveman Cloud stores the accepted Free notice with it.
Pending invitations do not block the personal workspace. They stay pending, and you can accept them later.
Sign-up on customer installs#
On a customer-managed installation, sign-up is off by default and the sign-up page shows "Sign-up is by invitation on this Cloud." Operators turn it on with the auth.signup.open Helm value, which requires the identity service and global.deploymentProfile set to private. A personal workspace created on a customer install gets the enterprise plan, and no Free notice is shown.
global:
deploymentProfile: private
auth:
signup:
open: trueControl API and console authentication#
The console and the control API authenticate with the same identity system used by the gateway. When you sign in through the browser, the console obtains an access token for control-plane operations. The Cloud SDKs and CLI use the same token.
CLI sign-in#
Install the cvm CLI and sign in once through the browser. The CLI reuses the credential saved by caveman login.
npm i -g @caveman-ai/cloud
cvm logincvm login opens the device page (/activate) with a code from your terminal. If you are signed out and do not have an account yet, choose Create an account on that page. The device code carries through sign-up, the Free notice, and email confirmation, so you return to /activate to approve the device once you sign in. The code stays valid for a few minutes. If it expires, run cvm login again.
In headless environments such as CI, set CAVE_TOKEN and, for a private installation, CAVE_API_URL. Signed-out cvm commands exit with code 3 instead of hanging.
export CAVE_TOKEN="cave_live_..."
export CAVE_API_URL="https://your-installation.caveman.so"
cvm projects listNon-secret config sits at ~/.caveman-cloud/config.json. Auth tokens go to the OS keychain when available, with a file fallback under ~/.caveman/credentials.
MCP and coding agents#
Coding agents connect through the MCP endpoint using browser OAuth. Open Connect your coding agent in the dashboard. The approval binds one project and defaults to metadata reads; content, authoring, and paid execution stay opt-in. No Caveman CLI or gateway key is required for this path.
OAuth uses S256 PKCE and issuer-bound authorization responses. There is no dynamic client registration.
Project scoping#
Keys, traces, workloads, evals, and SQL queries are all scoped to a project. When using the CLI, you can target a project with:
--project UUID- The
CAVE_PROJECT_IDenvironment variable cvm context bind(writes.caveman-cloud.jsonin the repository)- The saved default project
SDK calls require projectId at initialization.
Key rotation and governance#
Project owners and admins manage API keys under Governance, Keys in the console. You can create, revoke, and review key usage. Identity administration and credential lifecycle remain human-only: shared agents cannot create or rotate keys.
A Cloud access token and a gateway inference key have different audiences. Do not use one where the other is expected.
Common auth errors#
For SQL access, per-person columns need billing:read, payload columns need payload:read, and agent connections additionally need trace:read_payload. Project keys with sql:read can query their own project only.