Documentation Index
Fetch the complete documentation index at: https://docs.arouter.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
web — Web Search
Ground responses with real-time web data. Works with any model.
{"plugins": [{"id": "web"}]}
Shorthand: append :online to any model slug.
| Option | Type | Description |
|---|
max_results | number | Number of results to retrieve (default: 5) |
engine | string | Search engine: "native", "exa", "parallel" |
include_domains | string[] | Restrict results to these domains |
exclude_domains | string[] | 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"}]}
| Option | Type | Description |
|---|
enabled | boolean | Set 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"]
}
]
}
| Option | Type | Description |
|---|
allowed_models | string[] | Wildcard patterns restricting which models auto can select |
Pattern syntax:
| Pattern | Matches |
|---|
anthropic/* | All Anthropic models |
openai/gpt-5* | All GPT-5 variants |
google/* | All Google models |
openai/gpt-5.4 | Exact 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" },
],
});
from openai import OpenAI
client = OpenAI(
base_url="https://api.arouter.ai/v1",
api_key="lr_live_xxxx",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4.6",
messages=long_conversation,
extra_body={
"plugins": [
{"id": "web", "max_results": 3},
{"id": "context-compression"},
]
},
)
curl https://api.arouter.ai/v1/chat/completions \
-H "Authorization: Bearer lr_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.6",
"messages": [...],
"plugins": [
{"id": "web", "max_results": 3},
{"id": "context-compression"}
]
}'
Plugin Shorthands
Some plugins have model suffix shorthands for convenience:
| Shorthand | Plugin equivalent |
|---|
:online | plugins: [{"id": "web"}] |
Plugin Execution Order
When multiple plugins are active, ARouter applies them in this order:
- context-compression — Input is compressed if needed before being sent to the model
- web — Search results are retrieved and injected into the prompt
- auto-router — Model selection happens (if
model: "auto")
- Request is forwarded to the selected model
Pricing
Plugin pricing is in addition to normal LLM token costs:
| Plugin | Additional Cost |
|---|
context-compression | Free |
web (Exa engine) | $4 / 1,000 results |
web (Parallel engine) | $4 / 1,000 results |
web (Native engine) | Provider passthrough (varies) |
auto-router | Free |