Skip to main content

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:

  1. Create a .env file in your home directory:
touch ~/.env
  1. 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:

  1. FORGE_KEY - Forge's provider (OpenAI-compatible)
  2. OPENROUTER_API_KEY - Open Router provider (aggregates multiple models)
  3. OPENAI_API_KEY - Official OpenAI provider
  4. ANTHROPIC_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: