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

# Using Windsurf with Unkey

> Set up Windsurf with Unkey documentation context to generate accurate API key verification, rate limiting, and authentication code in your apps.

Windsurf is an AI-powered development environment that combines the power of AI assistance with a full-featured IDE. When integrated with Unkey's APIs, you can rapidly build secure, scalable applications with intelligent code generation and real-time collaboration features.

## Getting Started

### 1. Set Up Your Unkey Environment

Before working with Windsurf, ensure you have your Unkey credentials ready:

<Steps>
  <Step title="Create your keyspace" stepNumber={1}>
    Navigate to the [Unkey Dashboard](https://app.unkey.com/apis) and create a new keyspace for your project.
  </Step>

  <Step title="Generate Root Key" stepNumber={2}>
    Go to [Settings > Root Keys](https://app.unkey.com/settings/root-keys) and create a new root key with appropriate permissions.
  </Step>

  <Step title="Copy API Details" stepNumber={3}>
    Note down your API ID and root key - you'll need these for your application.
  </Step>
</Steps>

### 2. Set Up Unkey MCP Server (Optional)

Windsurf supports the Model Context Protocol (MCP) which allows you to connect directly to Unkey's APIs. This gives Windsurf access to your Unkey workspace for more intelligent suggestions.

#### Install Unkey MCP Server

To get started with Windsurf, open "Windsurf Settings > Cascade > Model Context Protocol (MCP) Servers", click on "Add Server", click "Add custom server", and add the following configuration for Unkey.

1. **Configure the MCP Server**

   ```json theme={"theme":"kanagawa-wave"}
   {
     "mcpServers": {
       "Unkey": {
         "command": "npx",
         "args": [
           "mcp-remote",
           "https://mcp.unkey.com/mcp/v2",
           "--header",
           "MCP-UNKEY-BEARER-AUTH:${UNKEY_ROOT_KEY}"
         ]
       }
     }
   }
   ```

   For ratelimiting specific operations, you can also add:

   ```json theme={"theme":"kanagawa-wave"}
   {
     "mcpServers": {
       "UnkeyRateLimiting": {
         "command": "npx",
         "args": [
           "mcp-remote",
           "https://mcp.unkey.com/mcp/ratelimits/",
           "--header",
           "MCP-UNKEY-V2-ROOT-KEY:${UNKEY_ROOT_KEY}"
         ]
       }
     }
   }
   ```

2. **Set Environment Variable**

   ```bash theme={"theme":"kanagawa-wave"}
   export UNKEY_ROOT_KEY="your_root_key_here"
   ```

3. **Restart Windsurf**

   Restart Windsurf to load the MCP server configuration.
