This guide explains how to obtain the API keys needed for Agentic Forge.
You need at least one LLM provider API key. We recommend OpenRouter as it gives you access to models from multiple providers with a single key.
OpenRouter provides unified access to Claude, GPT-4, Gemini, Llama, Mistral, and many more models.
- Go to openrouter.ai
- Sign up or log in
- Navigate to Keys
- Click "Create Key"
- Copy the key (starts with
sk-or-)
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxPricing: Pay per token, varies by model. Most models have free tiers for testing.
Default model: anthropic/claude-sonnet-4
Direct access to GPT-4, GPT-4o, and other OpenAI models.
- Go to platform.openai.com
- Sign up or log in
- Navigate to API Keys
- Click "Create new secret key"
- Copy the key (starts with
sk-)
OPENAI_API_KEY=sk-xxxxxxxxxxxxPricing: Pay per token. See OpenAI Pricing.
Direct access to Claude models.
- Go to console.anthropic.com
- Sign up or log in
- Navigate to API Keys
- Click "Create Key"
- Copy the key (starts with
sk-ant-)
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxPricing: Pay per token. See Anthropic Pricing.
Access to Gemini models.
- Go to Google AI Studio
- Sign in with your Google account
- Click "Get API key" or navigate to API Keys
- Create a new key
- Copy the key
GEMINI_API_KEY=xxxxxxxxxxxxPricing: Free tier available. See Gemini Pricing.
The web search MCP server uses Brave Search API. Without this key, web search functionality will be disabled, but everything else works.
- Go to brave.com/search/api
- Click "Get Started for Free"
- Sign up or log in
- Create a new app
- Copy the API key
BRAVE_API_KEY=xxxxxxxxxxxxPricing:
- Free tier: 2,000 queries/month, 1 query/second
- Paid plans: Starting at $5/month for more queries
Edit the .env file in the forge-devtools directory:
cd forge-devtools
cp .env.example .env
# Edit .env with your preferred editor
nano .env # or vim, code, etc.Add your keys:
# Choose ONE LLM provider
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxx
# Optional but recommended
BRAVE_API_KEY=xxxxxxxxxxxxEach service has its own .env file. The key environment variables are:
forge-orchestrator/.env:
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxx
# Or use OPENAI_API_KEY, ANTHROPIC_API_KEY, or GEMINI_API_KEYmcp-web-search:
# Pass as environment variable when running
BRAVE_API_KEY=xxxxxxxxxxxx uv run python -m forge_mcp_web_search.serverWhen using OpenRouter, you can change the default model:
# In .env
ORCHESTRATOR_DEFAULT_MODEL=anthropic/claude-sonnet-4 # Default
# ORCHESTRATOR_DEFAULT_MODEL=openai/gpt-4o
# ORCHESTRATOR_DEFAULT_MODEL=google/gemini-2.0-flash-exp
# ORCHESTRATOR_DEFAULT_MODEL=meta-llama/llama-3.3-70b-instructSee OpenRouter Models for all available models.
- Never commit API keys to version control
- The
.envfile is gitignored by default - Rotate keys if you suspect they've been exposed
- Use environment variables in CI/CD instead of files