Monoize
Transforms

Field: set

Write a JSON value at a configured path, optionally only when a condition matches.

What it does

This transform writes a JSON value at the configured extra-body path. With when_equals set, it writes only when the current value equals the given JSON value. Without when_equals, it always writes.

Use it to add or replace provider-specific fields that the protocol conversion does not carry.

Reference

PropertyValue
Type IDfield_set
Phaserequest, response
ScopesProvider

When to use

  • An upstream needs a vendor-specific field, for example a service tier or a thinking switch.
  • You want to normalize one field value for every request that a Provider serves.

Configuration

OptionTypeRequiredDefaultDescription
pathstringYesDot-separated extra-body path to write, for example service_tier.
valueJSONYesThe JSON value written at the path.
when_equalsJSONNoWhen set, write only if the current value equals this JSON value.

Example rule

{
  "transform": "field_set",
  "enabled": true,
  "phase": "request",
  "models": [
    "gpt-*"
  ],
  "config": {
    "path": "service_tier",
    "value": "flex"
  }
}

On this page