{"version": "1.0","default_effect": "passthrough","statement": [],"enabled": true}
Field | Type | Required | Definition |
version | string | Yes | Policy schema version, currently fixed at "1.0". |
default_effect | string | No, explicit specification is recommended. | Defaults to "passthrough"; optional values are "passthrough" and "deny", which determine how fields in the request body not covered by allow rules are processed. passthrough: Top-level fields not covered by allow rules enter the custom bypass and are then merged back into the request body. deny: Fields not covered by allow rules are not included in the output request body. This does not mean that the entire request is rejected. |
statement | array | No, explicit specification is recommended. | Policy statement array, which is [] when omitted. |
enabled | boolean | No, explicit specification is recommended. | Defaults to true when the policy is submitted, controlling whether text protocol conversion is enabled; it is not equivalent to deleting the configuration. |
Field | Type | Whether Required | Description |
effect | string | Yes | Operation to perform on the target field. Valid values: allow, deny, set_if_absent, set, and rewrite, where: allow: Passes existing target fields to the specified pipeline. It does not automatically add fields or set default values. deny: Drops the specified field from the transformation result. No operation is performed if the field does not exist. set_if_absent: Sets a default value. The specified value is written only when the target field does not exist. set: Force overwrites. If the target exists, it is overwritten. If the target does not exist, the specified value is written. rewrite: Rewrites a field by reading source and, upon a map hit, writing the mapped value to target. Note: "Does not exist" is not equal to empty values: null, false, 0, empty strings, empty objects, and empty arrays all indicate that the field already exists and do not trigger set_if_absent. When the parent of a nested object is missing, an object branch can be created, but no value is written when the parent type is incompatible or an existing array index is out of bounds. rewrite does not automatically delete the source field: source is retained by default upon a successful rewrite. If you do not want the source field to be sent upstream, configure a separate deny rule, or control the output through default_effect: "deny" and an allowlist. When the source does not exist, the type is unsuitable for mapping, or no map entry is matched, the target remains unchanged. Setting values and allowing fields are two separate stages: Setting or rewriting a non-standard field does not automatically add an allow rule for it. If default_effect: "deny" is used, newly written non-standard fields also require an explicit allow to be retained in the output. |
action | string or string[] | Explicit specification is recommended. | Endpoint identifier or a list of endpoints. "*" indicates all supported endpoints. If the field is omitted for compatibility, the meaning is the same as "*". Currently supported values are as follows: chat_completions: Indicates that the client's request path is POST /v1/chat/completions.responses: Indicates that the client's request path is POST /v1/responses.anthropic_messages: Indicates that the client's request path is POST /v1/messages.embeddings: Indicates that the client's request path is POST /v1/embeddings.videos_create: Indicates that the client's request path is POST /v1/videos.videos_list: Indicates that the client's request path is GET /v1/videos.videos_retrieve: Indicates that the client's request path is GET /v1/videos/{video_id}.videos_delete: Indicates that the client's request path is DELETE /v1/videos/{video_id}.rerank: Indicates that the client's request path is POST /v1/rerank, and also supports /v2/rerank and /rerank.Note: Enter the endpoint identifier here, not the path or page display name. For example, enter chat_completions, not /v1/chat/completions, chat_completion, or OpenAI/chat. |
target | string or string[] | Yes | Target location of the operation. In the body space, use JSON Pointer; in the header space, use the HTTP header name. |
resource | string or string[] | No | Original client model name or a list of model names; if omitted or set to "*" alone, it indicates all models. Note: resource matches the original model name actually sent by the client, not the upstream model name after route resolution. Model names are matched by exact value. Partial wildcards such as qwen* are not supported. The system does not check whether the model already exists. For all models, directly write "resource": "*", not "*" in a list. |
space | string | No | Defaults to "body" and can also be set to "header". |
source | string | Required for rewrite | JSON Pointer for reading a value from the original request body |
value | Any JSON value | As required by effect | Literal value to be written, not parsed as a kernel expression. |
value_from | object | As required by effect | Retrieves a value from the original request body or request header; used only for set and set_if_absent, and must be mutually exclusive with value. |
map | array | Required for rewrite | Non-empty mapping table, where each entry is {"key": scalar, "value": any JSON value} |
condition | object | No | Condition for a single statement to take effect. See "Condition Definition". |
Path | Reference |
/max_tokens | Top-level field max_tokens |
/chat_template_kwargs/enable_thinking | Nested field enable_thinking |
/messages/0/role | role of the 0th element in the existing array |
Operator | Form | Meaning |
exists | {"exists": "/thinking"} | The condition is met if the field exists, even when its value is null or false. |
string_equal | {"string_equal": {"/mode": ["fast"]}} | String equality |
number_equal | {"number_equal": {"/n": [1]}} | Numbers are equal, and boolean values are not treated as numbers. |
bool_equal | {"bool_equal": {"/stream": [true]}} | Boolean equality |
null_equal | {"null_equal": {"/metadata": [null]}} | The field exists and its value is null. |
{"version": "1.0","enabled": true,"default_effect": "deny","statement": [{"effect": "allow","action": "chat_completions","resource": "qwen3-demo","target": "/chat_template_kwargs","destination": "custom"}]}
{"model": "qwen3-demo","messages": [{"role": "user", "content": "Hello"}],"chat_template_kwargs": {"enable_thinking": true}}
{"version": "1.0","enabled": true,"default_effect": "passthrough","statement": [{"effect": "deny","action": ["chat_completions", "responses"],"target": ["/frequency_penalty", "/presence_penalty"]}]}
Request Field Fragment | Result Field Fragment |
{"temperature": 0.7, "frequency_penalty": 0.5, "presence_penalty": 0.2} | {"temperature": 0.7} |
{"version": "1.0","enabled": true,"default_effect": "passthrough","statement": [{"effect": "set_if_absent","action": "chat_completions","target": "/max_tokens","value": 2048}]}
Request Field Fragment | Result Field Fragment | Reason |
{} | {"max_tokens": 2048} | Field missing. The default value is supplemented. |
{"max_tokens": 512} | {"max_tokens": 512} | The field already exists. Its original value is retained. |
{"max_tokens": null} | {"max_tokens": null} | null still indicates that the field exists. Whether the upstream accepts it needs to be verified separately. |
{"version": "1.0","enabled": true,"default_effect": "passthrough","statement": [{"effect": "set_if_absent","action": "chat_completions","space": "header","target": "X-CMR-Session-Id","value_from": {"first_available": [{"from": "body", "path": "/session_id"},{"from": "header", "name": "x-conversation-id"}]}}]}
Original Request | Session Header Visible Inside Gateway |
body contains "session_id": "session-001" and no target header. | X-CMR-Session-Id: session-001 |
body does not contain session_id and contains x-conversation-id: session-002. | X-CMR-Session-Id: session-002 |
Existing x-cmr-session-id: session-original. | Retain the original target header. Letter case does not affect the "already exists" determination. |
Neither source exists and no target header is present. | Do not write the target header. |

