request block enables you to perform lightweight transformations on the payload before it gets sent to the upstream provider.
Header Operations
You can arbitrarily set or delete HTTP headers going to the upstream server.Model Mapping
Usemodel_map to alias or hardcode model names conditionally.
- Maps
$request.modelto$request.model_mapped. - Exact match on the
fromstring. - If no matches occur,
model_map_defaultdictates what$request.model_mappedbecomes.
JSON Mutations
Apply lightweight mutations directly to the upstream JSON body.- Supports a subset of object-path JSONPath expressions (e.g.
$.a.b.c). json_setvalues support primitives (true,false,null, integers, strings) or expressions (likeconcat(...)).json_wrap_input_textconverts a string field into an OpenAI Responsesinputmessage list, leaves missing or already-array values unchanged, and rejects other types.
Structural Request Mapping
Usereq_map to apply heavy, cross-provider schema transformations (such as converting an OpenAI JSON request into a Gemini or Anthropic JSON request).
after_req_map when a request JSON mutation must run after the structural mapping step.
- Only request JSON mutation directives are allowed inside
after_req_map. - If no
req_mapis configured,after_req_mapruns after the normal request JSON operations.
Built-in Modes (v0.1)
openai_chat_to_openai_responsesanthropic_to_openai_chatgemini_to_openai_chatopenai_chat_to_gemini_generate_contentopenai_chat_to_anthropic_messages