Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/manusapis/Agix/llms.txt

Use this file to discover all available pages before exploring further.

OpenRouter is a model-routing layer that exposes a unified OpenAI-compatible API in front of more than 100 different language models from providers including OpenAI, Anthropic, Google, Meta, Mistral, and others. Because the request and response format matches the OpenAI /chat/completions standard exactly, Agix uses the same OpenAIProvider class under the hood — only the baseUrl and model identifier change. This makes OpenRouter an ideal choice when you want to experiment with different models without managing multiple API keys or accounts.

Default configuration

The default configuration registered in providers.config.ts is:
{
  id: "openrouter",
  name: "OpenRouter",
  apiKey: "",                                  // Supplied at runtime in the sidebar
  baseUrl: "https://openrouter.ai/api/v1",
  defaultModel: "openai/gpt-4o-mini",
  enabled: true,
}

Setting up OpenRouter in the sidebar

1

Open the Agix sidebar

In Excel, click Home → Agix. In Google Sheets, open the Agix add-on from the Extensions menu.
2

Select the OpenRouter provider

In the Provider dropdown, choose OpenRouter.
3

Enter your API key

Paste your OpenRouter API key into the API Key field. You can generate one at openrouter.ai/keys.
4

Choose a model (optional)

The default model is openai/gpt-4o-mini. Enter any model in provider/model format — see below for examples.
5

Save

Click Save. Agix persists the configuration via settingsStore.save() into the Office document settings.

AIProviderConfig shape for OpenRouter

{
  id: "openrouter",
  name: "OpenRouter",
  apiKey: "sk-or-...",
  baseUrl: "https://openrouter.ai/api/v1",
  defaultModel: "openai/gpt-4o-mini",
  enabled: true
}

Model naming convention

OpenRouter identifies models using a provider/model format. The routing layer maps this identifier to the correct upstream API automatically. Some commonly used examples:
Model identifierUpstream model
openai/gpt-4oOpenAI GPT-4o
openai/gpt-4o-miniOpenAI GPT-4o-mini
anthropic/claude-3-5-sonnetAnthropic Claude 3.5 Sonnet
meta-llama/llama-3.1-70b-instructMeta Llama 3.1 70B
mistralai/mistral-7b-instructMistral 7B Instruct
google/gemini-flash-1.5Google Gemini 1.5 Flash
The full list of available models is maintained on the OpenRouter models page.

Shared implementation with OpenAI

OpenRouter and OpenAI both resolve to OpenAIProvider in the factory:
case "openai":
case "openrouter":
case "custom":
  return new OpenAIProvider(config);
Requests go to ${config.baseUrl}/chat/completions with a standard Bearer token, using the same temperature (0.7 default) and max_tokens behaviour described for the OpenAI provider.
Get your OpenRouter API key at openrouter.ai/keys. OpenRouter bills per token at rates that vary by model. You can set per-model spending limits from your OpenRouter dashboard.
OpenRouter is particularly useful when you want to compare responses across different model families without creating separate accounts, or when you need access to open-weight models like Llama or Mistral that are not available directly through OpenAI or Anthropic. It also lets you fall back to an alternative model automatically if your first choice is unavailable.

Build docs developers (and LLMs) love