Skip to main content
Plugins extend any model’s capabilities without changing the underlying model. Pass a plugins array in your request body to activate one or more plugins.
{
  "model": "openai/gpt-5.4",
  "messages": [...],
  "plugins": [
    {"id": "web"},
    {"id": "context-compression"}
  ]
}
Plugins are composable — you can combine multiple plugins in a single request.

Available Plugins

Ground responses with real-time web data. Works with any model.
{"plugins": [{"id": "web"}]}
Shorthand: append :online to any model slug.
OptionTypeDescription
max_resultsnumberNumber of results to retrieve (default: 5)
enginestringSearch engine: "native", "exa", "parallel"
include_domainsstring[]Restrict results to these domains
exclude_domainsstring[]Exclude results from these domains
See Web Search for the full reference.

context-compression — Context Window Management

Automatically compress prompts that exceed a model’s context window by removing middle messages.
{"plugins": [{"id": "context-compression"}]}
OptionTypeDescription
enabledbooleanSet to false to disable (useful for small-context models where it’s on by default)
See Message Transforms for details.

auto-router — Configurable Auto Routing

Customize which models the auto router can select from using wildcard patterns.
{
  "model": "auto",
  "plugins": [
    {
      "id": "auto-router",
      "allowed_models": ["anthropic/*", "openai/gpt-5.4"]
    }
  ]
}
OptionTypeDescription
allowed_modelsstring[]Wildcard patterns restricting which models auto can select
Pattern syntax:
PatternMatches
anthropic/*All Anthropic models
openai/gpt-5*All GPT-5 variants
google/*All Google models
openai/gpt-5.4Exact match only
See Model Routing — Auto Routing for full details.

Using Multiple Plugins

Plugins can be combined in a single request:
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.arouter.ai/v1",
  apiKey: "lr_live_xxxx",
});

// Web search + context compression
const response = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-4.6",
  messages: longConversation,
  // @ts-ignore
  plugins: [
    { id: "web", max_results: 3 },
    { id: "context-compression" },
  ],
});

Plugin Shorthands

Some plugins have model suffix shorthands for convenience:
ShorthandPlugin equivalent
:onlineplugins: [{"id": "web"}]

Plugin Execution Order

When multiple plugins are active, ARouter applies them in this order:
  1. context-compression — Input is compressed if needed before being sent to the model
  2. web — Search results are retrieved and injected into the prompt
  3. auto-router — Model selection happens (if model: "auto")
  4. Request is forwarded to the selected model

Pricing

Plugin pricing is in addition to normal LLM token costs:
PluginAdditional Cost
context-compressionFree
web (Exa engine)$4 / 1,000 results
web (Parallel engine)$4 / 1,000 results
web (Native engine)Provider passthrough (varies)
auto-routerFree