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

# Create Mcp Api Key

`POST /api/mcp-api-keys`

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.net/deeptrace/apis/fastapi.md) · [All operations](https://skmtc.net/deeptrace/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeptrace/fastapi/versions/2e2a6de8aeda/schema)
