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

# Credential Setup

> Configure access to model providers and external services by adding API credentials to your environment.

<Warning>
  **OpenAI API Key Required:** Weam AI requires OpenAI API access for core functionality including RAG processing, document analysis, and web scraping. The application will not work properly without an OpenAI API key.
</Warning>

## Model Providers

Add credentials for the models you want to use. **At minimum, configure one provider** to enable basic functionality.

**OpenAI is mandatory** for Weam AI to function properly. Add credentials for additional models you want to use.

<Tabs>
  <Tab title="OpenAI (Required)">
    **Get Your API Key:**

    1. Visit [platform.openai.com](https://platform.openai.com)
    2. Sign up or log in to your account
    3. Navigate to the **API Keys** section
    4. Create a new secret key
    5. Copy the key (you won't see it again)

    **Add to Environment:**

    ```env theme={null}
    Weam AI_OPEN_AI_KEY=sk-your-openai-api-key-here
    OPEN_AI_MODAL=gpt-4
    OPEN_AI_API_URL=https://api.openai.com
    ```

    <Card title="Detailed OpenAI Setup Guide" icon="openai" href="/extended-reading/openai-api">
      Step-by-step OpenAI API key generation
    </Card>
  </Tab>

  <Tab title="Anthropic (Claude)">
    **Get Your API Key:**

    1. Visit [console.anthropic.com](https://console.anthropic.com)
    2. Sign up or log in
    3. Go to the **API Keys** section
    4. Create a new key
    5. Copy and save the key securely

    **Add to Environment:**

    ```env theme={null}
    Weam AI_ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
    ANTHROPIC_AI_API_URL=https://api.anthropic.com
    ```

    <Card title="Detailed Anthropic Setup Guide" icon="anthropic" href="/extended-reading/anthropic-api">
      Step-by-step Anthropic API key generation
    </Card>
  </Tab>

  <Tab title="Google AI (Gemini)">
    **Get Your API Key:**

    1. Visit [makersuite.google.com](https://makersuite.google.com)
    2. Sign in with a Google account
    3. Create an API key
    4. Copy the generated key

    **Add to Environment:**

    ```env theme={null}
    Weam AI_GEMINI_KEY=your-google-ai-api-key-here
    GEMINI_API_URL=https://generativelanguage.googleapis.com
    ```

    <Card title="Detailed Google AI Setup Guide" icon="google" href="/extended-reading/gemini-api">
      Step-by-step Google AI API key generation
    </Card>
  </Tab>

  <Tab title="Additional Providers">
    ### HuggingFace

    **Get Token:**

    1. Visit [huggingface.co](https://huggingface.co)
    2. Go to Settings → Access Tokens
    3. Create a new token

    ```env theme={null}
    HUGGING_FACE_AUTH_TOKEN=hf_your-huggingface-token-here
    ```

    ### OpenRouter (Multiple Models)

    **Get API Key:**

    1. Visit [openrouter.ai](https://openrouter.ai)
    2. Sign up and go to Keys section
    3. Create a new API key

    ```env theme={null}
    Weam AI_OPEN_ROUTER_KEY=sk-or-your-openrouter-key-here
    ```

    ### DeepSeek

    ```env theme={null}
    Weam AI_DEEPSEEK_KEY=sk-your-deepseek-key-here
    ```

    <CardGroup cols={2}>
      <Card title="HuggingFace Guide" icon="huggingface" href="/extended-reading/hugging-face-api" />

      <Card title="OpenRouter Guide" icon="openrouter" href="/extended-reading/openrouter-api" />
    </CardGroup>
  </Tab>
</Tabs>

## External Integrations (Optional)

<Tabs>
  <Tab title="Slack">
    **Setup OAuth Integration:**

    1. Visit [api.slack.com/apps](https://api.slack.com/apps)
    2. Create a new app
    3. Configure OAuth settings
    4. Get Client ID and Secret

    ```env theme={null}
    SLACK_CLIENT_ID=your-slack-client-id
    SLACK_CLIENT_SECRET=your-slack-client-secret
    NEXT_PUBLIC_SLACK_CLIENT_ID=your-slack-client-id
    NEXT_PUBLIC_SLACK_CLIENT_SECRET=your-slack-client-secret
    ```

    <Card title="Detailed Slack Setup" icon="slack" href="/connections/slack">
      Complete Slack integration guide
    </Card>
  </Tab>

  <Tab title="GitHub">
    **Setup OAuth Integration:**

    1. Visit [github.com/settings/developers](https://github.com/settings/developers)
    2. Create a new OAuth app
    3. Configure redirect URLs
    4. Get Client ID and Secret

    ```env theme={null}
    GITHUB_CLIENT_ID=your-github-client-id
    GITHUB_CLIENT_SECRET=your-github-client-secret
    GITHUB_REDIRECT_URI=https://your-domain.com/api/auth/github/callback
    ```

    <Card title="Detailed GitHub Setup" icon="github" href="/connections/github">
      Complete GitHub integration guide
    </Card>
  </Tab>

  <Tab title="Google Workspace">
    **Setup OAuth Integration:**

    1. Visit [console.cloud.google.com](https://console.cloud.google.com)
    2. Create project and enable APIs
    3. Configure OAuth consent screen
    4. Create credentials

    ```env theme={null}
    GOOGLE_CLIENT_ID=your-google-client-id.googleusercontent.com
    GOOGLE_CLIENT_SECRET=your-google-client-secret
    ```

    <Card title="Detailed Google Setup" icon="google" href="/connections/google/google-apps">
      Complete Google Workspace integration guide
    </Card>
  </Tab>
</Tabs>

## Service Configuration

### Email Service (Optional)

<Accordion title="Configure SMTP for Notifications">
  For user notifications and account management:

  ```env theme={null}
  EMAIL_PROVIDER=SMTP
  SMTP_SERVER=smtp.gmail.com
  SMTP_PORT=587
  SMTP_USER=your-email@domain.com
  SMTP_PASSWORD=your-app-specific-password
  SUPPORT_EMAIL=support@yourdomain.com
  ```

  **Gmail App Password Setup:**

  1. Enable 2FA on your Google account
  2. Go to [App Passwords](https://support.google.com/accounts/answer/185833)
  3. Generate an app password for Weam AI
  4. Use the generated password in `SMTP_PASSWORD`
</Accordion>

### SEO Tools (Optional)

<Accordion title="DataForSEO Integration">
  For SEO agent functionality:

  ```env theme={null}
  SEO_USER_ID=your-seo-tool-email
  SEO_PASSWORD=your-seo-tool-password
  ```

  **Setup:**

  1. Visit [DataForSEO](https://dataforseo.com/)
  2. Create account
  3. Go to Dashboard → API Credentials
  4. Get your credentials
</Accordion>

## Minimum Configuration

For basic functionality, you only need:

* **One model provider** (OpenAI recommended)
* **Database credentials** (usually auto-configured)
* **Security keys for JWT tokens** (auto-generated)

Additional providers and integrations can be added later without downtime.

## Generate Security Keys

<Accordion title="Generate Required Security Keys">
  If you need to generate security keys for JWT and encryption:

  **Using OpenSSL (Recommended):**

  ```bash theme={null}
  # Generate all required keys
  openssl rand -hex 64  # For JWT_SECRET
  openssl rand -hex 64  # For JWT_REFRESH_SECRET
  openssl rand -hex 16  # For SECURITY_KEY
  openssl rand -hex 32  # For CSRF_TOKEN_SECRET
  ```

  **Using Node.js:**

  ```bash theme={null}
  node -e "console.log('JWT_SECRET =', require('crypto').randomBytes(64).toString('hex'))"
  node -e "console.log('JWT_REFRESH_SECRET =', require('crypto').randomBytes(64).toString('hex'))"
  node -e "console.log('SECURITY_KEY =', require('crypto').randomBytes(16).toString('hex'))"
  node -e "console.log('CSRF_TOKEN_SECRET =', require('crypto').randomBytes(32).toString('hex'))"
  ```

  **Online Generators:**

  * [RandomKeyGen](https://randomkeygen.com)
  * [Random.org](https://www.random.org/strings/)
</Accordion>

## Next Steps

<CardGroup cols={2}>
  <Card title="Launch & Verify" icon="check" href="/setup/after-setup-complete/launch-verify">
    Start services and test your configuration
  </Card>
</CardGroup>
