Overview

OpenRouter is a powerful AI model aggregation platform that supports a variety of top-tier models, including GPT-4, Claude 2, and LLaMA 2. With this guide, you can easily integrate these models into LobeVidol. OpenRouter, as a model aggregation service platform, offers users the following advantages:

  • Support for multiple top-tier AI models, including:
    • OpenAI series (GPT-3.5/4)
    • Anthropic series (Claude2, Claude Instant)
    • Meta’s LLaMA 2
    • Google’s PaLM series
  • Unified API interface
  • Flexible billing options
  • Some models offer free quotas

Configuration Steps

1. Register for an OpenRouter Account and Log In

  • Visit OpenRouter.ai and create an account.
  • Supports two login methods:
    • Google account login
    • MetaMask wallet login

2. Create an API Key

  1. Go to the Keys menu or directly visit OpenRouter Keys.
  2. Click the Create Key button.
  3. In the pop-up window, set:
    • Name the API key (e.g., “LobeVidol Key”).
    • Optionally fill in the Credit limit (leave blank for no limit).

Please copy and securely save the API key immediately after creation, as it will only be displayed once. If lost, you will need to create a new key.

3. Recharge Credit

  1. Go to the Credit menu or visit OpenRouter Credit.
  2. Click Manage Credits to recharge.
  3. Check the specific rates for each model on the Model Pricing Page.

OpenRouter offers some free models that can be used without recharge. It is recommended to try the free models first and consider paid models after familiarizing yourself.

4. Configure OpenRouter in LobeVidol

Currently, this project only supports OpenAI models; other models will be supported in future versions.

  1. Open settings:
    • Access the Settings interface in LobeVidol.
    • Find the Language Model section.
    • Select the OpenAI setting.
  1. Configure the service:
    • Enter your obtained API Key in the corresponding input box.
    • Select the OpenAI model you wish to use.
    • Set the custom API proxy address to https://openrouter.ai/api/v1.

Using OpenAI services incurs costs. Different models have different prices; please refer to the OpenAI Pricing Page for details.

Usage Recommendations

Model Selection

  • It is recommended to start with free models.
  • Choose the appropriate model based on specific needs.
  • Be aware of the billing standards for different models.

Cost Control

  • Set a reasonable credit limit.
  • Regularly check usage limits.
  • Monitor billing changes.

Performance Optimization

  • Choose models with lower latency.
  • Adjust context length appropriately.
  • Optimize prompts to improve efficiency.

If you encounter issues during use, you can refer to the OpenRouter Documentation or contact customer support for assistance.