Skip to main content

API Keys

Manage API keys for various LLM providers and services.

Provider Setup

OpenAI

  1. Visit platform.openai.com
  2. Create new API key
  3. Set environment variable:
export OPENAI_API_KEY='sk-...'

Anthropic

  1. Visit console.anthropic.com
  2. Generate API key
  3. Set environment variable:
export ANTHROPIC_API_KEY='sk-ant-...'

Google (Gemini)

  1. Visit aistudio.google.com
  2. Create API key
  3. Set environment variable:
export GOOGLE_API_KEY='AIza...'

Usage in Code

from openai import OpenAI

client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

Security Best Practices

Never hardcode API keys in your source code.
Use environment variables or secret management services in production.

Environment Setup

Configure your development environment

Build docs developers (and LLMs) love