Plugins
Plugins transform a request before inference or a response after inference. All four plugins start disabled in every workspace; API keys inherit those defaults.
{
"model": "deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": "Explain this error."
}
],
"plugins": [
{
"id": "tool-output-compression"
},
{
"id": "context-compression",
"mode": "conservative"
},
{
"id": "output-compression",
"style": "concise"
}
]
}Available plugins
| Parameter | Type | Default | Description |
|---|---|---|---|
| response-healing | response | off | Repairs non-streaming JSON-mode content. Syntax repair does not validate schemas. |
| tool-output-compression | request | off | Compacts repeated lines and passing test results in recognized tool output. Unknown tools, code fences and JSON pass through. Commands are never executed. |
| context-compression | request | off | Conservative compression of older tool results. Protects instructions, non-tool content, the latest four messages and content already compressed by tool-output filters. |
| output-compression | request | off | Adds concise prose instructions before generation. Does not rewrite completed answers or change max_tokens. Skipped for JSON mode. |
Defaults and overrides
Settings apply per plugin in this order: request, API key, workspace. Workspace settings enable defaults without client changes. API keys offer Inherit, Enabled and Disabled. Omitted plugins and an empty array inherit defaults. Pass { id: "response-healing", enabled: false } to disable an inherited plugin for one request.
The same plugins array works on Chat Completions, Responses and Messages, for BYOK and RelayOn models, including combo requests. Input transforms run once before retries. Streaming supports input and output-style plugins; JSON repair is non-streaming only.
Outcomes and usage
X-RelayOn-Plugins contains a JSON array of enabled plugin outcomes, reasons, processing duration in milliseconds and input-token estimates before and after compression. Estimates use text characters divided by four and are not billing quantities. Upstream usage and actual charges remain authoritative. Output savings vary; no fixed reduction is guaranteed.
Unknown IDs, duplicate plugins and invalid options return 400 invalid_plugins. Compression failures preserve the original input. not_configured means context compression is unavailable; no_eligible_content means there is nothing eligible to compress. Cache entries separate effective plugin settings and implementation versions.
Compression behavior
Context compression runs before inference and preserves the original request if processing exceeds its deadline or returns an invalid result. Tool-output compression applies only to recognized tool results. Output compression adds concise-writing instructions; savings vary by workload and can be negative. Evaluate the returned output and usage with your own requests.