Manage API Keys
Create, store, rotate, and revoke Luxor Agent Cloud API keys for Sandbox SDKs, CLI automation, and CI.
API keys authenticate the Sandbox SDKs and non-interactive CLI sessions. A key begins with lx_ (keys created before the Luxor rename begin with tk_ and still work), and the
SDKs read it from the LUXORAI_API_KEY environment variable by default (the older TENKI_API_KEY still works). LUXORAI_* variables and lx_ keys need sandbox SDK 1.4.2 or later or CLI 2.10 or later; with older versions, set TENKI_API_KEY. Runners and Code Reviewer use their
GitHub App connections instead of API keys.
Create an API key
- Sign in to the dashboard and select Sandbox.
- Complete Sandbox onboarding. We create the initial API key for you; copy it when it is shown and save it in your shell or secret manager.
- To create another key or control expiration, open API Keys and select Create API Key.
- Enter a Key Name, optionally select an expiration date, and select Create Key.
- Copy the new key when it is shown and store it securely.
Use the key
Export the key before running an SDK program:
export LUXORAI_API_KEY=lx_your_api_keyFor a non-interactive CLI login, pass the same value directly:
luxor login --api-key lx_your_api_key
luxor statusEach API key belongs to exactly one workspace. Sandbox requests infer that workspace from the key, so normal CLI and SDK calls do not need a workspace ID.
Rotate or revoke a key
To rotate a key without interrupting automation:
- Create a replacement key.
- Update every application, CI secret, or secret manager that uses the old key.
- Verify the replacement key with
luxor statusor an SDK request. - Return to API Keys, select the delete button beside the old key, and confirm Revoke API Key.
Revocation takes effect immediately and cannot be undone.
Keep keys secure
- Store keys in a secret manager or your CI provider's encrypted secrets.
- Never commit a key to source control or paste one into an issue, pull request, or support message.
- Use descriptive names so you can identify each key's owner and purpose.
- Set an expiration date appropriate for the workload and revoke keys that are no longer used.
- If a key is exposed, replace it and revoke the exposed key immediately.