HARPA.AI
LIBRARYUSE CASESGUIDESAI COMMANDSBLOG

Connecting to OpenRouter

CONTENTS
NAVIGATE

OpenRouter.AI is a standardized API platform designed to facilitate the use of multiple language models from different providers.

It offers a simplified and consistent interface for interacting with a variety of AI models, enabling users to switch between models or providers without the need to change their code. This platform is particularly useful in a landscape where there are hundreds of language models and numerous providers.

# Key OpenRouter features

  • Standardized API. This allows for seamless integration and switching between different AI models and providers without altering the existing codebase.

  • Transparent Metrics. OpenRouter provides metrics to compare models based on usage, throughput, latency, and cost, aiding in selecting the most efficient and cost-effective options.

  • Flexible Authentication. It supports various authentication methods including traditional API keys, OAuth PKCE for user-paid models, and connection via the Window AI extension.

  • Model Support. OpenRouter supports a wide range of models from different organizations, with the ability to fetch model details, pricing, and limits via API. It includes both filtered and unfiltered models, varying in token size and cost.

# Which connection models are available in HARPA AI via OpenRouter?

OpenRouter supports a wide array of text models from various providers. This includes models like OpenAI's GPT-4o and GPT-4o-mini, Anthropic's Claude 3 and 3.5, Nous' Capybara models, Mistral AI models, Google's PaLM, and many others. Each model comes with its own context token limits, pricing, and moderation status.

You can connect any model to HARPA AI, enabling you to work in HARPA AI through Mistral AI, LLAMA, or Perplexity.

# How to connect HARPA AI to OpenRouter?

  1. Open the https://openrouter.ai/ website and click "Sign in" located at the top right corner of the page.

  1. Log in using your Google or MetaMask Account, or create a new account on OpenRouter.

  1. Generate your API key for connection by visiting https://openrouter.ai/keys.

  1. Copy and securely save your key, as it will be displayed only once.

  1. Follow these steps to copy the key directly into HARPA AI:

    • Open HARPA by clicking its icon in the top right corner of the Chrome Browser or by pressing Alt+A (on Windows) and ^+A (on Mac).

    • Click on the connections menu in the bottom left corner and select API key.

    • Paste your OpenRouter API key.

  2. Check the available models for connection at https://openrouter.ai/docs#models.

  3. After selecting the required OpenRouter connection model, copy and paste its name into the chat model in HARPA AI.

  1. Specify the API proxy URL, which you can find in HARPA's hints or on the OpenRouter website, presently https://openrouter.ai/api

  1. Specify the size of the context window according to the chosen connection model and set the maximum response size in tokens.

Test your connection by sending a message in chat.

NEXT POST
Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service