Reference

Declarative routing configs

Express strategy, targets, retries, fallback, conditions, and caching as one declarative config, inline or saved.

The x-routeplane-config header carries a JSON envelope, {"routing": {…}, "guardrails": {…}}, up to 8 KiB, or a saved-config reference of the form cfg_<id>. The routing section selects the strategy and targets, with per-target overrides for weight, cost, timeout_ms, retry, and parameter shaping, plus conditional routing over request metadata and a cache directive.

jsonx-routeplane-config (inline)
{
  "routing": {
    "strategy": "priority",
    "targets": [
      { "provider": "openai", "retry": { "attempts": 2, "on_status": [429, 503] } },
      { "provider": "anthropic" }
    ],
    "cache": { "mode": "simple", "ttl_seconds": 300 }
  }
}

Send it as a single header value (the whole JSON, minified):

bashpassing the config header
-H 'x-routeplane-config: {"routing":{"strategy":"priority","targets":[{"provider":"openai","retry":{"attempts":2,"on_status":[429,503]}},{"provider":"anthropic"}],"cache":{"mode":"simple","ttl_seconds":300}}}'
Fails loud, never silent. Malformed configs and unknown envelope sections are rejected with 400 (invalid_config, config_not_found, config_too_large), they are never quietly ignored. The optional x-routeplane-metadata header (a ≤4 KiB JSON object) supplies values addressable from routing conditions as metadata.<key>.