Skip to Content
prxy.monster v1 is in early access. See what shipped →
QuickstartQuick start — Customize a pipeline

Customize your pipeline

A pipeline is an ordered list of modules. Modules run in order, each one gets the chance to mutate the request, short-circuit with a cached response, or attach metadata. The provider call sits in the middle. Post-pipeline modules then run on the response.

[ pre ] ──▶ [ pre ] ──▶ [ pre ] ──▶ provider ──▶ [ post ] ──▶ [ post ]

Three ways to set the pipeline

Configuration sources, in priority (highest wins):

#SourceUse when
1Per-request header x-prxy-pipeA single call needs different behavior.
2API key config (set in dashboard)Different keys for different services.
3PRXY_PIPE env varProcess-wide default in local mode.
4config.yamlLocal mode, parameterized configs.
5Built-in defaultNothing else set.

The built-in default is:

mcp-optimizer,semantic-cache,patterns

Comma list (env var, header, dashboard)

Simplest. Module names separated by commas:

PRXY_PIPE=exact-cache,semantic-cache,cost-guard,patterns

Or per-request:

curl -H "x-prxy-pipe: exact-cache,patterns" ...

YAML (config file, dashboard advanced view)

When you need to pass options to a module:

pipeline: - mcp-optimizer: relevanceThreshold: 0.6 preserveTools: ['read_file', 'write_file'] - semantic-cache: similarity: 0.92 ttlSeconds: 3600 - cost-guard: perRequest: 0.10 perDay: 5.00 - patterns: maxInjected: 5 minSuccessRate: 0.7

Order matters

A few rules of thumb:

  1. Caches first. A cache hit short-circuits the pipeline — no point running a 3-step optimizer pipeline before checking if you’ve answered this exact question already.
  2. Cost guards before optimizers. Reject before optimizing.
  3. Optimizers before injection. Strip tokens before adding more.
  4. Injection before routing. The router picks a model based on what’s actually being sent.

The provider call happens after the last pre hook. Then post hooks run on the response (these don’t block your client — they’re side effects: cache writes, pattern forging, usage tracking).

The usage-tracker module is appended automatically in cloud mode. You can list it explicitly to control its position, but you can’t disable it in cloud — usage tracking IS billing.

Recipes for common shapes

Don’t compose from scratch — start with a recipe:

Inspect what’s actually running

curl https://api.prxy.monster/v1/pipeline \ -H "Authorization: Bearer $ANTHROPIC_API_KEY"

Returns the resolved pipeline for your key including version of each module. See API → /v1/pipeline.

Last updated on