> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sphinx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API key setup for Claude Code CLI

> Create a Sphinx API key and configure the Sphinx MCP server in Claude Code CLI.

## Video tutorial

<Frame>
  <iframe width="100%" height="400" src="https://www.youtube.com/embed/xaKWz6G2q7U" title="User Setup for Claude Code CLI" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
</Frame>

## Set up your API key

<Steps>
  <Step title="Disable the plugin">
    Disable the Sphinx plugin before configuring the MCP server.
  </Step>

  <Step title="Open Sphinx settings">
    Navigate to [app.sphinx.ai](https://app.sphinx.ai). In the top-left corner, click the settings gear.
  </Step>

  <Step title="Open API Keys">
    From the dropdown menu, select **API Keys**.
  </Step>

  <Step title="Create an API key">
    Click **New Key**, give the key a name, set its expiration, and click **Create**.
  </Step>

  <Step title="Copy the API key">
    Copy the generated API key.
  </Step>

  <Step title="Configure the Sphinx MCP server">
    Navigate to the unzipped `sphinx.zip` folder and open `.mcp.json`.

    Add a `headers` section to the Sphinx MCP server configuration. Replace `<api key>` with the API key you copied:

    ```json .mcp.json theme={null}
    {
      "mcpServers": {
        "sphinx": {
          "type": "http",
          "url": "https://api.prod.sphinx.ai/mcp",
          "headers": {
            "Authorization": "Bearer <api key>"
          }
        }
      }
    }
    ```
  </Step>
</Steps>
