rotate_api_key
Generate a new workspace API key and invalidate the current one to maintain security. Update integrations and restart the server with the new key immediately.
Instructions
Generate a new workspace API key and immediately invalidate the current one.
WARNING: This action is irreversible. The moment this succeeds, the key used to call it stops working. All integrations must be updated with the new key immediately, and this MCP server must be restarted with the new BITSCALE_API_KEY environment variable.
Returns: {"api_key": "sk-live-newkey..."} — the new workspace API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:305-318 (handler)Handler implementation for the rotate_api_key MCP tool.
@mcp.tool() def rotate_api_key() -> str: """ Generate a new workspace API key and immediately invalidate the current one. WARNING: This action is irreversible. The moment this succeeds, the key used to call it stops working. All integrations must be updated with the new key immediately, and this MCP server must be restarted with the new BITSCALE_API_KEY environment variable. Returns: {"api_key": "sk-live-newkey..."} — the new workspace API key. """ data = _post("/api-key/rotate") return json.dumps(data, indent=2)