messages, model, audio, frequency_penalty, function_call, functions,logit_bias, logprobs, max_completion_tokens, max_tokens, metadata,modalities, moderation, n, parallel_tool_calls, prediction,presence_penalty, prompt_cache_key, prompt_cache_options,prompt_cache_retention, reasoning_effort, response_format,safety_identifier, seed, service_tier, stop, store, stream,stream_options, temperature, tool_choice, tools, top_logprobs,top_p, user, verbosity, web_search_options
max_tokens, messages, model, cache_control, container, inference_geo,metadata, output_config, service_tier, stop_sequences, stream, system,temperature, thinking, tool_choice, tools, top_k, top_p
background, context_management, conversation, include, input,instructions, max_output_tokens, max_tool_calls, metadata, model,moderation, parallel_tool_calls, previous_response_id, prompt,prompt_cache_key, prompt_cache_options, prompt_cache_retention,reasoning, safety_identifier, service_tier, store, stream,stream_options, temperature, text, tool_choice, tools, top_logprobs,top_p, truncation, user
model, input, dimensions, encoding_format, user
model, contents, task_type, duration, resolution, aspect_ratio,audio, seed, watermark, negative_prompt
status, model, offset, limit
video_id
video_id
model, query, documents, top_n, return_documents, instruct
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback