What are API Keys?
API keys authenticate Claude Code with Detrics. When you register the Detrics MCP server with your agent, the API key is passed as an environment variable so the server can verify your identity and access your workspace data. Each API key is scoped to a workspace — it can only access data from the workspace where it was created.API keys are only needed for Claude Code. If you are using Claude Web, authentication is handled through OAuth — no API key required.
Keeping Your API Keys Safe
Managing API Keys
You can manage your API keys from the Detrics web app at app.detrics.io/mcp, in the Agent API Keys section at the bottom of the page.Generate a new key
- Go to app.detrics.io/mcp, or navigate to AI Agents in the sidebar
- Click + New Key
- Give the key a descriptive name (e.g., “Work laptop”, “CI server”)
- Copy the key immediately — it will only be shown once
Rename a key
- Go to app.detrics.io/mcp, or navigate to AI Agents in the sidebar
- Click the menu icon next to the key
- Select Rename and enter a new name
Revoke a key
- Go to app.detrics.io/mcp, or navigate to AI Agents in the sidebar
- Click the menu icon next to the key
- Select Revoke
- Confirm the revocation
Key Scoping
API keys are scoped to the workspace where they were created. This means:- A key created in “Agency Workspace A” can only access data from that workspace
- It cannot access data from “Agency Workspace B”, even if you are a member of both
- If you work across multiple workspaces, you will need a separate key for each one
If Your Key Is Compromised
If you believe your API key has been exposed:- Revoke the key immediately from app.detrics.io/mcp
- Generate a new key with a different name
- Update Claude Code with the new key by removing and re-adding the MCP server (see Claude Code)
- Review your workspace activity for any unexpected usage