Skip to main content
Forge supports multiple AI providers. Use the interactive CLI to manage your provider credentials securely.

Quick Start

# Login to a provider
forge provider login

# List supported providers
forge provider list

# Remove provider credentials
forge provider logout
On first run, Forge automatically guides you through provider setup if no credentials are found.

Provider Management

Interactive Login

The recommended way to configure providers:
forge provider login
This command:
  1. Shows available providers
  2. Guides you through credential entry
  3. Securely stores credentials in file-based storage
  4. Validates the credentials

Listing Providers

View all supported providers:
forge provider list

Removing Credentials

Remove stored credentials:
forge provider logout

Supported Providers

Claude models from Anthropic.Setup:
forge provider login
# Select Anthropic and enter your API key
Configure model:
# forge.yaml
model: claude-3.7-sonnet
Available models:
  • claude-3.7-sonnet - Latest Sonnet model
  • claude-sonnet-4 - Claude Sonnet 4
  • claude-3-opus - Most capable model
  • claude-3-haiku - Fastest model
GPT models from OpenAI.Setup:
forge provider login
# Select OpenAI and enter your API key
Configure model:
# forge.yaml
model: o3-mini-high
Available models:
  • o3-mini-high - High reasoning capability
  • gpt-4-turbo - Advanced GPT-4 model
  • gpt-4 - Standard GPT-4
Gemini and Claude models via Google Cloud.Setup:
  1. Install and authenticate with Google Cloud CLI:
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
  1. Get authentication token:
gcloud auth print-access-token
  1. Configure in Forge:
forge provider login
# Select Google Vertex AI and enter credentials
Configure model:
# forge.yaml
model: google/gemini-2.5-pro
Available models:
  • gemini-2.5-pro - Latest Gemini Pro
  • gemini-2.0-flash - Fast Gemini model
  • claude-sonnet-4@20250514 - Claude via Vertex AI
Access multiple AI models through a single API.Setup:
forge provider login
# Select OpenRouter and enter your API key
Grok models from x.ai.Setup:
forge provider login
# Select x.ai and enter your API key
Fast inference models from Cerebras.Setup:
forge provider login
# Select Cerebras and enter your API key
Claude and other models via AWS Bedrock.Requirements:
  • Deploy Bedrock Access Gateway
  • Create API key in AWS Secrets Manager
  • Note the API Base URL from CloudFormation outputs
Setup:
forge provider login
# Select OpenAI-compatible provider
# Enter Bedrock Gateway URL and API key
Configure model:
# forge.yaml
model: anthropic.claude-3-opus
Fast inference using Groq hardware.Setup:
forge provider login
# Select OpenAI-compatible provider
# Enter URL: https://api.groq.com/openai/v1
# Enter your Groq API key
Configure model:
# forge.yaml
model: deepseek-r1-distill-llama-70b
Any provider with OpenAI-compatible API.Setup:
forge provider login
# Select OpenAI-compatible provider
# Enter provider URL and API key
Configure model:
# forge.yaml
model: <provider-specific-model>
Managed AI services from Forge.Setup:
forge provider login
# Select Forge Services and enter your API key
Configure model:
# forge.yaml
model: claude-3.7-sonnet

Environment Variables (Deprecated)

Using environment variables for provider configuration is deprecated and will be removed in a future version. Use forge provider login instead.
For backward compatibility, Forge still supports environment variables. Credentials found in environment variables are automatically migrated to file-based storage on first run.
# .env (deprecated)
OPENAI_API_KEY=<your_openai_api_key>

Model Selection

After configuring a provider, specify the model in your forge.yaml:
# forge.yaml
model: claude-3.7-sonnet
Or use the /model command in the Forge CLI to see all available models for your configured providers.

Advanced Configuration

Custom API Endpoints

Override default API URLs using environment variables:
# .env
FORGE_API_URL=https://api.forgecode.dev
FORGE_WORKSPACE_SERVER_URL=http://localhost:8080

HTTP Client Configuration

Fine-tune API request behavior:
# .env
FORGE_HTTP_CONNECT_TIMEOUT=30
FORGE_HTTP_READ_TIMEOUT=900
FORGE_HTTP_MAX_REDIRECTS=10
See the environment variables reference for all HTTP configuration options.

Troubleshooting

If you see authentication errors:
  1. Run forge provider logout to remove old credentials
  2. Run forge provider login to re-enter credentials
  3. Verify your API key is valid on the provider’s website
If you hit rate limits, configure retry behavior:
# .env
FORGE_RETRY_MAX_ATTEMPTS=5
FORGE_RETRY_INITIAL_BACKOFF_MS=2000
FORGE_RETRY_BACKOFF_FACTOR=2
For slow connections, increase timeout values:
# .env
FORGE_HTTP_CONNECT_TIMEOUT=60
FORGE_HTTP_READ_TIMEOUT=1800
If you encounter SSL certificate issues:
# .env
# Add custom certificate paths
FORGE_HTTP_ROOT_CERT_PATHS=/path/to/cert1.pem,/path/to/cert2.crt
Warning: Only use FORGE_HTTP_ACCEPT_INVALID_CERTS=true in development.

Security Best Practices

Credential Storage

  • Never commit API keys to version control
  • Use forge provider login for secure credential storage
  • Credentials are stored in platform-specific secure locations
  • Environment variables are auto-migrated on first run

Next Steps

forge.yaml Configuration

Configure model behavior and workflow settings

Custom Rules

Define project-specific guidelines

Build docs developers (and LLMs) love