# API Keys



API keys are required to authenticate requests to the Surface API. Each API key is scoped to your environment and provides access to all resources within that environment.

## Creating an API Key [#creating-an-api-key]

<Frame>
  <img className="block" src="/images/response-api/1.png" alt="Get API key from Surface" />
</Frame>

1. Log in to your Surface account.
2. Go to **Settings** > **API Keys**.
3. Click on **+ Add API Key**.
4. Give your key a name and click **Create**.
5. **Copy and note down the API key** immediately, as it won't be shown again.

<Warning>
  API keys are only shown once when created. Make sure to save your API key securely. If you lose it, you'll need to create a new one.
</Warning>

## Using Your API Key [#using-your-api-key]

Include your API key in the `x-api-key` header for all API requests:

<CodeBlockTabs defaultValue="cURL">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="cURL">
      cURL
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="cURL">
    ```bash
    curl -X GET 'https://forms.withsurface.com/api/v1/responses' \
      -H 'x-api-key: your-api-key-here'
    ```
  </CodeBlockTab>
</CodeBlockTabs>
