Using Different Providers
With Forge installed, you can configure it to work with your AI provider of choice. This guide will walk you through configuring different providers and understanding their capabilities.
Setting Up API Credentials
Forge requires an API key to access AI models. Follow these steps to configure your preferred provider:
- Create a
.env
file in your home directory:
touch ~/.env
- Open the
.env
file in your preferred text editor and add your API key. Here's an example using Open Router (recommended):
# Your API key for accessing AI models
OPENROUTER_API_KEY=<Enter your Open Router Key>
You can get an API key at Open Router.
Supported AI Providers
Forge automatically detects and uses your API keys from environment variables. It checks for keys in the following priority order:
FORGE_KEY
- Forge's provider (OpenAI-compatible)OPENROUTER_API_KEY
- Open Router provider (aggregates multiple models)OPENAI_API_KEY
- Official OpenAI providerANTHROPIC_API_KEY
- Official Anthropic provider
To use a specific provider, set the corresponding environment variable in your .env
file.
# Examples of different provider configurations (use only one)
# For Open Router (recommended, provides access to multiple models)
OPENROUTER_API_KEY=your_openrouter_key_here
# For official OpenAI
OPENAI_API_KEY=your_openai_key_here
# For official Anthropic
ANTHROPIC_API_KEY=your_anthropic_key_here
# For Antinomy's provider
FORGE_KEY=your_forge_key_here
Using Forge with Your Provider
Once you've configured your API credentials, you can start using Forge:
forge
This will launch Forge using your configured provider. You'll see a prompt where you can start entering your tasks.
Basic Commands
Here are a few basic commands to get you started:
- Type your task in natural language and press Enter to execute
- Press Ctrl+C to cancel the current operation
- Press Ctrl+D to exit Forge
- Type
/help
to see a list of available commands
Next Steps
Now that you have Forge configured with your preferred provider, check out these resources to learn more:
- Built-in Commands: Learn about Forge's special commands
- Custom Commands: Discover how to create your own commands
- Operating Agents: Understand the different modes Forge can operate in
- Environment Configuration: Explore advanced configuration options