> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Shubhamsaboo/awesome-llm-apps/llms.txt
> Use this file to discover all available pages before exploring further.

# API Keys

> Managing API keys for different LLM providers

# API Keys

Manage API keys for various LLM providers and services.

## Provider Setup

### OpenAI

1. Visit [platform.openai.com](https://platform.openai.com/api-keys)
2. Create new API key
3. Set environment variable:

```bash theme={null}
export OPENAI_API_KEY='sk-...'
```

### Anthropic

1. Visit [console.anthropic.com](https://console.anthropic.com/)
2. Generate API key
3. Set environment variable:

```bash theme={null}
export ANTHROPIC_API_KEY='sk-ant-...'
```

### Google (Gemini)

1. Visit [aistudio.google.com](https://aistudio.google.com/app/apikey)
2. Create API key
3. Set environment variable:

```bash theme={null}
export GOOGLE_API_KEY='AIza...'
```

## Usage in Code

<Tabs>
  <Tab title="OpenAI">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
    ```
  </Tab>

  <Tab title="Anthropic">
    ```python theme={null}
    from anthropic import Anthropic

    client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
    ```
  </Tab>

  <Tab title="Google">
    ```python theme={null}
    import google.generativeai as genai

    genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
    ```
  </Tab>
</Tabs>

## Security Best Practices

<Warning>
  **Never hardcode API keys in your source code.**
</Warning>

<Tip>
  Use environment variables or secret management services in production.
</Tip>

## Related Resources

<Card title="Environment Setup" icon="gear" href="/api/environment-setup">
  Configure your development environment
</Card>
