How to Use OpenRouter AI Model in LobeChat

LobeHub
3 min readApr 24, 2024

--

OpenRouter provides a convenient large language model access platform for developers and users, helping simplify the LLM invocation process and achieve rapid development of code-free applications. This article details the steps to register, create an API key, recharge credit, and configure OpenRouter in LobeChat.

OpenRouter is a service that provides a variety of excellent large language model APIs, supporting models such as OpenAI (including GPT-3.5/4), Anthropic (Claude2, Instant), LLaMA 2, and PaLM Bison.

Why Use OpenRouter?

OpenRouter provides developers and users with a convenient large language model access platform, helping them simplify the LLM invocation process and achieve rapid development of code-free applications.

Key features of OpenRouter include:

  • Providing developers with a unified interface to integrate natural language processing capabilities into applications without the need to delve into complex algorithms and models.
  • Allowing users to control the cost of each generated API key and supporting payment in cryptocurrency.
  • Offering flexible authentication methods, including OAuth PKCE, API keys, or Windows AI extension.

How to Use OpenRouter in LobeChat?

Step 1: Sign up an OpenRouter Account and Log In

  • Visit OpenRouter.ai and create an account.
  • You can sign in using a Google account or MetaMask wallet.

Step 2: Create an API Key

  • Go to the Keys menu or visit OpenRouter Keys.
  • Click on Create Key to start the creation process.
  • Give the API key a name in the pop-up dialog, for example, “LobeChat Key.”
  • Leave the Credit limit blank to indicate no credit limit.
  • Copy the API key from the pop-up dialog and save it securely.

Please store the key securely as it will only appear once. If you accidentally lose it, you will need to create a new key.

Step 3: Recharge Credit

  • Go to the Credit menu or visit OpenRouter Credit.
  • Click on Manage Credits to recharge credit. You can view model prices at https://openrouter.ai/models .
  • OpenRouter provides some free models that can be used without recharging.

Step 4: Configure OpenRouter in LobeChat

  • Visit the Settings interface in LobeChat.
  • Find the setting for OpenRouter under Language Models.
  • Enter the obtained API key.
  • Select an OpenRouter model for your assistant to start the conversation.

During usage, you may need to pay the API service provider. Please refer to OpenRouter’s relevant fee policies.

You can now engage in conversations using the OpenRouter AI models in LobeChat.

Join the waitlist today and experience the future of conversational AI with LobeChat.

Originally published at https://lobehub.com/blog on Sunday, March 17 2024.

--

--