---
title: "Create Mcp Api Key"
method: POST
path: "/api/mcp-api-keys"
---

# Create Mcp Api Key

`POST /api/mcp-api-keys`

## Request

- Base URL: `https://api.deeptrace.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.deeptrace.com/api/mcp-api-keys`
- Auth: none declared

Create a new MCP API key for the authenticated user.

The API key is returned only once upon creation and cannot be retrieved later.
Store it securely.

Use this key in Claude Code or Cursor with:
{
    "mcpServers": {
        "deeptrace": {
            "url": "https://api.deeptrace.ai/mcp/sse",
            "headers": {
                "Authorization": "Bearer <your_api_key>"
            }
        }
    }
}

## Request body

- CreateMCPApiKeyRequest: Request body for creating an MCP API key.
  - `name` string, required: A descriptive name for this API key (e.g., 'My Cursor', 'Claude Desktop')
  - `expires_in_days` integer, nullable: Number of days until the key expires. Null for no expiration.

## Response `200`

Successful Response

- MCPApiKeyResponse: Response containing the newly created API key (shown only once).
  - `id` string, required
  - `name` string, required
  - `api_key` string, required
  - `key_prefix` string, required
  - `expires_at` string, nullable, required
  - `created_at` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/deeptrace/apis/deeptrace-api.md) - [All operations](https://skmtc.dev/deeptrace/apis/deeptrace-api/llms.txt) - [OpenAPI document](https://skmtc.dev/deeptrace/apis/deeptrace-api/revisions/855e59bb07f0?raw)
