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

# Authentication

> A guide to authenticating with the Glider API.

<Note>
  Glider is currently in early access. Sign up for the waitlist on the [Glider
  App](https://glider.fi/).
</Note>

<Steps titleSize="h3">
  <Step title="Prerequisites">
    Before you begin, you'll need:

    1. A Glider platform account
    2. An API key for authentication
    3. A wallet for signing portfolio creation and transaction permissions
  </Step>

  <Step title="Authenticate">
    First, you need to get an API key that will authenticate your requests to the Glider API.

    1. Log in to the [Glider platform](https://glider.fi)
    2. Navigate to your profile settings
    3. Select "API Keys" and create a new key
    4. Store your API key securely - you'll need to include it in the header of all API requests

    <CodeGroup>
      ```bash curl theme={null}
      # Example of including your API key in requests
      curl -H "X-API-KEY: your_api_key_here" https://api.glider.fi/v1/...
      ```

      ```javascript javascript theme={null}
      // Example of including your API key in requests
      const response = await fetch("https://api.glider.fi/v1/...", {
        headers: { "X-API-KEY": "your_api_key_here" },
        ...
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="API Response Format">
    <Note>
      **V1 and V2 use different envelopes.** V1 (legacy consumer endpoints)
      includes `correlationId`, `requestId`, and `timestamp` in the JSON body.
      V2 (the integrator API at `/v2`) places these in response headers only —
      `X-Correlation-Id` and `X-Request-Id`. See the
      [V2 overview](/api-reference/v2-overview) for the full v2 envelope.
    </Note>

    **V1 envelope** — success:

    ```json theme={null}
    {
      "success": true, // or false for errors
      "data": {
        // Response data varies by endpoint
      },
      "correlationId": "corr_abcd1234", // For request tracking
      "requestId": "req_efgh5678", // For request tracking
      "timestamp": "2023-05-21T12:34:56.789Z" // ISO timestamp
    }
    ```

    **V1 envelope** — error:

    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": "ERROR_CODE", // Specific error code
        "message": "Human-readable error message",
        "details": { // Optional additional details
          // Error-specific information
        }
      },
      "correlationId": "corr_abcd1234",
      "requestId": "req_efgh5678",
      "timestamp": "2023-05-21T12:34:56.789Z"
    }
    ```

    **V2 envelope** — success:

    ```json theme={null}
    {
      "success": true,
      "data": { /* endpoint-specific */ },
      "nextCursor": "eyJjIjoi..." // paginated endpoints only
    }
    ```

    **V2 envelope** — error:

    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": "API_400",
        "message": "Request validation failed",
        "details": ["field: reason"]
      }
    }
    ```

    V2 tracing identifiers are in the `X-Correlation-Id` and `X-Request-Id`
    response headers — never in the body.
  </Step>
</Steps>
