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

# Authentication

> Learn how to authenticate with the Intellibase API

## Overview

All Intellibase API requests require authentication using API keys. API keys are generated from the Intellibase Dashboard and provide programmatic access to your projects and data.

## Getting Your API Key

<Steps>
  <Step title="Log in to the Dashboard">
    Navigate to the [Intellibase Dashboard](https://app.intellibase.dev) and sign in with your account.
  </Step>

  <Step title="Navigate to API Keys">
    Go to the **API Keys** section in the dashboard sidebar.
  </Step>

  <Step title="Create a New Key">
    Click **Create API Key**, give it a descriptive name, and optionally set an expiration date.
  </Step>

  <Step title="Copy Your Key">
    Copy the API key immediately - it starts with `ib-`.
  </Step>
</Steps>

<Warning>
  **Store your API key securely!**

  * Never commit it to version control
  * Don't share it in public forums or code
  * Use environment variables to store it
  * Rotate keys periodically for security
</Warning>

## Using API Keys

### Authorization Header

Include your API key in the `Authorization` header as a Bearer token:

```bash theme={null}
curl https://api.intellibase.dev/api/v1/projects \
  -H "Authorization: Bearer ib-your-api-key-here"
```

## Code Examples

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import os
    import requests

    # Load API key from environment variable
    API_KEY = os.environ.get("INTELLIBASE_API_KEY")

    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }

    response = requests.get(
        "https://api.intellibase.dev/api/v1/projects",
        headers=headers
    )

    if response.status_code == 200:
        projects = response.json()["projects"]
        print(f"Found {len(projects)} projects")
    elif response.status_code == 401:
        print("Invalid API key")
    else:
        print(f"Error: {response.status_code}")
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    const API_KEY = process.env.INTELLIBASE_API_KEY;

    const headers = {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type": "application/json"
    };

    const response = await fetch(
      "https://api.intellibase.dev/api/v1/projects",
      { headers }
    );

    if (response.ok) {
      const { projects } = await response.json();
      console.log(`Found ${projects.length} projects`);
    } else if (response.status === 401) {
      console.error("Invalid API key");
    } else {
      console.error(`Error: ${response.status}`);
    }
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    # Set your API key as an environment variable
    export INTELLIBASE_API_KEY="ib-your-api-key-here"

    # Use it in requests
    curl https://api.intellibase.dev/api/v1/projects \
      -H "Authorization: Bearer $INTELLIBASE_API_KEY"
    ```
  </Tab>
</Tabs>
