Create a sandbox key, keep it on your server, and rotate it without interrupting billing.
Your API key selects one Commet organization and environment. A sandbox key can only access sandbox data; a live key can only access live data.
COMMET_API_KEY=ck_sandbox_xxxxxxxxxCommet does not show the full secret again. If it is lost, create a replacement and delete the old key after the new deployment is healthy.
import { Commet } from "@commet/node"
export const commet = new Commet({
apiKey: process.env.COMMET_API_KEY,
})Never expose the key in browser code, public environment variables, logs, screenshots, or agent prompts. Requests sent directly to the REST API authenticate with the x-api-key header.
Keep sandbox and live credentials in different deployment environments. A safe promotion flow is:
Create the replacement first, deploy it, verify successful requests, and only then delete the previous key. Keys can also be managed through the generated API Keys reference.
Use one key per workload when you need independent rotation or audit boundaries. Do not reuse a developer's local key in production.
How is this guide?