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.

Agix is built around a pluggable provider model, which means you choose which AI service powers the sidebar at any time. Whether you prefer OpenAI’s GPT-4o, Anthropic’s Claude, the multi-model routing of OpenRouter, or your own self-hosted endpoint, Agix speaks to all of them through a single, uniform interface. No code changes are required to switch — everything is driven from the Provider dropdown in the sidebar.

The ProviderId type

Every provider in Agix is identified by one of four string literals:
type ProviderId = "openai" | "openrouter" | "claude" | "custom";
This type is used throughout the codebase to route requests, look up default configuration, and persist your selection.

The AIProviderConfig interface

Each provider is described by an AIProviderConfig object. This is the single record Agix stores and loads whenever you save your settings:
interface AIProviderConfig {
  id: ProviderId;       // Which provider backend to use
  name: string;         // Human-readable label shown in the sidebar
  apiKey: string;       // Runtime secret — never stored in source code
  baseUrl?: string;     // Base URL for the provider's API
  defaultModel: string; // Model to use when none is specified per-request
  enabled: boolean;     // Whether this provider appears in the dropdown
}

Switching providers at runtime

The ProviderSelector dropdown in the Agix sidebar lists every enabled provider. Selecting a different entry immediately updates the active ProviderId. When you also supply or change an API key and click Save, Agix calls settingsStore.save(), which writes the full AIProviderConfig into the Office document settings. Those settings roam with the document on a per-user basis, so your choice follows you across devices when you open the same file. Outside of the Office host (for example, when running in a browser during development), the configuration is persisted to localStorage under the key agix.provider.config.
API keys are entered in the sidebar at runtime and are never hardcoded in the application source. The default provider registry ships with empty apiKey fields. Always treat your API keys as secrets and avoid embedding them in shared documents.

Available providers

OpenAI

Connect to GPT-4o, GPT-4o-mini, and other OpenAI models via the /chat/completions endpoint.

Claude

Use Anthropic’s Claude 3.5 Sonnet and other Claude models via the Anthropic Messages API.

OpenRouter

Route requests to 100+ models — Mistral, Llama, Gemini, and more — through a single OpenAI-compatible endpoint.

Custom Endpoint

Point Agix at any OpenAI-compatible server, including Ollama, Azure OpenAI, or a local llama.cpp instance.

How provider selection flows through the app

When you interact with Agix, the following steps happen in order:
  1. The ProviderSelector component reads DEFAULT_PROVIDERS to populate the dropdown, filtering out any entry where enabled is false.
  2. When you save your selection, settingsStore.save(config) persists the AIProviderConfig to Office document settings.
  3. On the next request, settingsStore.load(id) retrieves the stored config and passes it to createProvider(config).
  4. createProvider returns the appropriate provider class — OpenAIProvider for openai, openrouter, and custom; ClaudeProvider for claude.
  5. The provider’s chat() method is called with a ChatRequest and returns a ChatResponse that Agix displays in the sidebar.

Build docs developers (and LLMs) love