Help Center/Integrations/Switching between OpenAI and Anthropic
Back to Help Center
Integrations

Switching between OpenAI and Anthropic

Learn how to switch between AI providers

Overview

You can switch between AI providers (OpenAI, Anthropic, OpenRouter) at any time by updating environment variables. No code changes required.

Switching from OpenAI to Anthropic

  1. Get an Anthropic API key (see guide)
  2. Go to instance Configuration tab
  3. Add environment variable:
    ANTHROPIC_API_KEY=sk-ant-your-key
  4. Update or add:
    AI_MODEL=claude-4.5-sonnet
  5. Save changes and restart instance

Switching from Anthropic to OpenAI

  1. Get an OpenAI API key (see guide)
  2. Go to instance Configuration tab
  3. Add environment variable:
    OPENAI_API_KEY=sk-your-key
  4. Update AI_MODEL:
    AI_MODEL=gpt-4
  5. Save and restart instance

Available Models

OpenAI Models

  • gpt-4.1 - Latest, most capable
  • gpt-4-turbo - Fast and powerful
  • gpt-3.5-turbo - Cost-effective

Anthropic Models

  • claude-4.6-opus - Most intelligent
  • claude-4.5-sonnet - Balanced
  • claude-4.5-haiku - Fast and cheap

Using Multiple Providers

You can keep both API keys configured:

OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... AI_MODEL=claude-4.5-sonnet

Switch by changing only AI_MODEL and restarting.

Cost Comparison

Approximate costs (as of 2026):

  • GPT-3.5 Turbo: $0.0005/1K tokens (cheapest)
  • Claude Haiku: $0.00025/1K input, $0.00125/1K output
  • GPT-4 Turbo: ~$0.01/1K tokens
  • Claude Sonnet: $0.003/1K input, $0.015/1K output
  • GPT-4.1: $0.01-0.03/1K tokens
  • Claude Opus: $0.015/1K input, $0.075/1K output (most expensive)

Testing After Switching

  1. Restart instance after config changes
  2. Check logs for successful AI provider connection
  3. Send test message to verify responses
  4. Monitor costs in provider dashboard

Troubleshooting

Wrong Provider Being Used

  • Verify AI_MODEL matches your intended provider
  • Ensure you restarted after changing config
  • Check logs for which provider initialized

Both Keys Present But Wrong One Used

The AI_MODEL determines which provider is used. Ensure it matches the provider you want.

Next Steps

Still need help?

Our support team is ready to assist you with any questions.

Contact Support